-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add global config.yml for user settings and improve SEO. (#19)
- 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. - Enable custom JavaScript in <head> and before </body> as defined in config.yml. - Allow users to define their own comment system with a reserved slot in config.yml. - Improve SEO: Add custom titles to post pages and update the site-wide layout. - Use roobots.ts to generate robots.txt instead of hardcoded. - Replace Google Font import with nextjs built in. - Extend the footer with more social media links and optimize for mobile view. - Merge frontmatter process logic into 1 single function. - Add logic avoid parsing not md files.
- Loading branch information
Showing
19 changed files
with
352 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: '[email protected]' # Only put your email address here, no mailto: prefix | ||
rss: '' | ||
|
||
# Set your own js script inside <head> | ||
scriptSlotHeader: | ||
- | ||
|
||
# Set your own js script before </body> | ||
scriptSlotFooter: | ||
- 'https://cdn.jsdelivr.net/gh/zl-asica/web-cdn/js/zlasica.js' | ||
|
||
# HTML code inside <footer> | ||
slotFooter: | | ||
# Comment system for blog posts | ||
slotComment: | |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import type { Metadata } from 'next'; | ||
import { getConfig } from '@/lib/getConfig'; | ||
|
||
const config = getConfig(); | ||
|
||
export const metadata: Metadata = { | ||
title: `Posts - ${config.title}`, | ||
description: `Posts page of ${config.title} - ${config.description}`, | ||
openGraph: { | ||
title: `Posts - ${config.title}`, | ||
description: `Posts page of ${config.title} - ${config.description}`, | ||
type: 'website', | ||
locale: config.lang, | ||
}, | ||
}; | ||
|
||
export default function PostsLayout({ | ||
children, | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
}>) { | ||
return <>{children}</>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { MetadataRoute } from 'next'; | ||
|
||
export default function robots(): MetadataRoute.Robots { | ||
return { | ||
rules: { | ||
userAgent: '*', | ||
// allow: '/', | ||
disallow: '/', | ||
}, | ||
// sitemap: '', | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.