AnZhiYu Theme Documentation

website·Indexed 34 days ago

https://docs.anheyu.com/

Official documentation for AnZhiYu, a concise and customizable static Hexo theme. Includes guides on theme installation, site configuration via _config.yml, and detailed page setups for albums, music galleries, guestbooks, and friendship links. Covers advanced configurations such as Valine, Waline, and Twikoo comment systems, AI post descriptions, and dark mode settings.

Tokens
15.2K
Snippets
128
Records
135
Agent score
68%

What's inside AnZhiYu

  1. Configure donation QR codes for About and Post pages

    Add reward QR codes to the bottom of the About page and individual posts by configuring the reward section.
    reward:
      enable: true
      coinAudio: https://.../audio/aowu.m4a
      QR_code:
        - img: https://.../wechat.png
          link: ""
          text: wechat
        - img: https://.../alipay.png
          link: ""
          text: alipay
  2. Add the About page to the theme menu

    Enable the 'About' page in the theme's configuration file under the menu section. Ensure correct indentation to map the menu item to the page path and assign an icon.
    menu:
      关于:
        关于本人: /about/ || icon-zhifeiji
        闲言碎语: /essay/ || icon-lightbulb
  3. Create and configure the About page in Hexo

    To set up the 'About' page, first create a new page using the Hexo CLI. Then, you must modify the page's front-matter to include type: "about" so the theme can render the specialized profile layout.
    hexo new page about

    In source/about/index.md


    title: 关于 date: 2021-03-30 15:57:51 aside: false top_img: false background: "#f8f9fe" comments: false type: "about"

  4. Configure profile data in about.yml

    The detailed content of the About page (such as avatar, skills, career history, and social links) is managed in a separate data file located at source/_data/about.yml. This file uses a YAML list format to define the user's profile attributes.
    - class_name: 关于页
      subtitle: 生活明朗,万物可爱✨
      avatarImg: https://example.com/avatar.webp
      avatarSkills:
        left:
          - 🤖️ 数码科技爱好者
        right:
          - 专修交互与设计 🤝
      name: Your Name
      description: Your professional description
      careers:
        list:
          - desc: Degree/Major
            color: "#357ef5"
      statistic:
        link: /archives
        text: 文章隧道
      personalities:
        author_name: Name
        personality_type: ESFJ-A
        personality_img: https://example.com/personality.svg
      game:
        game_title: Game Name
        game_uid: "UID: 123456"
      comic:
        comic_list:
          - name: Anime Name
            href: https://bilibili.com/...
            cover: https://example.com/cover.jpg
      reward_list:
        - name: Donor Name
          amount: 10
          datatime: 2023-01-01
  5. Integrate 51A Statistics and LingQue Monitor

    Configure 51A Statistics and LingQue to display statistical information on the 'About' page.

    Important: You must enable the 'Data Widget' (数据挂件) feature in your 51A account settings for the statistics to display correctly.

    # 51a统计配置
    LA:
      enable: true
      ck: Jp8wwGQpp21utaFQ
      LingQueMonitorID: Jp8ztDRrxmTf7LDj
  6. Configure the About page for Hexo blog

    The About page requires a specific set of configuration parameters to define the author's profile, skills, career, and personal preferences. Most fields are mandatory. The configuration is structured as a set of objects including aboutsiteTips, skillsTips, careers, statistic, map, selfInfo, personalities, maxim, buff, game, comic, like, and music.
    # Example structure based on required parameters
    class_name: "关于页"
    subtitle: "Your Subtitle"
    avatarImg: "https://example.com/avatar.jpg"
    name: "Author Name"
    description: "Author Description"
    helloAbout: "Hello text"
    
    aboutsiteTips:
      tips: "Site tips text"
      title1: "Title 1"
      title2: "Title 2"
      word: ["Word 1", "Word 2"]
    
    skillsTips:
      tips: "Skills tips"
      title: "Skills Title"
    
    careers:
      tips: "Career tips"
      title: "Career Title"
      img: "https://example.com/career-bg.jpg"
      list:
        - desc: "Job description"
          color: "#ffffff"
    
    statistic:
      link: "https://example.com/stats"
      text: "Stats Button Text"
    
    map:
      title: "Map Title"
      StrengthenTitle: "Map Main Title"
      background: "https://example.com/light-map.jpg"
      backgroundDark: "https://example.com/dark-map.jpg"
    
    selfInfo:
      selfInfoTips1: "Tip 1"
      selfInfoContentYear: 1990
      selfInfoTips2: "Tip 2"
      selfInfoContent2: "Content 2"
      selfInfoTips3: "Tip 3"
      selfInfoContent3: "Content 3"
    
    personalities:
      author_name: "Name"
      personality_type: "Type"
      photo_url: "https://example.com/photo.jpg"
      personality_img: "https://example.com/personality.jpg"
      name_url: "https://example.com/personality-link"
    
    maxim:
      maxim_tips: "Maxim tips"
      maxim_top: "Top text"
      maxim_bottom: "Bottom text"
    
    buff:
      buff_tips: "Buff tips"
      buff_top: "Top text"
      buff_bottom: "Bottom text"
    
    game:
      game_tips: "Game tips"
      game_title: "Game Title"
      game_uid: "UID12345"
      game_bg: "https://example.com/game-bg.jpg"
    
    comic:
      comic_tips: "Comic tips"
      comic_title: "Comic Title"
      comic_list:
        - name: "Anime Name"
          href: "https://example.com/anime"
          cover: "https://example.com/cover.jpg"
        # Requires 5 items total
    
    like:
      like_tips: "Preference tips"
      like_title: "Preference Title"
      like_bg: "https://example.com/like-bg.jpg"
      like_bottom: "Bottom text"
    
    music:
      music_tips: "Music tips"
      music_title: "Music Title"
      music_bg: "https://example.com/music-bg.jpg"
      music_link: "https://example.com/music-link"
    
    # Optional: Reward list (omitting this removes the reward module)
    reward_list:
      - name: "Reward Name"
        amount: 10
        datatime: 2022-08-19
        suffix: "元"
  7. AnZhiYu Hexo Theme Overview

    AnZhiYu is a simple and beautiful theme for Hexo, modified from hexo-theme-butterfly. It is designed to work with Hexo's core logic for managing categories, tags, and posts.
  8. Configure Homepage Carousel and Recommended Cards

    To display a post in the homepage carousel or the recommended card group, add the swiper_index and top_group_index fields to the post's Front-matter. A smaller numerical value gives the item higher priority (appears further forward).
    ---
    title: "My Featured Post"
    date: "2023-01-01"
    swiper_index: 1
    top_group_index: 1
    ---
  9. Create the Circle of Friends page in Hexo

    To set up the Circle of Friends page, first create a new page using the Hexo CLI and then specify the page type in the markdown front-matter to enable the specific theme layout.
    hexo new page fcircle

    In [blog]\source\fcircle\index.md


    title: 朋友圈 date: 2022-11-21 17:06:17 comments: false aside: false top_img: false type: "fcircle"

  10. Set up Algolia search

    Integrate Algolia search by installing the hexo-algoliasearch plugin. You must configure the plugin in the main Hexo _config.yml and enable it in the theme configuration. Ensure the fields parameter includes title, permalink, and content.
    # Theme Configuration
    algolia_search:
      enable: true
      hits:
        per_page: 6
    # Hexo _config.yml
    algolia:
      appId: "xxxx"
      apiKey: "xxxx"
      adminApiKey: "xxxx"
      chunkSize: 5000
      indexName: "hexo"
      fields:
        - content:strip:truncate,0,200
        - excerpt:strip
        - gallery
        - permalink
        - photos
        - slug
        - tags
        - title
  11. Configure the 'Essay' (Short Notes) page in Hexo

    To set up the 'Essay' (即刻说说) page, which allows for short-form content similar to social media updates, follow these steps:

    1. Create a new page using the Hexo CLI.
    2. Configure the page front-matter to set the page type to essay.
    3. Create a data file in source/_data/essay.yml to define the content, layout, and metadata for the short notes.

    Note: This feature requires theme version 1.6.7 or higher. Bilibili videos are supported; adding &autoplay=0 to the URL will disable autoplay.

    hexo new page essay

    source/essay/index.md

    ---
    title: 即刻短文
    date: 2020-07-22 22:06:17
    comments: true
    aside: false
    top_img: false
    type: essay
    ---

    source/_data/essay.yml

    - title: 即刻短文
      subTitle: 咸鱼的日常生活。
      tips: 随时随地,分享生活
      buttonText: 关于我
      buttonLink: /about/
      limit: 30
      home_essay: true
      top_background: https://example.com/background.jpg
      essay_list:
        - content: Example single note
          date: 2023/09/09
          video:
            - https://player.bilibili.com/player.html?aid=...&autoplay=0
        - content: Example note with image and link
          date: 2023/07/01
          image:
            - https://example.com/image1.webp
          address: Longsha
          from: Author
          link: /posts/e140.html
  12. Configure the Album main page in Hexo

    To set up the main album gallery page, create a new page and assign it the album type in its front matter. Then, enable the album link in the theme's menu configuration.
    hexo new page album

    In source/album/index.md:


    title: 相册集 date: 2022-10-23 15:57:51 aside: false top_img: false type: "album"

    In theme configuration:

    menu: 我的: 相册集: /album/ || icon-images