From 37f9ef1382280113d361f1a6fccbd3aba737d5c3 Mon Sep 17 00:00:00 2001 From: ZL Asica <40444637+ZL-Asica@users.noreply.github.com> Date: Sat, 19 Oct 2024 21:53:02 -0500 Subject: [PATCH 1/6] feat(font): Use nextjs Google font. --- src/app/globals.css | 2 +- src/app/layout.tsx | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 056c6ad..d596303 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -21,7 +21,7 @@ body { color: var(--foreground); background: var(--background); - font-family: var(--font-roboto), 'Noto Sans SC', 'PingFang SC', + font-family: var(--font-roboto), var(--font-noto-sans-sc), 'PingFang SC', 'Microsoft YaHei', Arial, Helvetica, sans-serif; } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 9f1b485..baf3f22 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,10 +1,11 @@ import React from 'react'; import type { Metadata } from 'next'; -import { Roboto } from 'next/font/google'; +import { Roboto, Noto_Sans_SC } from 'next/font/google'; import './globals.css'; import ThemeProvider from '@/components/ThemeProvider'; import Header from '@/components/common/Header'; import Footer from '@/components/common/Footer'; +import Script from 'next/script'; const roboto = Roboto({ subsets: ['latin'], @@ -13,6 +14,13 @@ const roboto = Roboto({ style: ['normal', 'italic'], }); +const notoSansSC = Noto_Sans_SC({ + subsets: ['latin'], + weight: ['100', '400', '700', '900'], + variable: '--font-noto-sans-sc', + style: ['normal'], +}); + export const metadata: Metadata = { title: 'Suzu - Next.js Blog Template', description: @@ -29,7 +37,7 @@ export default function RootLayout({ }>) { return ( - +
{children}
From 56f626e73963c47f6056abc05f759ca7569eb4dc Mon Sep 17 00:00:00 2001 From: ZL Asica <40444637+ZL-Asica@users.noreply.github.com> Date: Sat, 19 Oct 2024 21:53:32 -0500 Subject: [PATCH 2/6] feat: Use nextjs robots.txt generation. --- src/app/robots.ts | 12 ++++++++++++ src/app/robots.txt | 3 --- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 src/app/robots.ts delete mode 100644 src/app/robots.txt diff --git a/src/app/robots.ts b/src/app/robots.ts new file mode 100644 index 0000000..f406345 --- /dev/null +++ b/src/app/robots.ts @@ -0,0 +1,12 @@ +import { MetadataRoute } from 'next'; + +export default function robots(): MetadataRoute.Robots { + return { + rules: { + userAgent: '*', + // allow: '/', + disallow: '/', + }, + // sitemap: '', + }; +} diff --git a/src/app/robots.txt b/src/app/robots.txt deleted file mode 100644 index e9e57dc..0000000 --- a/src/app/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: From d8effd4eed085d8c6235097fdaed481dec077feb Mon Sep 17 00:00:00 2001 From: ZL Asica <40444637+ZL-Asica@users.noreply.github.com> Date: Sat, 19 Oct 2024 21:56:58 -0500 Subject: [PATCH 3/6] chore: Use Link to replace a tag; Update footer info. --- src/app/not-found.tsx | 11 +++-------- src/components/common/Footer.tsx | 30 +++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index 356460c..349ef07 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -1,5 +1,6 @@ 'use client'; +import Link from 'next/link'; import { useEffect, useState } from 'react'; export default function Custom404() { @@ -37,18 +38,12 @@ export default function Custom404() { {countdown} seconds.

- Go back home - - - Contact support - +
diff --git a/src/components/common/Footer.tsx b/src/components/common/Footer.tsx index 3983044..d8ba2f2 100644 --- a/src/components/common/Footer.tsx +++ b/src/components/common/Footer.tsx @@ -39,15 +39,39 @@ export default function Footer() { aria-label={contact.title} target='_blank' rel='noopener noreferrer' + className='transform transition-transform hover:scale-110' > {contact.icon} ))} -

- © 2024-{currentYear} Suzu Blog. +

+ © 2017-{currentYear} Suzu Blog
- All rights reserved. + Theme{' '} + + Suzu + {' '} + by{' '} + + ZL Asica +

From 3ec9ba7e963414140a8d2604e22b63c86f0c1f4f Mon Sep 17 00:00:00 2001 From: ZL Asica <40444637+ZL-Asica@users.noreply.github.com> Date: Sat, 19 Oct 2024 22:08:44 -0500 Subject: [PATCH 4/6] feat: Add global config.yml for user settings and improve SEO. - Add yaml package to parse config.yml. - Introduce getConfig as a global utility to access config values. - Replace hardcoded values across multiple files with config.yml settings. - Fix issue #10: Default thumbnail now uses the background image from config. - Extend footer with more social media links and optimize for mobile view. - Improve SEO: Add custom titles to post pages and update site-wide layout. - Enable custom JavaScript in and before as defined in config.yml. - Allow users to define their own comment system with a reserved slot in config.yml. --- config.yml | 43 +++++++++ package-lock.json | 4 +- package.json | 3 +- pages/_document.tsx | 32 ------- .../images/{katomegumi.jpg => background.jpg} | Bin src/app/layout.tsx | 34 +++++-- src/app/page.tsx | 11 ++- src/app/posts/[slug]/page.tsx | 8 ++ src/app/posts/layout.tsx | 24 +++++ src/components/common/Footer.tsx | 87 ++++++++++++------ src/components/common/Header.tsx | 6 +- src/lib/getConfig.ts | 42 +++++++++ src/lib/posts.ts | 6 +- 13 files changed, 221 insertions(+), 79 deletions(-) create mode 100644 config.yml delete mode 100644 pages/_document.tsx rename public/images/{katomegumi.jpg => background.jpg} (100%) create mode 100644 src/app/posts/layout.tsx create mode 100644 src/lib/getConfig.ts diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..6a48dc1 --- /dev/null +++ b/config.yml @@ -0,0 +1,43 @@ +title: 'Suzu' +subTitle: 'Next.js Blog Template' +description: 'Suzu is a minimalist blog template with a serene sakura-inspired theme, blending modern design with a touch of traditional Japanese aesthetics.' +keywords: 'Suzu, Next.js, markdown blog, Tailwind CSS, blog template, sakura, ZL Asica' +author: + name: 'ZL Asica' + link: 'https://www.zla.app' +# Please use the ISO 639-1 code for the language +lang: 'zh' + +# Relative path from /public/*, or full URL(include http(s)://) +avatar: '/images/avatar.jpg' +# This will be both your background and default post thumbnail +background: '/images/background.jpg' +# Shows on home page below your avatar +slogan: "As long as the code or the developer is able to run, it's all good." + +# Set your social media links +socialMedia: + github: 'https://www.github.com/ZL-Asica:' + linkedin: 'https://www.linkedin.com/in/elara-liu' + x: '' # Twitter + instagram: 'https://www.instagram.com/zl_asica' + youtube: 'https://www.youtube.com/@ZL-Asica' + telegram: 'https://t.me/ZL_Asica' + bilibili: 'https://space.bilibili.com/29018759' + zhihu: 'https://www.zhihu.com/people/zl-asica' + email: 'zl@zla.app' # Only put your email address here, no mailto: prefix + rss: '/feed.xml' + +# Set your own js script inside +scriptSlotHeader: + - + +# Set your own js script before +scriptSlotFooter: + - 'https://cdn.jsdelivr.net/gh/zl-asica/web-cdn/js/zlasica.js' + +# HTML code inside