惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
V2EX
博客园 - 三生石上(FineUI控件)
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
D
Docker
S
SegmentFault 最新的问题
博客园 - 聂微东
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
GbyAI
GbyAI
L
LangChain Blog
Vercel News
Vercel News
博客园 - 叶小钗
MongoDB | Blog
MongoDB | Blog
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
Engineering at Meta
Engineering at Meta
T
Threat Research - Cisco Blogs
T
Threatpost
Scott Helme
Scott Helme
T
Tailwind CSS Blog
Latest news
Latest news
Stack Overflow Blog
Stack Overflow Blog
Blog — PlanetScale
Blog — PlanetScale
The Register - Security
The Register - Security
罗磊的独立博客
P
Proofpoint News Feed
腾讯CDC
S
Schneier on Security
雷峰网
雷峰网
A
About on SuperTechFans
T
Tenable Blog
F
Full Disclosure
Cyberwarzone
Cyberwarzone
博客园_首页
有赞技术团队
有赞技术团队
K
Kaspersky official blog

文章列表

安知鱼主题美化及实用教程库 给群晖套件版Emby添加网络代理 保姆式Hexo博客搭建教程 类原生安卓网络和时间修复 解决网站 URL 加个 index.html 后 Twikoo 评论显示问题 使用fastgithub解决GitHub无法访问 主题标签 Tag Plugins 雨世界地图(简体中文) Twikoo 添加自定义表情包 abbrlink插件生成永久固定链接
Front-matter 的基本认识
MortalCat · 2024-05-25 · via

注:本文摘抄于 安知鱼主题文档 留以自用 o(` ω´ )o

Front-matter 的基本认识

Front-mattermarkdown 文件最上方以 --- 分隔的区域,用于指定个别档案的变数。其中又分为两种

  1. Page Front-matter 用于页面配置
  2. Post Front-matter 用于文章页配置

tips:如果标注可选的参数,可根据自己需要添加,不用全部都写在 markdown 里

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    title:
    date:
    updated:
    type:
    comments:
    description:
    keywords:
    top_img:
    mathjax:
    katex:
    aside:
    aplayer:
    highlight_shrink:
    type:
    top_single_background:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    title:
    date:
    updated:
    tags:
    categories:
    keywords:
    description:
    top_img:
    comments:
    cover:
    toc:
    toc_number:
    toc_style_simple:
    copyright:
    copyright_author:
    copyright_author_href:
    copyright_url:
    copyright_info:
    mathjax:
    katex:
    aplayer:
    highlight_shrink:
    aside:
    swiper_index: 1
    top_group_index: 1
    background: "#fff"

    Page Front-matter

    写法解释
    title【必需】页面标题
    date【必需】页面创建日期
    type【必需】标签、分类、关于、音乐馆、友情链接、相册、相册详情、朋友圈、即刻页面需要配置
    updated【可选】页面更新日期
    description【可选】页面描述
    keywords【可选】页面关键字
    comments【可选】显示页面评论模块(默认 true)
    top_img【可选】页面顶部图片
    mathjax【可选】显示 mathjax(当设置 mathjax 的 per_page: false 时,才需要配置,默认 false)
    katex【可选】显示 katex(当设置 katex 的 per_page: false 时,才需要配置,默认 false)
    aside【可选】显示侧边栏 (默认 true)
    aplayer【可选】在需要的页面加载 aplayer 的 js 和 css,请参考文章下面的音乐 配置
    highlight_shrink【可选】配置代码框是否展开(true/false)(默认为设置中 highlight_shrink 的配置)
    top_single_background【可选】部分页面的顶部模块背景图片

    Post Front-matter

    写法解释
    title【必需】文章标题
    date【必需】文章创建日期
    updated【可选】文章更新日期
    tags【可选】文章标签
    categories【可选】文章分类
    keywords【可选】文章关键字
    description【可选】文章描述
    top_img【可选】文章顶部图片
    cover【可选】文章缩略图(如果没有设置 top_img,文章页顶部将显示缩略图,可设为 false/图片地址/留空)
    comments【可选】显示文章评论模块(默认 true)
    toc【可选】显示文章 TOC(默认为设置中 toc 的 enable 配置)
    toc_number【可选】显示 toc_number(默认为设置中 toc 的 number 配置)
    toc_style_simple【可选】显示 toc 简洁模式
    copyright【可选】显示文章版权模块(默认为设置中 post_copyright 的 enable 配置)
    copyright_author【可选】文章版权模块的文章作者
    copyright_author_href【可选】文章版权模块的文章作者链接
    copyright_url【可选】文章版权模块的文章链接链接
    copyright_info【可选】文章版权模块的版权声明文字
    mathjax【可选】显示 mathjax(当设置 mathjax 的 per_page: false 时,才需要配置,默认 false)
    katex【可选】显示 katex(当设置 katex 的 per_page: false 时,才需要配置,默认 false)
    aplayer【可选】在需要的页面加载 aplayer 的 js 和 css,请参考文章下面的音乐 配置
    highlight_shrink【可选】配置代码框是否展开(true/false)(默认为设置中 highlight_shrink 的配置)
    aside【可选】显示侧边栏 (默认 true)
    swiper_index【可选】首页轮播图配置 index 索引,数字越小越靠前
    top_group_index【可选】首页右侧卡片组配置, 数字越小越靠前
    ai【可选】文章 ai 摘要
    main_color【可选】文章主色,必须是 16 进制颜色且有 6 位,不可缩减,例如#ffffff 不可写成#fff
    1. 首页轮播图配置: swiper_index, 数字越小越靠前
    2. 首页卡片配置: top_group_index, 数字越小越靠前
    3. page 中top_single_background, 可配置部分页面的顶部背景图片

    只需要在你的文章顶部的Front-matter配置这swiper_indextop_group_index两个字段即可显示轮播图和推荐卡片

    文章置顶
    hexo-generator-index 从 2.0.0 开始,已经支持文章置顶功能。你可以直接在文章的 front-matter 区域里添加 sticky: 1 属性来把这篇文章置顶。数值越大,置顶的优先级越大。

    头像头像

    MortalCat

    MortalCat's blog

    本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Mo的记事簿


    最近发布

    安知鱼主题美化及实用教程库

    给群晖套件版Emby添加网络代理

    保姆式Hexo博客搭建教程

    类原生安卓网络和时间修复

    解决网站 URL 加个 index.html 后 Twikoo 评论显示问题