搭建永久免费的博客(1)基本介绍
Hugo+Stack+GitHub
GitHub
GitHub
GitHub · Build and ship software on a single, collaborative platform · GitHub
下载安装git
Git - Downloads
Edge插件authenticator 2fa client
Settings->Password and authentication->Authenticator app->Edit
国内访问设置
# 打开 Hosts 文件(Windows 路径:C:\Windows\System32\drivers\etc\hosts)
notepad C:\Windows\System32\drivers\etc\hosts# 添加以下内容
140.82.114.3 github.com
140.82.114.4 gist.github.com
151.101.1.194 github.global.SSL.fastly.net# 保存文件后,刷新 DNS 缓存
ipconfig /flushdns
其他方法:使用加速器可以有效提高访问速度。推荐使用 Watt Toolkit(Steam++) 或 网易 UU 加速器
Hugo
Hugo v0.131.0
https://github.com/gohugoio/hugo
# 创建网站项目
hugo new site teacher_blog
# 启动服务
hugo server -D
# 创建文章
hugo new content post/about-me/index.md
hugo new content post/about-me/index.zh-cn.md
Stack
Stack v3.26.0
GitHub - CaiJimmy/hugo-theme-stack: Card-style Hugo theme designed for bloggers
Emoji
全部Emoji(3781) | EmojiAll
utterances
utterances
为Hugo构建的博客站点添加评论组件 - 简书
icons
Tabler Icons: 5900+ free vector icons for web design
iconfont-阿里巴巴矢量图标库
baseurl: freshman118.github.io
languageCode: en-us
theme: hugo-theme-stack
paginate: 5
title: 90后小陈老师
copyright: 90后小陈老师# Theme i18n support
# Available values: ar, bn, ca, de, el, en, es, fr, hu, id, it, ja, ko, nl, pt-br, th, uk, zh-cn, zh-hk, zh-tw
DefaultContentLanguage: zh-cn# Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko]
# This will make .Summary and .WordCount behave correctly for CJK languages.
hasCJKLanguage: falselanguages:zh-cn:languageName: 中文title: 90后小陈老师weight: 2params:description: 演示说明
services:# Change it to your Disqus shortname before usingdisqus:shortname: "hugo-theme-stack"# GA Tracking IDgoogleAnalytics:id:permalinks:post: /p/:slug/page: /:slug/params:mainSections:- postfeaturedImageField: imagerssFullContent: truefavicon: # e.g.: favicon placed in `static/favicon.ico` of your site folder, then set this field to `/favicon.ico` (`/` is necessary)footer:since: 2025customText: dateFormat:published: 2006-02-02lastUpdated: 2006-02-02T13:18:50sidebar:emoji: 😁subtitle: 分享技术,享受生活avatar:enabled: truelocal: truesrc: img/avatar.jpgarticle:math: falsetoc: truereadingTime: falsecomments:enabled: trueprovider: disqusdisqusjs:shortname:apiUrl:apiKey:admin:adminLabel:utterances:repo:issueTerm: pathnamelabel:beaudar:repo:issueTerm: pathnamelabel:theme: remark42:host:site:locale:vssue:platform:owner:repo:clientId:clientSecret:autoCreateIssue: false# Waline client configuration see: https://waline.js.org/en/reference/component.htmlwaline:serverURL:lang:pageview:emoji:- https://unpkg.com/@waline/emojis@1.0.1/weiborequiredMeta:- name- email- urllocale:admin: Adminplaceholder:twikoo:envId:region:path:lang:# See https://cactus.chat/docs/reference/web-client/#configuration for description of the various optionscactus:defaultHomeserverUrl: "https://matrix.cactus.chat:8448"serverName: "cactus.chat"siteName: "" # You must insert a unique identifier here matching the one you registered (See https://cactus.chat/docs/getting-started/quick-start/#register-your-site)giscus:repo:repoID:category:categoryID:mapping:lightTheme:darkTheme:reactionsEnabled: 1emitMetadata: 0gitalk:owner:admin:repo:clientID:clientSecret:cusdis:host:id:widgets:homepage:- type: search- type: archives# 显示归档年份数量params:limit: 4- type: categoriesparams:limit: 10# - type: tag-cloud# params:# limit: 10page:- type: tocopengraph:twitter:# Your Twitter usernamesite:# Available values: summary, summary_large_imagecard: summary_large_imagedefaultImage:opengraph:enabled: falselocal: falsesrc:colorScheme:# Display toggletoggle: true# Available values: auto, light, darkdefault: autoimageProcessing:cover:enabled: truecontent:enabled: true### Custom menu
### See https://stack.jimmycai.com/config/menu
### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter
menu:main: []social:- identifier: githubname: GitHuburl: https://github.com/freshman118params:icon: brand-github- identifier: bilibiliname: Bilibiliurl: https://space.bilibili.com/3493114532596161params:icon: brand-bilibilirelated:includeNewer: truethreshold: 60toLower: falseindices:- name: tagsweight: 100- name: categoriesweight: 200markup:goldmark:renderer:## Set to true if you have HTML content inside Markdownunsafe: truetableOfContents:endLevel: 4ordered: truestartLevel: 2highlight:noClasses: falsecodeFences: trueguessSyntax: truelineNoStart: 1lineNos: truelineNumbersInTable: truetabWidth: 4
上线
创建GitHub仓库
freshman118.github.io
hugo -D
cd public git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/freshman118/freshman118.github.io.git
git push -u origin main
git push -f origin main# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
hugo -D
cd public
git add .
git commit -m "3 commit"
git push -u origin main