hugo

hugo

theme: next

  1. install hugo
  2. create a new site hugo new site <sitename>
  3. add theme Usage of next theme
    • download theme file: git clone https://github.com/xtfly/hugo-theme-next.git next
    • copy next directory to themes directory in your hugo site
    • move config.toml to the root directory in your hugo site, and modify it to the actual information for your site.
    • create some markdown files in directory(content/post), like https://github.com/xtfly/xtfly.github.io/tree/hugo/content
    • start hugo server in root directory: hugo server
    • open browser: http://localhost:1313/
  4. start server hugo server --bind 0.0.0.0 --baseURL http://10.0.0.7:1313

框架

[blog]$ ls
archetypes  config.toml  content  data  layouts  public  resources  static  themes

博客内容

  1. 将你写的博客内容markdown文档所在目录链接到 content 目录,链接文件命名为 post
  2. 将你的about目录链接到 content 目录,链接文件名为 about
[blog]$ tree content/
content/
├── about -> /home/lv/post/about
└── post -> /home/lv/post

博客发布

将博客发布内容路径链接为 hugo 的根目录, 链接文件命名为 public

hugo markdown 插入图片

e.g.

  • 图片名字:nescafe.png
  • hugo 工程 content/post/hello.md
  1. content/post/ 目录下创建 markdown 文档同名文件夹 hello
  2. 将图片 nescafe.png 放入 content/post/hello/ 目录下
  3. markdown 文件 hello.md 中引用方法:![](nescafe.png)

Q&A