This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/answer-website.git


The following commit(s) were added to refs/heads/main by this push:
     new e0658ceb0 feat: add latest.json file
e0658ceb0 is described below

commit e0658ceb0901e70c6b8dc0a279a6b58c4178a9cd
Author: shuai <[email protected]>
AuthorDate: Thu Apr 24 16:10:27 2025 +0800

    feat: add latest.json file
---
 docusaurus.config.js    |  5 -----
 src/pages/download.tsx  |  3 ++-
 src/pages/latest.tsx    | 21 ---------------------
 static/data/latest.json |  6 ++++++
 4 files changed, 8 insertions(+), 27 deletions(-)

diff --git a/docusaurus.config.js b/docusaurus.config.js
index 4aa5d2668..cc3b544ed 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -82,11 +82,6 @@ const config = {
     ({
       metadata: [
         {name: 'keywords', content: 'Free, Open-source, Q&A Platform, 
Knowledge Sharing Platform, Community Forum, Knowledge Base, Developer Hub, 
Support Center'},
-        {
-          name: 'http-equiv',
-          content: 'Content-Security-Policy',
-          value: "default-src 'self' data: blob: 'unsafe-inline' 
https://www.apachecon.com/ https://www.communityovercode.org/ 
https://analytics.apache.org/ https://api-js.mixpanel.com/track/; connect-src 
https://api-js.mixpanel.com/track/;";
-        }
       ],
       colorMode: {
         defaultMode: 'light',
diff --git a/src/pages/download.tsx b/src/pages/download.tsx
index 4aef87fae..0dc721780 100644
--- a/src/pages/download.tsx
+++ b/src/pages/download.tsx
@@ -2,11 +2,12 @@ import React, { JSX } from 'react'
 import { Container } from 'react-bootstrap'
 import { translate } from '@docusaurus/Translate'
 import Layout from '@theme/Layout'
+import latest from '@site/static/data/latest.json'
 
 import HeaderSlogan from '../components/HeaderSlogan'
 
 export default function Plugins(): JSX.Element {
-  const item = '1.4.5'
+  const item =  latest.release.version;
   return (
     <Layout
       title={translate({ message: 'Download' })}
diff --git a/src/pages/latest.tsx b/src/pages/latest.tsx
deleted file mode 100644
index 9fcbf16b1..000000000
--- a/src/pages/latest.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import React from 'react';
-import { Container } from 'react-bootstrap';
-import Layout from '@theme/Layout';
-import Head from '@docusaurus/Head';
-
-
-export default function Plugins(): JSX.Element {
-
-  return (
-    <Layout
-      title="Latest Version"
-      description="Statistical version information.">
-      <Head>
-        <meta name="robots" content="noindex, nofollow" />
-      </Head>
-      <Container className='py-5'>
-        <h1 id="latest_version">1.4.2</h1>
-      </Container>
-    </Layout>
-  )
-}
diff --git a/static/data/latest.json b/static/data/latest.json
new file mode 100644
index 000000000..99f558ddb
--- /dev/null
+++ b/static/data/latest.json
@@ -0,0 +1,6 @@
+{
+  "release": {
+    "version": "1.4.5",
+    "url": "https://github.com/answerdev/answer/releases/tag/v1.4.5";
+  }
+}
\ No newline at end of file

Reply via email to