diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d5a5987e..288c7619 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -50,5 +50,5 @@ jobs: RSS_DESCRIPTION: ${{ vars.RSS_DESCRIPTION }} run: | cd Rin/ - bun install --frozen-lockfile + bun install bun scripts/migrator.ts diff --git a/README.md b/README.md index 7ab67600..8e794f6f 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ English | [简体中文](./README_zh_CN.md) ![Cover](https://repository-images.githubusercontent.com/803866357/958bc2c1-1703-4127-920c-853291495bdc) -![GitHub commit activity](https://img.shields.io/github/commit-activity/w/OXeu/Rin?style=for-the-badge) -![GitHub branch check runs](https://img.shields.io/github/check-runs/OXeu/Rin/main?style=for-the-badge) -![GitHub top language](https://img.shields.io/github/languages/top/OXeu/Rin?style=for-the-badge) -![GitHub License](https://img.shields.io/github/license/OXeu/Rin?style=for-the-badge) -![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/OXeu/Rin/deploy.yaml?style=for-the-badge) +![GitHub commit activity](https://img.shields.io/github/commit-activity/w/openRin/Rin?style=for-the-badge) +![GitHub branch check runs](https://img.shields.io/github/check-runs/openRin/Rin/main?style=for-the-badge) +![GitHub top language](https://img.shields.io/github/languages/top/openRin/Rin?style=for-the-badge) +![GitHub License](https://img.shields.io/github/license/openRin/Rin?style=for-the-badge) +![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/openRin/Rin/deploy.yaml?style=for-the-badge) # Introduction @@ -34,23 +34,15 @@ Rin is a blog based on Cloudflare Pages + Workers + D1 + R2. It does not require 13. For more features, please refer to https://xeu.life # Documentation -1. [Deployment Documentation](./docs/DEPLOY.md) - -2. [Environment Variables List](./docs/ENV.md) - -3. [SEO Optimization Configuration](./docs/SEO.md) - -4. [Contribution Guide](./CONTRIBUTING.md) - -5. [Code of Conduct](./CODE_OF_CONDUCT.md) +[rin-docs.xeu.life](https://rin-docs.xeu.life) ## Star History - + - - - Star History Chart + + + Star History Chart diff --git a/README_zh_CN.md b/README_zh_CN.md index 14f6129b..6e7ead99 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -5,11 +5,11 @@ ![封面](https://repository-images.githubusercontent.com/803866357/958bc2c1-1703-4127-920c-853291495bdc) -![GitHub commit activity](https://img.shields.io/github/commit-activity/w/OXeu/Rin?style=for-the-badge) -![GitHub branch check runs](https://img.shields.io/github/check-runs/OXeu/Rin/main?style=for-the-badge) -![GitHub top language](https://img.shields.io/github/languages/top/OXeu/Rin?style=for-the-badge) -![GitHub License](https://img.shields.io/github/license/OXeu/Rin?style=for-the-badge) -![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/OXeu/Rin/deploy.yaml?style=for-the-badge) +![GitHub commit activity](https://img.shields.io/github/commit-activity/w/openRin/Rin?style=for-the-badge) +![GitHub branch check runs](https://img.shields.io/github/check-runs/openRin/Rin/main?style=for-the-badge) +![GitHub top language](https://img.shields.io/github/languages/top/openRin/Rin?style=for-the-badge) +![GitHub License](https://img.shields.io/github/license/openRin/Rin?style=for-the-badge) +![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/openRin/Rin/deploy.yaml?style=for-the-badge) # 介绍 @@ -36,23 +36,16 @@ Rin 是一个基于 Cloudflare Pages + Workers + D1 + R2 全家桶的博客, 13. 更多特性请参考 https://xeu.life # 文档 -1. [部署文档(Github)](./docs/DEPLOY.md) -2. [环境变量列表](./docs/ENV.md) - -3. [SEO 优化配置](./docs/SEO.md) - -4. [贡献指南](./CONTRIBUTING.md) - -5. [行为准则](./CODE_OF_CONDUCT.md) +[rin-docs.xeu.life](https://rin-docs.xeu.life) ## Star History - + - - - Star History Chart + + + Star History Chart diff --git a/client/public/locales/en/translation.json b/client/public/locales/en/translation.json index 33a9ff8d..d9dc107a 100644 --- a/client/public/locales/en/translation.json +++ b/client/public/locales/en/translation.json @@ -135,6 +135,10 @@ "desc": "Set the icon (Favicon) displayed in the browser's address bar", "title": "Favicon" }, + "footer": { + "desc": "Set the footer content of the site (HTML)", + "title": "Footer" + }, "friend": { "apply": { "desc": "Allow other users to apply for friend links (requires review)", diff --git a/client/public/locales/ja/translation.json b/client/public/locales/ja/translation.json index 79b31657..e395ece5 100644 --- a/client/public/locales/ja/translation.json +++ b/client/public/locales/ja/translation.json @@ -135,6 +135,10 @@ "desc": "ブラウザのアドレスバーに表示されるアイコン(ファビコン)を設定します。", "title": "ファビコン" }, + "footer": { + "desc": "サイトのフッターコンテンツを設定する(HTML)", + "title": "フッター" + }, "friend": { "apply": { "desc": "他のユーザーが友人リンクを申請できるようにする(審査が必要)", diff --git a/client/public/locales/zh/translation.json b/client/public/locales/zh/translation.json index 8542b018..e3f8e9dd 100644 --- a/client/public/locales/zh/translation.json +++ b/client/public/locales/zh/translation.json @@ -135,6 +135,10 @@ "desc": "设置显示于浏览器的地址栏的图标(Favicon)", "title": "网站图标" }, + "footer": { + "desc": "设置显示于站点底部的内容(HTML)", + "title": "站点底部内容" + }, "friend": { "apply": { "desc": "允许其他用户申请友链(需审核)", diff --git a/client/src/App.tsx b/client/src/App.tsx index f6819ef6..9b283116 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -32,7 +32,7 @@ function App() { client.user.profile.get({ headers: headersWithAuth() }).then(({ data }) => { - if (data && typeof data != 'string') { + if (data && typeof data !== 'string') { setProfile({ id: data.id, avatar: data.avatar || '', @@ -49,7 +49,7 @@ function App() { setConfig(configWrapper) } else { client.config({ type: "client" }).get().then(({ data }) => { - if (data && typeof data != 'string') { + if (data && typeof data !== 'string') { sessionStorage.setItem('config', JSON.stringify(data)) const config = new ConfigWrapper(data, defaultClientConfig) setConfig(config) diff --git a/client/src/components/footer.tsx b/client/src/components/footer.tsx index 616e6be3..4d5982f5 100644 --- a/client/src/components/footer.tsx +++ b/client/src/components/footer.tsx @@ -10,6 +10,7 @@ function Footer() { const { t } = useTranslation() const [modeState, setModeState] = useState('system'); const config = useContext(ClientConfigContext); + const footerHtml = config.get('footer'); useEffect(() => { const mode = localStorage.getItem('theme') as ThemeMode || 'system'; setModeState(mode); @@ -42,9 +43,10 @@ function Footer() {
+ {footerHtml &&
}

- © 2024 Powered by Rin + © 2024 Powered by Rin {config.get('rss') && <> diff --git a/client/src/components/header.tsx b/client/src/components/header.tsx index 2f6aa2e9..91289fbf 100644 --- a/client/src/components/header.tsx +++ b/client/src/components/header.tsx @@ -229,7 +229,7 @@ function SearchButton({ className, onClose }: { className?: string, onClose?: () setIsOpened(false) onClose?.() }, 100) - if (value.length != 0) + if (value.length !== 0) setLocation(`/search/${key}`) } return (

diff --git a/client/src/components/markdown.tsx b/client/src/components/markdown.tsx index e97cc0e2..39ae569e 100644 --- a/client/src/components/markdown.tsx +++ b/client/src/components/markdown.tsx @@ -365,7 +365,7 @@ export function Markdown({ content }: { content: string }) { }, }; }) - .filter((slide) => slide.src != ""); + .filter((slide) => slide.src !== ""); slides.current = (slidesLocal); } const index = slidesLocal?.findIndex((slide) => slide.src === src) ?? -1; diff --git a/client/src/hooks/useTableOfContents.tsx b/client/src/hooks/useTableOfContents.tsx index ddafe85c..de411f40 100644 --- a/client/src/hooks/useTableOfContents.tsx +++ b/client/src/hooks/useTableOfContents.tsx @@ -58,7 +58,7 @@ const useTableOfContents = (selector: string) => { ) intersectingList.length = 0 // reset array headers.forEach((header, i) => { - if (header.getAttribute('data-id') != null) return + if (header.getAttribute('data-id') !== null) return header.setAttribute('data-id', i.toString()) // set data-id intersectingList.push(false) // increase array length io.current!.observe(header) // register to observe diff --git a/client/src/page/feed.tsx b/client/src/page/feed.tsx index f4118164..de6f6969 100644 --- a/client/src/page/feed.tsx +++ b/client/src/page/feed.tsx @@ -72,7 +72,7 @@ export function FeedPage({ id, TOC, clean }: { id: string, TOC: () => JSX.Elemen } function topFeed() { const isUnTop = !(top > 0) - const topNew = top === 0 ? 1 : 0; + const topNew = isUnTop ? 1 : 0; // Confirm showConfirm( isUnTop ? t("article.top.title") : t("article.untop.title"), @@ -204,12 +204,12 @@ export function FeedPage({ id, TOC, clean }: { id: string, TOC: () => JSX.Elemen )}
{counterEnabled &&

- {t("count.pv")} + {t("count.pv")} {feed.pv} | - {t("count.uv")} + {t("count.uv")} {feed.uv} diff --git a/client/src/page/feeds.tsx b/client/src/page/feeds.tsx index 13fbacc7..fb8c4a31 100644 --- a/client/src/page/feeds.tsx +++ b/client/src/page/feeds.tsx @@ -45,7 +45,7 @@ export function FeedsPage() { }, headers: headersWithAuth() }).then(({ data }) => { - if (data && typeof data != 'string') { + if (data && typeof data !== 'string') { setFeeds({ ...feeds, [type]: data diff --git a/client/src/page/friends.tsx b/client/src/page/friends.tsx index d9964a18..5cdb26ad 100644 --- a/client/src/page/friends.tsx +++ b/client/src/page/friends.tsx @@ -98,13 +98,13 @@ export function FriendsPage() { - +

0} friends={friendsAvailable} /> 0} friends={friendsUnavailable} /> 0} friends={waitList} /> 0} friends={refusedList} /> - + {profile && (profile.permission || config.get("friend_apply_enable")) &&
@@ -210,7 +210,7 @@ function Friend({ friend }: { friend: FriendItem }) {

{friend.name}

{friend.health.length == 0 &&

{friend.desc}

} - {friend.accepted != 1 &&

{statusOption[friend.accepted + 1].label}

} + {friend.accepted !== 1 &&

{statusOption[friend.accepted + 1].label}

} {friend.health.length > 0 &&

{errorHumanize(friend.health)}

} {(profile?.permission || profile?.id === friend.uid) && <>