hexo-theme-yun Documentation

website·Indexed 32 days ago

https://yun.yunyoujun.cn/

Documentation for hexo-theme-yun, a custom, responsive, and lightweight theme based on Hexo. Includes guides on theme configuration via _config.yun.yml, page types, third-party service integration, additional dependency library support, and migration guides for versions such as v1.11.x.

Tokens
21.6K
Snippets
193
Records
211
Agent score
56%

What's inside hexo-theme-yun

  1. Overview of hexo-theme-yun

    hexo-theme-yun is a custom, lightweight, and fast theme based on the Hexo static site generator. It is designed with a focus on simplicity, using native JavaScript instead of jQuery to improve performance and leveraging CDNs to increase access speed. The theme prioritizes a bright mode for better legibility and accessibility, particularly for users with astigmatism.
  2. Overview of hexo-theme-yun

    hexo-theme-yun is a custom theme based on the Hexo static site generator. It is designed to be concise, elegant, responsive, and fast. Key technical characteristics include the removal of jQuery in favor of native JavaScript to improve performance and the extensive use of CDNs to increase loading speeds.
  3. Create an About page and Site description

    The theme supports two types of 'About' content. For a personal about page, create it via hexo new page about. For a site-specific description, create a file at source/about/site.md. The theme will automatically render the site link in the sidebar if site.md exists.
    hexo new page about
  4. Configure Local Search

    Local search requires the hexo-generator-searchdb plugin. It uses native JavaScript (no jQuery) and supports XML format. You must disable engine_search before enabling local_search.
    npm install hexo-generator-searchdb
    engine_search:
      enable: false
    
    local_search:
      enable: true
  5. Configure RSS feed generation

    Install hexo-generator-feed to generate RSS feeds. The theme allows you to customize the RSS link and icon within the social field of the theme configuration.
    npm install hexo-generator-feed --save

    In _config.yun.yml

    social:
      - name: RSS
        link: /atom.xml
        icon: ri:rss-line
        color: orange
  6. Enable word count and read time

    To display word counts and estimated read time in articles, install the hexo-wordcount plugin and enable it in the theme configuration file.
    npm install hexo-wordcount

    In _config.yun.yml

    wordcount:
      enable: true
      count: true
      time: true
  7. Render mathematical formulas with KaTeX

    The theme supports KaTeX for rendering math. By default, KaTeX libraries are only loaded on pages where katex: true is set in the front-matter. If global loading is enabled in the theme configuration, this per-page setting is unnecessary. The katex front-matter option accepts a boolean or an object (where only the options key is effective and will be merged with global settings).

    Formula Syntax:

    • Block/Centered: Use $$ formula $$ or \[ formula \].
    • Inline: Use $ formula $ or \( formula \).

    Important Note on Escaping: When writing directly in Markdown, backslashes must be escaped (e.g., use \\[ E = mc^2 \\] instead of \[ E = mc^2 \]). To avoid excessive escaping, wrap the formula in an HTML tag like <div>, which prevents the content from being parsed as Markdown.

    ---
    title: My Math Page
    katex: true
    ---
    
    $$ E = mc^2 $$
    
    <div>\[ E = mc^2 \]
    </div>
  8. Pin articles using the sticky property

    To pin an article to the top of the list, add the sticky property to the article's Front Matter. Higher numeric values take priority over lower values (e.g., sticky: 2 appears above sticky: 1).
    ---
    title: My Sticky Post
    sticky: 2
    ---
  9. Use custom local sentences for homepage quotes

    To use your own set of quotes instead of a remote API, create a JSON file at source/data/sentences.json (or any custom folder). The JSON should be an array of objects containing content, author, and from keys. Then, disable Hitokoto and point say.api to the local path.
    [
      {
        "content": "Hello, World!",
        "author": "Brian Kernighan",
        "from": "The C Programming Language"
      }
    ]
    say:
      enable: true
      api: /data/sentences.json
      hitokoto:
        enable: false
  10. Update icon loading to Iconify in v1.10.x

    Starting with v1.10.x, the theme uses Iconify to load icon resources. Icon names must be updated to the Iconify format. For example, the Remix Icon icon-github-line should be changed to ri:github-line.