<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="/feeds/atom-style.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <id>https://ryanle1017.github.io/en/</id>
    <title>Ryan's Odyssey</title>
    <updated>2026-06-13T17:55:17.269Z</updated>
    <generator>Astro-Theme-Retypeset with Feed for Node.js</generator>
    <author>
        <name>Ryan</name>
        <uri>https://ryanle1017.github.io/</uri>
    </author>
    <link rel="alternate" href="https://ryanle1017.github.io/en/"/>
    <link rel="self" href="https://ryanle1017.github.io/en/atom.xml"/>
    <rights>Copyright © 2026 Ryan</rights>
    <entry>
        <title type="html"><![CDATA[Theme Guide]]></title>
        <id>https://ryanle1017.github.io/en/posts/theme-guide/</id>
        <link href="https://ryanle1017.github.io/en/posts/theme-guide/"/>
        <updated>2025-04-13T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Retypeset is a static blog theme based on the Astro framework. This guide introduces how to modify theme configuration and create new posts...]]></summary>
        <content type="html"><![CDATA[<p>Retypeset is a static blog theme based on the <a href="https://astro.build/">Astro</a> framework. This guide introduces how to modify theme configuration and create new posts, helping you quickly set up your personal blog.</p>
<h2>Theme Configuration</h2>
<p>Customize your blog by modifying the configuration file <a href="https://github.com/radishzzz/astro-theme-retypeset/blob/master/src/config.ts">src/config.ts</a>.</p>
<h3>Site Information</h3>
<pre><code>site: {
  // site title
  title: 'Retypeset'
  // site subtitle
  subtitle: 'Revive the beauty of typography'
  // site description
  description: 'Retypeset is a static blog theme...'
  // use i18n title/subtitle/description from src/i18n/ui.ts instead of static ones above
  i18nTitle: true // true | false
  // author name
  author: 'radishzz'
  // site url
  url: 'https://retypeset.radishzz.cc'
  // base path
  // root directory for all pages and assets
  base: '/' // e.g., '/blog', '/docs'
  // favicon url
  // recommended formats: svg, png or ico
  favicon: '/icons/favicon.svg' // or https://example.com/favicon.svg
}
</code></pre>
<h3>Theme Color</h3>
<pre><code>color: {
  // default theme mode
  mode: 'light' // light | dark | auto
  // light mode
  light: {
    // primary color
    // used for title, hover, etc
    primary: 'oklch(25% 0.005 298)'
    // secondary color
    // used for post text
    secondary: 'oklch(40% 0.005 298)'
    // background color
    background: 'oklch(96% 0.005 298)'
    // highlight color
    // used for navbar, selected text, etc
    highlight: 'oklch(0.93 0.195089 103.2532 / 0.5)'
  }
  // dark mode
  dark: {
    // primary color
    primary: 'oklch(92% 0.005 298)'
    // secondary color
    secondary: 'oklch(77% 0.005 298)'
    // background color
    background: 'oklch(22% 0.005 298)'
    // highlight color
    highlight: 'oklch(0.93 0.195089 103.2532 / 0.2)'
  }
}
</code></pre>
<h3>Global Settings</h3>
<pre><code>global: {
  // default language
  // language of the site root path '/'
  locale: 'zh' // de | en | es | fr | ja | ko | pl | pt | ru | zh | zh-tw
  // more languages
  // generate multi-language paths such as '/en/' '/es/'
  // not fill in the locale code above again, can be an empty array []
  moreLocales: ['en', 'es', 'ja', 'ru', 'zh-tw'] // ['de', 'en', 'es', 'fr', 'ja', 'ko', 'pl', 'pt', 'ru', 'zh', 'zh-tw']
  // post font style
  fontStyle: 'sans' // sans | serif
  // post date format
  // YYYY-MM-DD | MM-DD-YYYY | DD-MM-YYYY | MMM D YYYY | D MMM YYYY
  // 2025-04-13, 04-13-2025, 13-04-2025, Apr 13 2025，13 Apr 2025
  dateFormat: 'YYYY-MM-DD'
  // enable table of contents
  toc: true // true | false
  // enable katex math rendering
  katex: true // true | false
  // reduce motion
  reduceMotion: false // true | false
}
</code></pre>
<h3>Comment System</h3>
<pre><code>comment: {
  // enable comment system
  enabled: true // true | false
  // giscus comment system
  giscus: {
    repo: ''
    repoId: ''
    category: ''
    categoryId: ''
    mapping: 'pathname'
    strict: '0'
    reactionsEnabled: '1'
    emitMetadata: '0'
    inputPosition: 'bottom'
  }
  // twikoo comment system
  twikoo: {
    envId: ''
    // version: frontend version can be changed in package.json
  }
  // waline comment system
  waline: {
    // server url
    serverURL: 'https://retypeset-comment.radishzz.cc'
    // emoji url
    emoji: [
      'https://unpkg.com/@waline/emojis@1.2.0/tw-emoji'
      // 'https://unpkg.com/@waline/emojis@1.2.0/bmoji'
      // more emojis: https://waline.js.org/en/guide/features/emoji.html
    ]
    // gif search
    search: false // true | false
    // image uploader
    imageUploader: false // true | false
  }
}
</code></pre>
<h3>SEO</h3>
<pre><code>seo: {
  // @twitter ID
  twitterID: '@radishzz_'
  // site verification
  verification: {
    // google search console
    google: 'AUCrz5F1e5qbnmKKDXl2Sf8u6y0kOpEO1wLs6HMMmlM'
    // bing webmaster tools
    bing: '64708CD514011A7965C84DDE1D169F87'
    // yandex webmaster
    yandex: ''
    // baidu search
    baidu: ''
  }
  // google analytics
  googleAnalyticsID: ''
  // umami analytics
  umamiAnalyticsID: 'dab0e4b9-9cbf-43c3-af60-b09d3b545c38'
  // folo verification
  folo: {
    // feed ID
    feedID: ''
    // user ID
    userID: ''
  }
  // apiflash access key
  // generate website screenshots for open graph images
  // get your access key at: https://apiflash.com/
  apiflashKey: ''
}
</code></pre>
<h3>Footer Settings</h3>
<pre><code>footer: {
  // social links
  links: [
    {
      name: 'RSS',
      url: '/atom.xml', // or /rss.xml
    },
    {
      name: 'GitHub',
      url: 'https://github.com/radishzzz/astro-theme-retypeset',
    },
    {
      name: 'Email',
      url: 'email@radishzz.cc',
    }
    // {
    //   name: 'X',
    //   url: 'https://x.com/radishzz_',
    // },
  ]
  // year of website start
  startYear: 2025
}
</code></pre>
<h3>Preload Resources</h3>
<pre><code>preload: {
  // image hosting url
  // optimize remote images and generate low-quality placeholders
  imageHostURL: 'image.radishzz.cc'
  // custom google analytics js
  // for users who proxy tracking scripts to a custom domain
  customGoogleAnalyticsJS: ''
  // custom umami analytics js
  // for users who self-deploy umami or proxy tracking scripts to a custom domain
  customUmamiAnalyticsJS: 'https://views.radishzz.cc/script.js'
}
</code></pre>
<h2>Additional Configuration</h2>
<p>Besides the configuration file <code>src/config.ts</code>, some configuration options are located in other files.</p>
<h3>Syntax Highlighting</h3>
<p>Code block syntax highlighting themes.</p>
<pre><code>// astro.config.ts

shikiConfig: {
  // Available themes: https://shiki.style/themes
  // Background color follows the blog theme by default, not the syntax highlighting theme
  themes: {
    light: 'github-light' // Light theme
    dark: 'github-dark' // Dark theme
  }
}
</code></pre>
<h3>Post Excerpt</h3>
<p>Character count for automatic post excerpts.</p>
<pre><code>// src/utils/description.ts

const excerptLengths: Record&lt;ExcerptScene, {
  cjk: number // Chinese, Japanese, Korean
  other: number // Other languages
}&gt; = {
  list: { // Homepage post list
    cjk: 120, // Auto-excerpts first 120 characters
    other: 240, // Auto-excerpts first 240 characters
  },
}
</code></pre>
<h3>Open Graph</h3>
<p><a href="https://orcascan.com/tools/open-graph-validator?url=https%3A%2F%2Fretypeset.radishzz.cc%2Fen%2Fposts%2Ftheme-guide%2F">Open Graph social card</a> styles.</p>
<pre><code>// src/pages/og/[...image].ts

getImageOptions: (_path, page) =&gt; ({
  logo: {
    path: './public/icons/og-logo.png', // Required local path and PNG format
    size: [250], // Logo width
  },
  font: {
    title: { // Title
      families: ['Noto Sans SC'], // Font
      weight: 'Bold', // Weight
      color: [34, 33, 36], // Color
      lineHeight: 1.5, // Line height
    },
  },
  fonts: [ // Font paths (local or remote)
    'https://cdn.jsdelivr.net/gh/notofonts/noto-cjk@main/Sans/SubsetOTF/SC/NotoSansSC-Bold.otf',
    'https://cdn.jsdelivr.net/gh/notofonts/noto-cjk@main/Sans/SubsetOTF/SC/NotoSansSC-Regular.otf',
  ],
  bgGradient: [[242, 241, 245]], // Background color
  // More configurations: https://github.com/delucis/astro-og-canvas/tree/latest/packages/astro-og-canvas
})
</code></pre>
<h3>RSS Feed</h3>
<p><a href="https://retypeset.radishzz.cc/en/atom.xml">RSS feed page</a> styles.</p>
<pre><code>

&lt;style type="text/css"&gt;
body{color:oklch(25% 0.005 298)} /* Font color */
.bg-white{background-color:oklch(0.96 0.005 298)!important} /* Background color */
.text-gray{color:oklch(0.25 0.005 298 / 75%)!important} /* Secondary font color */
&lt;/style&gt;
</code></pre>
<h2>Creating a New Post</h2>
<p>Run <code>pnpm new-post &lt;filename&gt;</code> to create a new post, which can then be edited in the <code>src/content/posts/</code> directory.</p>
<pre><code>pnpm new-post                      -&gt;  src/content/posts/new-post.md
pnpm new-post first-post           -&gt;  src/content/posts/first-post.md
pnpm new-post 2025/03/first-post   -&gt;  src/content/posts/2025/03/first-post.md
pnpm new-post first-post.mdx       -&gt;  src/content/posts/first-post.mdx
</code></pre>
<h3>Front Matter</h3>
<p>Only <code>title</code> and <code>published</code> are required fields, all other configurations can be omitted.</p>
<pre><code>---
# Required
title: Theme Guide
published: 2025-01-26

# Optional
description: The first 240 characters of the post will be automatically selected as the excerpt.
updated: 2025-03-26
tags:
  - Blog Theme
  - Guide

# Advanced, Optional
draft: true/false
pin: 0-99
toc: true/false
lang: de/en/es/fr/ja/ko/pl/pt/ru/zh/zh-tw
abbrlink: theme-guide
---
</code></pre>
<h3>Advanced Configuration</h3>
<h4>draft</h4>
<p>Marks the post as a draft. When set to true, the post cannot be published and is only available for local development preview. Default is false.</p>
<h4>pin</h4>
<p>Pins the post to the top. The higher the number, the higher the priority of the pinned post. Default is 0, which means not pinned.</p>
<h4>toc</h4>
<p>Generate table of contents. Shows h2 to h4 headings. Determined by the global configuration <code>global.toc</code> by default, but can be overridden individually in each post.</p>
<h4>lang</h4>
<p>Specifies the post language. Only one language can be specified. If not specified, the post will be displayed in all language paths by default.</p>
<pre><code># src/config.ts
# locale: 'en'
# moreLocales: ['es', 'ru']

# lang: ''
src/content/posts/apple.md   -&gt;  example.com/posts/apple/
                             -&gt;  example.com/es/posts/apple/
                             -&gt;  example.com/ru/posts/apple/
# lang: en
src/content/posts/apple.md   -&gt;  example.com/posts/apple/
# lang: es
src/content/posts/apple.md   -&gt;  example.com/es/posts/apple/
# lang: ru
src/content/posts/apple.md   -&gt;  example.com/ru/posts/apple/
</code></pre>
<h4>abbrlink</h4>
<p>Customizes the post URL. Can only contain lowercase letters, numbers, and hyphens <code>-</code>.</p>
<pre><code># src/config.ts
# locale: 'en'
# moreLocales: ['es', 'ru']
# lang: 'es'

# abbrlink: ''
src/content/posts/apple.md           -&gt;  example.com/es/posts/apple/
src/content/posts/guide/apple.md     -&gt;  example.com/es/posts/guide/apple/
src/content/posts/2025/03/apple.md   -&gt;  example.com/es/posts/2025/03/apple/

# abbrlink: 'banana'
src/content/posts/apple.md           -&gt;  example.com/es/posts/banana/
src/content/posts/guide/apple.md     -&gt;  example.com/es/posts/banana/
src/content/posts/2025/03/apple.md   -&gt;  example.com/es/posts/banana/
</code></pre>
<h3>Mixed Text Formatting</h3>
<p>Run <code>pnpm format-posts</code> to optimize the formatting in Markdown files within the <code>src/content/</code> directory. This command automatically fixes spacing between CJK (Chinese, Japanese, Korean) and Latin characters, corrects punctuation marks, and improves overall text readability.</p>
<pre><code>pnpm format-posts
🔍 Scanning Markdown files...
📦 Found 56 Markdown files
✅ src/content/posts/guides/Theme Guide-ja.md
✅ src/content/posts/guides/Theme Guide-zh-tw.md
✅ src/content/posts/guides/Theme Guide-zh.md
✨ Formatted 3 files successfully
</code></pre>
]]></content>
        <author>
            <name>Ryan</name>
            <uri>https://ryanle1017.github.io/</uri>
        </author>
        <published>2025-01-26T00:00:00.000Z</published>
    </entry>
</feed>