← Back to Index
Research & Engineering Archive

Build a personal website by Hugo

By Jingnan Huang · January 19, 2025 · 1121 Words

Last Edit: 1/19/25

简介
#

Img

环境准备
#

创建项目
#

scoop install hugo-extended
hugo new site {{这里填你的文件名}}
hugo server
- Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
- Press Ctrl+C to stop

Img

显示Page Not Found是正确的

安装主题
#

Img

git submodule add -b main https://github.com/nunocoracao/blowfish.git themes/blowfish
- theme = 'blowfish'

Img

主题配置
#

[homepage]
  layout = "background" # valid options: page, profile, hero, card, background, custom
  #homepageImage = "IMAGE.jpg" # used in: hero, and card
  showRecent = true

创建文章
#

---
title: "Docs"
description: ""
cascade:
  showDate: true
  showAuthor: false
  invertPagination: true
---

建议采取一个文件夹一个文章方式,如该文件夹为其他页面的父页面,则命名为_index.md,如没有子文档,则文档存放markdown命名为index.md

预览
#

hugo server

Img

上传至Github pages
#

hugo
cd .\public\
git init -b main 
git remote add origin {{仓库链接}}
git add .
git commit -m "init"
git push -u origin main