赞
踩
上篇博客我们介绍了站点配置文件中的大部分配置项的作用,本篇博客则是介绍next主题的主题配置文件中配置项的作用。
# Allow to cache content generation. cache: # 是否允许缓存内容生成,默认即可 enable: true # Remove unnecessary files after hexo generate. minify: false # 是否允许生成最小化hexo网站,默认即可 # Define custom file paths. # Create your custom files in site directory `source/_data` and uncomment needed files below. custom_file_path: # 创建自定义文件的路径 #head: source/_data/head.njk #header: source/_data/header.njk #sidebar: source/_data/sidebar.njk #postMeta: source/_data/post-meta.njk #postBodyEnd: source/_data/post-body-end.njk #footer: source/_data/footer.njk #bodyEnd: source/_data/body-end.njk #variable: source/_data/variables.styl #mixin: source/_data/mixins.styl #style: source/_data/styles.styl # --------------------------------------------------------------- # Scheme Settings # --------------------------------------------------------------- # Schemes # 视图选择,这个看个人喜好,我个人是偏向Gemini scheme: Muse # Muse默认方案,使用黑白色调 #scheme: Mist # Mist具有整洁的单列视图 #scheme: Pisces # Pisces 双栏方案 #scheme: Gemini # Gemini看起来像双鱼座,但有明显的带有阴影的柱状块,看起来对视图更敏感 # Dark Mode darkmode: false # 是否开启黑暗模式 # --------------------------------------------------------------- # Site Information Settings # --------------------------------------------------------------- # 网站图标设置,可以自定义图标,然后把图片资源放在source/images目录中即可,为了增快访问速度,可以把资源放在其他地方 favicon: small: /images/favicon-16x16-next.png medium: /images/favicon-32x32-next.png apple_touch_icon: /images/apple-touch-icon-next.png safari_pinned_tab: /images/logo.svg #android_manifest: /manifest.json # 自定义徽标,看个人选择 # Custom Logo (Warning: Do not support scheme Mist) custom_logo: #/uploads/custom-logo.jpg # 创建共用,实际上就是展示版权信息,看个人选择 # Creative Commons 4.0 International License. # See: https://creativecommons.org/about/cclicenses/ creative_commons: # Available values: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | cc-zero license: by-nc-sa # Available values: big | small size: small sidebar: false post: false # You can set a language value if you prefer a translated version of CC license, e.g. deed.zh # CC licenses are available in 39 languages, you can find the specific and correct abbreviation you need on https://creativecommons.org language: # Open graph settings # See: https://hexo.io/docs/helpers#open-graph # 没仔细去研究,反正默认即可 open_graph: enable: true options: #twitter_card: <twitter:card> #twitter_id: <twitter:creator> #twitter_site: <twitter:site> #twitter_image: <twitter:image> #google_plus: <g+:profile_link> #fb_admins: <fb:admin_id> #fb_app_id: <fb:app_id> # --------------------------------------------------------------- # Menu Settings # --------------------------------------------------------------- # Usage: `Key: /link/ || icon` # Key is the name of menu item. If the translation for this item is available, the translated text will be loaded, otherwise the Key name will be used. Key is case-sensitive. # Value before `||` delimiter is the target link, value after `||` delimiter is the name of Font Awesome icon. # External url should start with http:// or https:// # 菜单配置项,一般用到首页、标签、分类等菜单,启用某菜单项的话需要配置相关的页面,配置相关页面在source目录下创建 menu: #home: / || fa fa-home #about: /about/ || fa fa-user #tags: /tags/ || fa fa-tags #categories: /categories/ || fa fa-th #archives: /archives/ || fa fa-archive #schedule: /schedule/ || fa fa-calendar #sitemap: /sitemap.xml || fa fa-sitemap #commonweal: /404/ || fa fa-heartbeat # Enable / Disable menu icons / item badges. # 是否启用菜单图标以及菜单项统计,建议都开 menu_settings: icons: true badges: false # --------------------------------------------------------------- # Sidebar Settings # See: https://theme-next.js.org/docs/theme-settings/sidebar # --------------------------------------------------------------- # 侧边栏设置,设置侧边栏位置,看个人喜欢 sidebar: # Sidebar Position. position: left #position: right # 侧边栏宽度设置,没有特殊要求默认即可 # Manual define the sidebar width. If commented, will be default for: # Muse | Mist: 320 # Pisces | Gemini: 240 #width: 300 # 设置侧栏显示的时机,仅适用于Muse | Mist,由于我设置的是Gemini,所以这块没怎么研究,感兴趣的话可以自行研究 # Sidebar Display (only for Muse | Mist), available values: # - post expand on posts automatically. Default. # - always expand for all pages automatically. # - hide expand only when click on the sidebar toggle icon. # - remove totally remove sidebar including sidebar toggle. display: post # 设置侧边栏填充 # Sidebar padding in pixels. padding: 18 # 侧边栏与顶部菜单栏的位置 # Sidebar offset from top menubar in pixels (only for Pisces | Gemini). offset: 12 # Sidebar Avatar # 是否设置侧边栏图像,看个人爱好 avatar: # Replace the default image and set the url here. url: #/images/avatar.gif # If true, the avatar will be displayed in circle. # 是否显示为圆形图像 rounded: false # If true, the avatar will be rotated with the cursor. # 是否设置鼠标悬停时旋转头像 rotated: false # 是否在侧边栏显示分类、标签等 # Posts / Categories / Tags in sidebar. site_state: true # 社交链接添加 # Social Links # Usage: `Key: permalink || icon` # Key is the link label showing to end users. # Value before `||` delimiter is the target permalink, value after `||` delimiter is the name of Font Awesome icon. social: #GitHub: https://github.com/yourname || fab fa-github #E-Mail: mailto:yourname@gmail.com || fa fa-envelope #Weibo: https://weibo.com/yourname || fab fa-weibo #Google: https://plus.google.com/yourname || fab fa-google #Twitter: https://twitter.com/yourname || fab fa-twitter #FB Page: https://www.facebook.com/yourname || fab fa-facebook #StackOverflow: https://stackoverflow.com/yourname || fab fa-stack-overflow #YouTube: https://youtube.com/yourname || fab fa-youtube #Instagram: https://instagram.com/yourname || fab fa-instagram #Skype: skype:yourname?call|chat || fab fa-skype social_icons: enable: true icons_only: false transition: false # 友情链接添加 # Blog rolls links_settings: icon: fa fa-globe # 图标可以选择其他图标,我个人使用的是fa fa-link title: Links # Available values: block | inline layout: block # 友链布局 # 友链链接 links: #Title: https://example.com # 侧边栏目录 # Table of Contents in the Sidebar # Front-matter variable (nonsupport wrap expand_all). toc: enable: true # Automatically add list number to toc. # 是否自动添加编号,建议写Markdown的时候就添加编号,然后这里关掉 number: true # If true, all words will placed on next lines if header width longer then sidebar width. # 当标题宽度大于侧边栏宽度时,是否将标题放在下一行 wrap: false # If true, all level of TOC in a post will be displayed, rather than the activated part of it. # 是否显示所有级别的目录 expand_all: false # Maximum heading depth of generated toc. # 目录深度 max_depth: 6 # 页脚设置 # --------------------------------------------------------------- # Footer Settings # See: https://theme-next.js.org/docs/theme-settings/footer # --------------------------------------------------------------- # 是否在页脚中显示多语言切换器 # Show multilingual switcher in footer. language_switcher: false footer: # Specify the year when the site was setup. If not defined, current year will be used. # 设置站点的年份,若未设置,则使用当前年份 #since: 2021 # Icon between year and copyright info. icon: # Icon name in Font Awesome. See: https://fontawesome.com/icons # 页脚小图标 name: fa fa-heart # If you want to animate the icon, set it to true. # 是否设置图标动画 animated: false # Change the color of icon, using Hex Code. # 图标颜色 color: "#ff0000" # If not defined, `author` from Hexo `_config.yml` will be used. copyright: # 是否显示页脚的强力驱动 # Powered by Hexo & NexT powered: true # 是否显示ICP等信息 # Beian ICP and gongan information for Chinese users. See: https://beian.miit.gov.cn, http://www.beian.gov.cn beian: enable: false icp: # The digit in the num of gongan beian. gongan_id: # The full num of gongan beian. gongan_num: # The icon for gongan beian. See: http://www.beian.gov.cn/portal/download gongan_icon_url: # --------------------------------------------------------------- # Post Settings # See: https://theme-next.js.org/docs/theme-settings/posts # --------------------------------------------------------------- # 是否自动将主页中的描述摘录为前言文本,建议开启 # Automatically excerpt description in homepage as preamble text. excerpt_description: true # Read more button # If true, the read more button will be displayed in excerpt section. # 是否显示阅读更多按钮,建议开启 read_more_btn: true # Post meta display settings post_meta: item_text: true # 显示帖子的描述文本。 created_at: true # 显示帖子的创建时间 updated_at: enable: true # 显示帖子的更新时间 another_day: true categories: true # 是否显示帖子类别 # 帖子字数以及阅读时间显示,需要安装hexo-word-counter 插件,并在站点配置文件中启用 # Post wordcount display settings # Dependencies: https://github.com/next-theme/hexo-word-counter symbols_count_time: separated_meta: true # 是否在单独的行显示字数和阅读时间 item_text_total: false # 是否在页脚显示字数和预计阅读时间 # 更改文章底部tag图标 # Use icon instead of the symbol # to indicate the tag at the bottom of the post tag_icon: false # 捐献设置,我的博客是技术分享,不设置捐献,所以我也没多研究 # Donate (Sponsor) settings # Front-matter variable (nonsupport animation). reward_settings: # If true, a donate button will be displayed in every article by default. enable: false animation: false #comment: Buy me a coffee reward: #wechatpay: /images/wechatpay.png #alipay: /images/alipay.png #paypal: /images/paypal.png #bitcoin: /images/bitcoin.png # Subscribe through Telegram Channel, Twitter, etc. # Usage: `Key: permalink || icon` (Font Awesome) follow_me: #Twitter: https://twitter.com/username || fab fa-twitter #Telegram: https://t.me/channel_name || fab fa-telegram #WeChat: /images/wechat_channel.jpg || fab fa-weixin #RSS: /atom.xml || fa fa-rss # 相关热门帖子,需要安装hexo-related-posts插件,然后在post页面中增加代码 # Related popular posts # Dependencies: https://github.com/sergeyzwezdin/hexo-related-posts related_posts: enable: false title: # Custom header, leave empty to use the default one # 默认使用相关帖子作为标题 display_in_home: false # 是否在首页显示相关帖子 # 帖子编辑功能,建议关闭,该功能可以让用户在 GitHub 上快速浏览和修改博客的源代码。 # Post edit # Easily browse and edit blog source code online. post_edit: enable: false url: https://github.com/user-name/repo-name/tree/branch-name/subdirectory-name/ # Link for view source #url: https://github.com/user-name/repo-name/edit/branch-name/subdirectory-name/ # Link for fork & edit # 发布导航功能,在帖子页脚中显示上一篇或者下一篇 # Show previous post and next post in post footer if exists # Available values: left | right | false post_navigation: left # 设置自定义页面 # --------------------------------------------------------------- # Custom Page Settings # See: https://theme-next.js.org/docs/theme-settings/custom-pages # --------------------------------------------------------------- # 标签设置页面 # TagCloud settings for tags page. tagcloud: min: 12 # Minimum font size in px max: 30 # Maximum font size in px amount: 200 # Total amount of tags orderby: name # Order of tags order: 1 # Sort order # 谷歌日历页面 # Google Calendar # Share your recent schedule to others via calendar page. calendar: calendar_id: <required> # Your Google account E-Mail api_key: <required> orderBy: startTime showLocation: false offsetMax: 72 # Time Range offsetMin: 4 # Time Range showDeleted: false singleEvents: true maxResults: 250 # --------------------------------------------------------------- # Misc Theme Settings # See: https://theme-next.js.org/docs/theme-settings/miscellaneous # --------------------------------------------------------------- # NexT 支持添加预连接资源提示以建立与字体和插件来源的早期连接。 # Preconnect CDN for fonts and plugins. # For more information: https://www.w3.org/TR/resource-hints/#preconnect preconnect: false # 文本对齐 # Set the text alignment in posts / pages. text_align: # Available values: start | end | left | right | center | justify | justify-all | match-parent desktop: justify mobile: justify # 移动设备适配 # Reduce padding / margin indents on devices with narrow width. mobile_layout_economy: false # 主题颜色 # Browser header panel color. theme_color: light: "#222" dark: "#222" # 正文滚动条,覆盖浏览器的默认行为 # Override browsers' default behavior. body_scrollbar: # Place the scrollbar over the content. # 将滚动条放在内容上 overlay: false # Present the scrollbar even if the content is not overflowing. # 显示滚动条,即使内容没有溢出 stable: false # 代码块相关功能 codeblock: # Code Highlight theme # All available themes: https://theme-next.js.org/highlight/ theme: light: default dark: stackoverflow-dark prism: light: prism dark: prism-dark # Add copy button on codeblock # 添加复制按钮 copy_button: enable: false # Available values: default | flat | mac style: # 返回顶部 back2top: enable: true # Back to top in sidebar. # 在侧边栏中返回顶部 sidebar: false # Scroll percent label in b2t button. # 显示滚动百分比 scrollpercent: false # 显示阅读进度 # Reading progress bar reading_progress: enable: false # Available values: left | right start_at: left # Available values: top | bottom position: top reversed: false color: "#37c6c0" height: 3px # 保存阅读进度(书签) # Bookmark Support bookmark: enable: false # Customize the color of the bookmark. color: "#222" # If auto, save the reading progress when closing the page or clicking the bookmark-icon. # If manual, only save it by clicking the bookmark-icon. save: auto # GitHub 横幅 # `Follow me on GitHub` banner in the top-right corner. github_banner: enable: false permalink: https://github.com/yourname title: Follow me on GitHub # --------------------------------------------------------------- # Font Settings # --------------------------------------------------------------- # Find fonts on Google Fonts (https://fonts.google.com) # All fonts set here will have the following styles: # light | light italic | normal | normal italic | bold | bold italic # Be aware that setting too much fonts will cause site running slowly # --------------------------------------------------------------- # Web Safe fonts are recommended for `global` (and `title`): # Arial | Tahoma | Helvetica | Times New Roman | Courier New | Verdana | Georgia | Palatino | Garamond | Comic Sans MS | Trebuchet MS # --------------------------------------------------------------- # 自定义字体,分为全局字体、网站标题字体、文章标题字体、文章字体和代码字体,说实话,没啥必要去自定义字体 font: enable: false # Uri of fonts host, e.g. https://fonts.googleapis.com (Default). host: # Font options: # `external: true` will load this font family from `host` above. # `family: Times New Roman`. Without any quotes. # `size: x.x`. Use `em` as unit. Default: 1 (16px) # Global font settings used for all elements inside <body>. global: external: true family: Lato size: # Font settings for site title (.site-title). title: external: true family: size: # Font settings for headlines (<h1> to <h6>). headings: external: true family: size: # Font settings for posts (.post-body). posts: external: true family: # Font settings for <code> and code blocks. codes: external: true family: # 搜索引擎优化 # --------------------------------------------------------------- # SEO Settings # See: https://theme-next.js.org/docs/theme-settings/seo # --------------------------------------------------------------- # If true, site-subtitle will be added to index page. # Remember to set up your site-subtitle in Hexo `_config.yml` (e.g. subtitle: Subtitle) index_with_subtitle: false # Automatically add external URL with Base64 encrypt & decrypt. exturl: false # If true, an icon will be attached to each external URL exturl_icon: true # 设置谷歌站长工具的验证字符串用于提交站点地图。 # Google Webmaster tools verification. # See: https://developers.google.com/search google_site_verification: # 设置必应站长工具的验证字符串用于提交站点地图。 # Bing Webmaster tools verification. # See: https://www.bing.com/webmasters bing_site_verification: # Yandex Webmaster tools verification. # See: https://webmaster.yandex.ru yandex_site_verification: # Baidu Webmaster tools verification. # See: https://ziyuan.baidu.com/site baidu_site_verification: # 第三方插件和服务设置,在这里不讲,后面优化博客的时候如果用到会说,第三方插件并不是所有都会用到 # --------------------------------------------------------------- # Third Party Plugins & Services Settings # See: https://theme-next.js.org/docs/third-party-services/ # More plugins: https://github.com/next-theme/awesome-next # You may need to install the corresponding dependency packages # ---------------------------------------------------------------
next主题配置文件的配置项很多,但是其实大部分我们是不需要改动的。而且为了以后升级主题,不建议直接在主题配置文件中改动配置,而是使用备用主题配置来配置主题,至于怎么使用会在后续的博客中说。
我的博客:https://blog.z7sz.top
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。