Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GA_TRACKING_ID = "G-854W8PEZ1Z"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It's great that you've added an example environment file. However, using a real-looking tracking ID like G-854W8PEZ1Z could lead to developers accidentally using it in their local or even production environments if they copy the file without modification. This could pollute the analytics data. It's better practice to use a placeholder value to make it clear that it needs to be replaced.

GA_TRACKING_ID="G-XXXXXXXXXX"

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# Misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand All @@ -22,4 +23,4 @@ yarn-error.log*
# Vscode files
.vscode

package-lock.json
package-lock.json
14 changes: 6 additions & 8 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// @ts-check
// `@type` JSDoc annotations allow editor autocompletion and type checking

import dotenv from "dotenv";
dotenv.config();

import { themes as prismThemes } from "prism-react-renderer";

/** @type {import('@docusaurus/types').Config} */
Expand All @@ -12,7 +15,6 @@ const config = {
url: "https://kmesh.net",

// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/",

onBrokenLinks: "throw",
Expand Down Expand Up @@ -44,7 +46,7 @@ const config = {
showLastUpdateTime: true,
},
gtag: {
trackingID: "G-854W8PEZ1Z",
trackingID: process.env.GA_TRACKING_ID,
anonymizeIP: true,
},
blog: {
Expand All @@ -53,10 +55,7 @@ const config = {
type: ["rss", "atom"],
xslt: true,
},
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: "https://github.com/kmesh-net/website/blob/main",
// Useful options to enforce blogging best practices
onInlineTags: "warn",
onInlineAuthors: "warn",
onUntruncatedBlogPosts: "warn",
Expand All @@ -71,7 +70,6 @@ const config = {
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
docs: {
sidebar: {
hideable: true,
Expand Down Expand Up @@ -152,11 +150,11 @@ const config = {
[
"docusaurus-lunr-search",
{
languages: ["en",'zh'],
languages: ["en", "zh"],
indexDocs: true,
indexBlog: true,
indexPages: false,
}
},
],
],
};
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"clsx": "^2.0.0",
"docusaurus-lunr-search": "^3.6.0",
"docusaurus-plugin-sass": "^0.2.6",
"dotenv": "^17.2.3",
"plugin-image-zoom": "flexanalytics/plugin-image-zoom",
"prism-react-renderer": "^2.3.0",
"react": "^19.0.0",
Expand Down
30 changes: 22 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2276,10 +2276,15 @@
dependencies:
"@types/mdx" "^2.0.0"

"@node-rs/jieba-darwin-arm64@2.0.1":
"@node-rs/jieba-linux-x64-gnu@2.0.1":
version "2.0.1"
resolved "https://registry.npmjs.org/@node-rs/jieba-darwin-arm64/-/jieba-darwin-arm64-2.0.1.tgz"
integrity sha512-10+nwGQ6KzXXJlIL/sELA6Fi6m7eJ7xJksBiKuw1kxKUgaJwtVfAG0iqRF+NRQv0Sdq7r3k5ew9K9y0+IYaEcA==
resolved "https://registry.npmjs.org/@node-rs/jieba-linux-x64-gnu/-/jieba-linux-x64-gnu-2.0.1.tgz"
integrity sha512-sq3J6L2ANTE25I9eVFq/nb57OtXcvUIeUD1CTKJxwgTKIVmcB2LyOZpWf20AjHRUfbMER9Klqg5dgyyO+Six+w==

"@node-rs/[email protected]":
version "2.0.1"
resolved "https://registry.npmjs.org/@node-rs/jieba-linux-x64-musl/-/jieba-linux-x64-musl-2.0.1.tgz"
integrity sha512-0zfP9Qy68yEXrhBFknfhF6WUJDPU/8eRuyIrkMGdMjfRpxhpSbr2fMfnsqhOQLvhuK4w3iDFvTy4t5d0s6JKMA==

"@node-rs/jieba@^2.0.1":
version "2.0.1"
Expand Down Expand Up @@ -2322,10 +2327,15 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@parcel/watcher-darwin-arm64@2.5.1":
"@parcel/watcher-linux-x64-glibc@2.5.1":
version "2.5.1"
resolved "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz"
integrity sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw==
resolved "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz"
integrity sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==

"@parcel/[email protected]":
version "2.5.1"
resolved "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz"
integrity sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==

"@parcel/watcher@^2.4.1":
version "2.5.1"
Expand Down Expand Up @@ -4356,6 +4366,11 @@ dot-prop@^6.0.1:
dependencies:
is-obj "^2.0.0"

dotenv@^17.2.3:
version "17.2.3"
resolved "https://registry.npmjs.org/dotenv/-/dotenv-17.2.3.tgz"
integrity sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==

dunder-proto@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz"
Expand Down Expand Up @@ -7515,8 +7530,7 @@ pkg-up@^3.1.0:

plugin-image-zoom@flexanalytics/plugin-image-zoom:
version "1.1.0"
resolved "https://codeload.github.com/flexanalytics/plugin-image-zoom/tar.gz/8e1b866c79ed6d42cefc4c52f851f1dfd1d0c7de"
integrity sha512-y/KQYx2qGrnMwB0zPxxN3g2teitLlHjGFJDoepfjJg2cC1AB5qCC9Bzp5YsNGQb2+Vw0Nd4O32b8FQGTgFSrVw==
resolved "git+ssh://[email protected]/flexanalytics/plugin-image-zoom.git#8e1b866c79ed6d42cefc4c52f851f1dfd1d0c7de"
dependencies:
medium-zoom "^1.0.8"

Expand Down