12 次查询 耗时 0.069 秒
本文共计726个字,1条留言,预计阅读时长3分钟
登录/注册
  • 首页
  • >
  • Notes
  • >
  • Hugo简单用法,以even主题为例
  • Hugo简单用法,以even主题为例

    作者:Misshylsay

    日期:2023年01月18日

    hugo安装

    brew install hugo

    创建网站

    在本地新建一个目录,cd到该目录下,执行如下命令

    hugo new site mysite

    安装主题

    以even主题为例,在网站跟目录下执行:

    git clone https://github.com/olOwOlo/hugo-theme-even themes/even
    

    重要: 在主题的 exampleSite 目录下有一个 config.toml 文件,将这个 config.toml 文件复制到你的站点目录下,根据自己的需求更改即可。

    重要: 本主题用到了 Hugo Pipes 功能。如需修改 assets 目录下的文件,请安装 extended 版。

    注意: 对于这个主题,你应该使用 post 而不是 posts,即 hugo new post/some-content.md

    even主题中文设置教程:https://github.com/olOwOlo/hugo-theme-even/blob/master/README-zh.md

    主题设置都在 config.toml 文件中。

    基本用法

    创建一个页面:

    hugo new page.md

    创建一篇文章:

    hugo new post/post.md

    模板:

    title: “文章标题”
    date: 2021-12-11T17:47:44+08:00
    draft: true
    show_comments: true
    description: “XXX”
    categories: [ “XXX”]
    tags: [ “XXX”, “XXX2”, “XXX3” ]
    keywords: [ “XXX”, “XXX2”, “XXX3” ]
    

    markdown语法参考: https://www.runoob.com/markdown/md-tutorial.html

     

    “Hugo简单用法,以even主题为例”共有1条评论

    1. 这个几年前就玩过,感觉除了折腾,实用性不大 😆

      中国 移动Safari浏览器 Mac OS X Lion 10_15_7

    发表评论

    B em del U Link Code Quote