Skip to content

Commit

Permalink
Dev (#1)
Browse files Browse the repository at this point in the history
* chore: rss format compatibility

Signed-off-by: Innei <i@innei.in>

* fix: wrapped element `x,y` detection

Signed-off-by: Innei <i@innei.in>

* fix(deps): update dependency mermaid to v11 (Innei#442)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency vite-tsconfig-paths to v5 (Innei#421)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency rimraf to v6 (Innei#397)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update all non-major dependencies

* fix(deps): update all non-major dependencies (Innei#424)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency chroma-js to v3 (Innei#432)

* fix: location reload not working (Innei#431)

* fix(deps): update dependency chroma-js to v3

---------

Co-authored-by: Suemor <suemor233@outlook.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency postcss-preset-env to v10 (Innei#416)

* fix: location reload not working (Innei#431)

* chore(deps): update dependency postcss-preset-env to v10

---------

Co-authored-by: Suemor <suemor233@outlook.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency zx to v8.1.5

* fix: link underline style when selected

Signed-off-by: Innei <i@innei.in>

* [wip]: test i18n

* fix: i18n on activity

* [wip]

* [wip]: keep going

* [wip]: i18n

---------

Signed-off-by: Innei <i@innei.in>
Co-authored-by: Innei <i@innei.in>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Suemor <suemor233@outlook.com>
  • Loading branch information
4 people committed Sep 22, 2024
1 parent 19a28c8 commit f6d8c36
Show file tree
Hide file tree
Showing 32 changed files with 1,196 additions and 1,299 deletions.
6 changes: 3 additions & 3 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { fileURLToPath } from 'node:url'
import NextBundleAnalyzer from '@next/bundle-analyzer'
import { codeInspectorPlugin } from 'code-inspector-plugin'
import { config } from 'dotenv'


import createNextIntlPlugin from 'next-intl/plugin';

process.title = 'Shiro (NextJS)'

Expand All @@ -19,6 +18,7 @@ const __dirname = path.dirname(__filename)
let commitHash = ''
let commitUrl = ''
const repoInfo = getRepoInfo()
const withNextIntl = createNextIntlPlugin();

if (repoInfo) {
commitHash = repoInfo.hash
Expand Down Expand Up @@ -135,7 +135,7 @@ if (process.env.ANALYZE === 'true') {
})(nextConfig)
}

export default nextConfig
export default withNextIntl(nextConfig);

function getRepoInfo() {
if (process.env.VERCEL) {
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
"foxact": "0.2.38",
"framer-motion": "11.5.4",
"fuse.js": "7.0.0",
"i18next": "^23.14.0",
"i18next-resources-to-backend": "^1.2.1",
"idb-keyval": "6.2.1",
"immer": "^10.1.1",
"jojoo": "0.1.4",
Expand Down Expand Up @@ -98,6 +100,7 @@
"react-dom": "18.3.1",
"react-error-boundary": "4.0.13",
"react-intersection-observer": "9.13.1",
"react-i18next": "^15.0.1",
"react-responsive-masonry": "2.3.0",
"react-toastify": "10.0.5",
"react-tweet": "3.2.1",
Expand Down Expand Up @@ -205,4 +208,4 @@
"browserslist": [
"defaults and fully supports es6-module"
]
}
}
2,020 changes: 995 additions & 1,025 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions public/locales/zh-TW.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"Home": {
"post": "文章",
"note": "筆記",
"like": "按讚",
"subscribe": "訂閱",
"thank_you": "謝謝你",
"activity_post": "最近更新的文章",
"activity_note": "最近更新的筆記",
"activity_recent": "最近發生的事",
"more": "更多"
},
"Subscribe": {
"post": "文章",
"note": "筆記",
"subscribe": "訂閱",
"disabled": "訂閱功能未啟用",
"welcome": "歡迎訂閱「{title} 」,我會定期推送最新的內容到你提供的信箱上。",
"mail_subscribe": "Email 訂閱",
"mail_placeholder": "Email",
"success": "訂閱成功!",
"use_feed_pre": "或者您也可以透過",
"use_feed_post": "訂閱「{title}」的 RSS。"
}
}
77 changes: 42 additions & 35 deletions src/app.config.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
{
"// example app config": "",
"footer": {
"otherInfo": {
"date": "2020-{{now}}"
"date": "2024-{{now}}"
},
"linkSections": [
{
"name": "关于",
"name": "關於",
"links": [
{
"name": "关于本站",
"href": "/about-site"
},
{
"name": "关于我",
"href": "/about-me"
"href": "/about"
},
{
"name": "关于此项目",
"href": "https://github.com/innei/Shiro",
"name": "關於此專案",
"href": "https://github.com/gcaaa31928/Shiro",
"external": true
}
]
Expand All @@ -27,42 +22,61 @@
"name": "更多",
"links": [
{
"name": "时间线",
"name": "時間線",
"href": "/timeline"
},
{
"name": "友链",
"name": "好友們",
"href": "/friends"
},
{
"name": "监控",
"href": "https://status.shizuri.net/status/main",
"external": true
}
]
},
{
"name": "联系",
"name": "聯絡方式",
"links": [
{
"name": "写留言",
"name": "留言",
"href": "/message"
},
{
"name": "发邮件",
"href": "mailto:i@innei.ren",
"name": "信箱",
"href": "mailto:me@redhuang.dev",
"external": true
},
{
"name": "GitHub",
"href": "https://github.com/innei",
"href": "https://github.com/gcaaa31928",
"external": true
}
]
}
]
},
"config": {
"color": {
"light": [
"#33A6B8",
"#FF6666",
"#26A69A",
"#fb7287",
"#69a6cc",
"#F11A7B",
"#78C1F3",
"#FF6666",
"#7ACDF6"
],
"dark": [
"#F596AA",
"#A0A7D4",
"#ff7b7b",
"#99D8CF",
"#838BC6",
"#FFE5AD",
"#9BE8D8",
"#A1CCD1",
"#EAAEBA"
]
},
"bg": [
"https://github.com/Innei/static/blob/master/images/F0q8mwwaIAEtird.jpeg?raw=true",
"https://github.com/Innei/static/blob/master/images/IMG_2111.jpeg.webp.jpg?raw=true"
Expand All @@ -87,7 +101,7 @@
},
{
"type": "h1",
"text": "Innei",
"text": "Red Huang",
"class": "font-medium mx-2 text-4xl"
},
{
Expand All @@ -100,7 +114,7 @@
},
{
"type": "h1",
"text": "A NodeJS Full Stack ",
"text": "A Full Stack ",
"class": "font-light text-4xl"
},
{
Expand All @@ -114,20 +128,13 @@
}
]
},
"description": "An independent developer coding with love."
"description": "Where Logic Meets Artistry."
},
"module": {
"donate": {
"activity": {
"enable": true,
"link": "https://afdian.net/@Innei",
"qrcode": [
"https://cdn.jsdelivr.net/gh/Innei/img-bed@master/20191211132347.png",
"https://cdn.innei.ren/bed/2023/0424213144.png"
]
},
"bilibili": {
"liveId": 1434499
"endpoint": "/fn/ps/update"
}
}
}
}
}
12 changes: 6 additions & 6 deletions src/app/(app)/(home)/components/ActivityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ export const ActivityCard = ({ activity }: { activity: ReactActivityType }) => {
<b>
{activity.title ||
(activity.type === CollectionRefTypes.Recently
? '一条想法中'
? '一個想法中'
: null)}
</b>
</Link>{' '}
<small></small>
<small></small>
</div>
</div>
<div className="flex pl-8">
Expand All @@ -96,7 +96,7 @@ export const ActivityCard = ({ activity }: { activity: ReactActivityType }) => {
<FaSolidFeatherAlt />
</div>
<div className="space-x-2">
<small>发布了</small>{' '}
<small>發表了</small>{' '}
<Link href={routeBuilder(Routes.Note, { id: activity.nid })}>
<b>{activity.title}</b>
</Link>
Expand All @@ -111,7 +111,7 @@ export const ActivityCard = ({ activity }: { activity: ReactActivityType }) => {
<IcTwotoneSignpost />
</div>
<div className="space-x-2">
<small>发布了</small>{' '}
<small>發表了</small>{' '}
<Link href={`/posts/${activity.slug}`}>
<b>{activity.title}</b>
</Link>
Expand Down Expand Up @@ -169,7 +169,7 @@ export const ActivityCard = ({ activity }: { activity: ReactActivityType }) => {
break
}
default: {
TitleLink = <b>已删除的内容</b>
TitleLink = <b>已經刪除的內容</b>
}
}
return (
Expand All @@ -178,7 +178,7 @@ export const ActivityCard = ({ activity }: { activity: ReactActivityType }) => {
<i className="icon-[mingcute--heart-line]" />
</span>
<div className="space-x-2">
<small>有人点赞了</small> {TitleLink}
<small>有人喜歡了</small> {TitleLink}
</div>
</div>
)
Expand Down
14 changes: 10 additions & 4 deletions src/app/(app)/(home)/components/ActivityPostList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { m } from 'framer-motion'
import Link from 'next/link'
import { useTranslations } from 'next-intl'
import React from 'react'

import { Divider } from '~/components/ui/divider'
Expand All @@ -12,6 +13,7 @@ import { routeBuilder, Routes } from '~/lib/route-builder'
import { useHomeQueryData } from '../query'

export const ActivityPostList = () => {
const t = useTranslations('Home')
const { notes, posts } = useHomeQueryData()
return (
<m.section
Expand All @@ -21,7 +23,9 @@ export const ActivityPostList = () => {
className="mt-8 flex flex-col gap-4 lg:mt-0"
viewport={{ once: true }}
>
<h2 className="text-2xl font-medium leading-loose">最近更新的文稿</h2>
<h2 className="text-2xl font-medium leading-loose">
{t('activity_post')}
</h2>
<ul className="shiro-timeline mt-4">
{posts.map((post) => {
return (
Expand Down Expand Up @@ -53,11 +57,13 @@ export const ActivityPostList = () => {
href={routeBuilder(Routes.Posts, {})}
>
<i className="icon-[mingcute--arrow-right-circle-line]" />
<span className="ml-2">还有更多</span>
<span className="ml-2">{t('more')}</span>
</Link>

<Divider />
<h2 className="text-2xl font-medium leading-loose">最近更新的手记</h2>
<h2 className="text-2xl font-medium leading-loose">
{t('activity_note')}
</h2>
<ul className="shiro-timeline mt-4">
{notes.map((note, i) => {
return (
Expand Down Expand Up @@ -86,7 +92,7 @@ export const ActivityPostList = () => {
href={routeBuilder(Routes.Timelime, { type: 'note' })}
>
<i className="icon-[mingcute--arrow-right-circle-line]" />
<span className="ml-2">还有更多</span>
<span className="ml-2">{t('more')}</span>
</Link>
</m.section>
)
Expand Down
4 changes: 3 additions & 1 deletion src/app/(app)/(home)/components/ActivityRecent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useQuery } from '@tanstack/react-query'
import clsx from 'clsx'
import { m } from 'framer-motion'
import { useTranslations } from 'next-intl'
import { useMemo } from 'react'

import { ScrollArea } from '~/components/ui/scroll-area'
Expand All @@ -13,6 +14,7 @@ import { ActivityCard, iconClassName } from './ActivityCard'
import type { ReactActivityType } from './types'

export const ActivityRecent = () => {
const t = useTranslations('Home')
const { data, isLoading } = useQuery({
queryKey: ['home-activity-recent'],
queryFn: async () => {
Expand Down Expand Up @@ -47,7 +49,7 @@ export const ActivityRecent = () => {
viewport={{ once: true }}
>
<m.h2 className="mb-8 text-2xl font-medium leading-loose lg:ml-14">
最近发生的事
{t('activity_recent')}
</m.h2>

{isLoading ? (
Expand Down
Loading

0 comments on commit f6d8c36

Please sign in to comment.