快速入门
Create a New Site
1
  | hugo new site quickstart
  | 
Add Some Content
1
  | hugo new posts/my-first-post.md
  | 
Start the Hugo server
Build static pages
常用配置
文章默认模板
1
  | themes/even/archetypes/default.md
  | 
自定义目录模板
1
2
3
4
  | themes/even/archetypes/dir1.md
# 使用dir1.md的模板
hugo new dir1/c.md
  | 
Markdown 文件
1
2
3
4
5
6
7
  | ---
title: "第七章 Linux 磁盘与文件系统管理"
date: 2021-03-17T13:31:34+08:00
draft: true
tags: ["Linux", "tag1"]
categories: ["游戏", "乐途"]
---
  | 
config.toml
1
2
3
4
  | [taxonomies]
  tag = "tags"
  series = "series"
  category = "categories"
  | 
重启服务后生效
HTML 文件中使用变量
只有在 html 文件中起作用!
自定义目录的 index.html
使用本地图片
将图片放置在 static 目录下
在新标签页打开连接
layouts/_default/_markup/render-link.html
1
  | <a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}  target="_blank" {{ if strings.HasPrefix .Destination "http" }} rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>
  | 
toml
添加 标签