diff --git a/public/fonts/EarlySummer-Split/EarlySummerSerif License.txt b/public/fonts/EarlySummer-Split/EarlySummerSerif License.txt new file mode 100644 index 0000000..77b1731 --- /dev/null +++ b/public/fonts/EarlySummer-Split/EarlySummerSerif License.txt @@ -0,0 +1,91 @@ +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/src/config.ts b/src/config.ts index aedfa68..d19ab23 100644 --- a/src/config.ts +++ b/src/config.ts @@ -60,6 +60,8 @@ export const themeConfig: ThemeConfig = { dateFormat: 'YYYY-MM-DD', // YYYY-MM-DD, MM-DD-YYYY, DD-MM-YYYY, MONTH DAY YYYY, DAY MONTH YYYY // enable KaTeX for mathematical formulas rendering katex: true, // true, false + // enable table of contents for all posts by default + toc: true, // true, false }, // GLOBAL SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END diff --git a/src/content.config.ts b/src/content.config.ts index d44a685..7f5df19 100644 --- a/src/content.config.ts +++ b/src/content.config.ts @@ -1,6 +1,6 @@ import { glob } from 'astro/loaders' import { defineCollection, z } from 'astro:content' -import { allLocales } from '@/config' +import { allLocales, themeConfig } from '@/config' const posts = defineCollection({ loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/posts' }), @@ -15,7 +15,7 @@ const posts = defineCollection({ // Advanced draft: z.boolean().optional().default(false), pin: z.number().int().min(0).max(99).optional().default(0), - toc: z.boolean().optional().default(true), + toc: z.boolean().optional().default(themeConfig.global.toc), lang: z.enum(['', ...allLocales]).optional().default(''), abbrlink: z.string().optional().default('').refine( abbrlink => !abbrlink || /^[a-z0-9\-]*$/.test(abbrlink), diff --git a/src/content/posts/guides/Theme Guide-en.md b/src/content/posts/guides/Theme Guide-en.md index f6dd00c..2dd7f8d 100644 --- a/src/content/posts/guides/Theme Guide-en.md +++ b/src/content/posts/guides/Theme Guide-en.md @@ -86,6 +86,8 @@ global: { dateFormat: 'YYYY-MM-DD' // enable KaTeX for mathematical formulas rendering katex: true // true, false + // enable table of contents for all posts by default + toc: true // true, false } ``` @@ -315,7 +317,7 @@ Pins the article to the top. The higher the number, the higher the priority of t #### toc -Generate table of contents. Shows h2 to h4 headings. Default is true. +Generate table of contents. Shows h2 to h4 headings. Uses the global `global.toc` configuration by default, but can be overridden individually in each article. #### lang diff --git a/src/content/posts/guides/Theme Guide-es.md b/src/content/posts/guides/Theme Guide-es.md index 455c469..cc31e0d 100644 --- a/src/content/posts/guides/Theme Guide-es.md +++ b/src/content/posts/guides/Theme Guide-es.md @@ -86,6 +86,8 @@ global: { dateFormat: 'YYYY-MM-DD' // habilitar KaTeX para renderizar fórmulas matemáticas katex: true // true, false + // habilitar tabla de contenidos para todos los artículos por defecto + toc: true // true, false } ``` @@ -315,7 +317,7 @@ Fija el artículo en la parte superior. Cuanto mayor sea el número, mayor será #### toc -Genera tabla de contenidos. Muestra encabezados h2 a h4. El valor predeterminado es true. +Genera tabla de contenidos. Muestra encabezados de h2 a h4. Utiliza la configuración global `global.toc` por defecto, pero puede ser modificada individualmente en cada artículo. #### lang diff --git a/src/content/posts/guides/Theme Guide-ja.md b/src/content/posts/guides/Theme Guide-ja.md index 03d7f72..4de71a8 100644 --- a/src/content/posts/guides/Theme Guide-ja.md +++ b/src/content/posts/guides/Theme Guide-ja.md @@ -86,6 +86,8 @@ global: { dateFormat: 'YYYY-MM-DD' // 数式表示のためのKaTeXを有効化 katex: true // true, false + // デフォルトですべての記事に目次を表示 + toc: true // true, false } ``` @@ -315,7 +317,7 @@ abbrlink: theme-guide #### toc -目次を自動生成するかどうか。h2からh4までの見出しを表示します。デフォルトは true。 +目次を生成するかどうか。h2からh4までの見出しを表示します。デフォルトではグローバル設定 `global.toc` を使用しますが、記事ごとに個別に設定することも可能です。 #### lang diff --git a/src/content/posts/guides/Theme Guide-ru.md b/src/content/posts/guides/Theme Guide-ru.md index fb5e7a9..f03df1f 100644 --- a/src/content/posts/guides/Theme Guide-ru.md +++ b/src/content/posts/guides/Theme Guide-ru.md @@ -86,6 +86,8 @@ global: { dateFormat: 'YYYY-MM-DD' // включить KaTeX для отображения математических формул katex: true // true, false + // включить оглавление для всех статей по умолчанию + toc: true // true, false } ``` @@ -315,7 +317,7 @@ abbrlink: theme-guide #### toc -Генерировать оглавление. Показывает заголовки от h2 до h4. По умолчанию — true. +Генерировать оглавление. Показывает заголовки от h2 до h4. По умолчанию использует глобальный параметр `global.toc`, но может быть изменен индивидуально в каждой статье. #### lang diff --git a/src/content/posts/guides/Theme Guide-zh-tw.md b/src/content/posts/guides/Theme Guide-zh-tw.md index 25e5ed7..58e0e24 100644 --- a/src/content/posts/guides/Theme Guide-zh-tw.md +++ b/src/content/posts/guides/Theme Guide-zh-tw.md @@ -86,6 +86,8 @@ global: { dateFormat: 'YYYY-MM-DD' // 啟用 KaTeX 數學公式渲染 katex: true // true, false + // 預設為所有文章開啟目錄 + toc: true // true, false } ``` @@ -315,7 +317,7 @@ abbrlink: theme-guide #### toc -是否生成目錄。顯示 h2 至 h4 標題。預設為 true。 +是否生成目錄。顯示 h2 至 h4 標題。預設為全域配置 `global.toc` 的選項,可在文章中單獨設定以覆蓋全域配置。 #### lang diff --git a/src/content/posts/guides/Theme Guide-zh.md b/src/content/posts/guides/Theme Guide-zh.md index ebd3c46..7469b5e 100644 --- a/src/content/posts/guides/Theme Guide-zh.md +++ b/src/content/posts/guides/Theme Guide-zh.md @@ -86,6 +86,8 @@ global: { dateFormat: 'YYYY-MM-DD' // 启用 KaTeX 数学公式渲染 katex: true // true, false + // 默认为所有文章开启目录 + toc: true // true, false } ``` @@ -315,7 +317,7 @@ abbrlink: theme-guide #### toc -是否生成目录。显示 h2 至 h4 标题。默认为 true。 +是否生成目录。显示 h2 至 h4 标题。默认为全局配置 `global.toc` 的选项,可在文章中单独设置以覆盖全局配置。 #### lang diff --git a/src/styles/extend.css b/src/styles/extend.css index 6b7e71c..3aaf1df 100644 --- a/src/styles/extend.css +++ b/src/styles/extend.css @@ -1,4 +1,4 @@ -/* GitHub Card >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */ +/* GitHub Card */ .gc-container { --at-apply: 'block mb-4 px-5 py-4 overflow-x-auto uno-round-border bg-secondary/5'; --at-apply: 'transition-colors duration-300 ease-out lg:(px-6 py-5) hover:(bg-secondary/10 c-primary)'; diff --git a/src/styles/global.css b/src/styles/global.css index c87ba4c..cad506a 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -16,7 +16,7 @@ body { -webkit-backface-visibility: hidden; } body::selection { - --at-apply: 'bg-mark'; + --at-apply: 'bg-highlight'; } /* Fix KaTeX Overflow Issue */ @@ -54,7 +54,7 @@ h4:hover .heading-anchor-link svg:hover { } .highlight-static::after, .highlight-hover::after { - --at-apply: 'content-[""] absolute left-0 z--1 h-0.5em w-full bg-mark'; + --at-apply: 'content-[""] absolute left-0 z--1 h-0.5em w-full bg-highlight'; } .highlight-static::after, .highlight-hover:hover::after { diff --git a/src/styles/markdown.css b/src/styles/markdown.css index 9bb0305..a9a517b 100644 --- a/src/styles/markdown.css +++ b/src/styles/markdown.css @@ -211,7 +211,7 @@ html.dark .heti :where(u) { /* Highlighted Text */ .heti :where(mark) { - --at-apply: 'bg-mark py-0.65 text-inherit'; + --at-apply: 'bg-highlight py-0.65 text-inherit'; } /* Footnotes */ @@ -221,7 +221,7 @@ html.dark .heti :where(u) { } .heti sup:target, .heti sup a:target { - --at-apply: 'bg-mark'; + --at-apply: 'bg-highlight'; } .heti .data-footnote-backref { --at-apply: 'font-serif no-underline'; diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 033fd65..61ccbac 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -34,6 +34,7 @@ export interface ThemeConfig { fontStyle: 'sans' | 'serif' dateFormat: 'YYYY-MM-DD' | 'MM-DD-YYYY' | 'DD-MM-YYYY' | 'MONTH DAY YYYY' | 'DAY MONTH YYYY' katex: boolean + toc: boolean } comment: { diff --git a/uno.config.ts b/uno.config.ts index bfe3eba..e9aba9c 100644 --- a/uno.config.ts +++ b/uno.config.ts @@ -20,7 +20,7 @@ export default defineConfig({ dark: { colors: { ...dark, - mark: 'oklch(0.93 0.195089 103.2532 / 0.2)', // rgba(255,235,0,0.5) + highlight: 'oklch(0.93 0.195089 103.2532 / 0.2)', // rgba(255,235,0,0.5) note: 'oklch(70.7% 0.165 254.624 / 0.8)', // blue-400 tip: 'oklch(76.5% 0.177 163.223 / 0.8)', // emerald-400 important: 'oklch(71.4% 0.203 305.504 / 0.8)', // purple-400 @@ -34,7 +34,7 @@ export default defineConfig({ theme: { colors: { ...light, - mark: 'oklch(0.93 0.195089 103.2532 / 0.5)', // rgba(255,235,0,0.5) + highlight: 'oklch(0.93 0.195089 103.2532 / 0.5)', // rgba(255,235,0,0.5) note: 'oklch(48.8% 0.243 264.376 / 0.8)', // blue-700 tip: 'oklch(50.8% 0.118 165.612 / 0.8)', // emerald-700 important: 'oklch(49.6% 0.265 301.924 / 0.8)', // purple-700