Hugo NexT 搭建全记录
LoveIt迁移到NexT,架设在Netlify上
本地环境
Git Download ,用于后续博客版本的维护
Hugo Extended, 安装| Hugo (gohugo.io)
Windows 安装 Chocolatey & Hugo Extended
以管理员身份打开CMD或PowerShell
CMD:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
PowerShell
Set-ExecutionPolicy -ExecutionPolicy AllSigned Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
安装或更新Hugo
choco install hugo-extended [--force] # 更新加上`--force`
博客搭建
初始化
hugo new site blog-site-name # 创建站点
hugo server # 本地预览
hugo new post/helloworld.md # 创建文章
加入主题
cd blog-site-name
git submodule add https://github.com/hugo-next/hugo-theme-next.git themes/hugo-theme-next
cp themes/hugo-theme-next/exampleSite/config.yaml .
文章模板
---
# 文章标题
title: "{{ replace .Name "-" " " | title }}"
# 文章内容摘要
description: "{{ .Name }}"
# 文章内容关键字
keywords: "{{replace .Name "-" ","}}"
# 发表日期
date: {{ .Date }}
# 最后修改日期
lastmod: {{ .Date }}
# 分类
categories:
-
# 标签
tags:
-
-
# 原文作者
#author:
# 原文链接
#link:
# 图片链接,用在open graph和twitter卡片上
#imgs:
# 在首页展开内容
#expand: true
# 外部链接地址,访问时直接跳转
#extlink:
# 在当前页面关闭评论功能
#comment:
# enable: false
# 关闭当前页面目录功能
# 注意:正常情况下文章中有H2-H4标题会自动生成目录,无需额外配置
#toc: false
# 绝对访问路径
#url: "{{ lower .Name }}.html"
# 开启文章置顶,数字越小越靠前
#weight: 1
# 开启数学公式渲染,可选值: mathjax, katex
#math: mathjax
# 开启各种图渲染,如流程图、时序图、类图等
#mermaid: true
---
配置模板 - Tip
- 主题可选:Gemini | Pisces | Mist | Muse
- favicon: 生产配置 替换 icon | small | medium | appleTouchIcon | customLogo(仅支持Mist)
- sidebar:left | right
- avatar:url
- social:
Key: name || permalink || icon
- links:
Key: name || permalink
- footer:since || icon || beian
- 站点验证:
- Google:https://search.google.com/search-console/ownership/ - 设置 - 所有权验证 - HTML标记
- Bing:https://www.bing.com/webmaster/ - 未完待续…