Hugo博客搭建全过程
Hugo博客搭建全过程
Last edited 2022-10-11
password
type
Post
status
Published
date
Mar 22, 2018
slug
summary
Hugo-blog
tags
工具
开发
建站
category
技术分享
icon
 

在github建立两个仓库

第一个

git clone https://github.com/kvylin/hugo.git cd hugo rm -rf public git add . 提交删除public文件夹 git submodule add https://github.com/kvylin/kvylin.github.io.git public #下载子模块####git submodule update --init --recursive cd public git checkout master cd ../ #创建博客 hugo new posts/Golang-test.md #每次执行下面4行 ./d.sh _______ git add -A git commit -m "Update blog" git push origin master

第二个

#deploy.sh #!/bin/bash echo -e "\033[0;32mDeploying updates to GitHub...\033[0m" # Build the project. hugo # if using a theme, replace by `hugo -t <yourtheme>` # Go To Public folder cd public # Add changes to git. git add -A # Commit changes. msg="rebuilding site `date`" if [ $# -eq 1 ] then msg="$1" fi git commit -m "$msg" # Push source and build repos. git push origin master # Come Back cd ..
参考1:https://kaichu.io/2015/07/12/my-first-post/
参考2: https://blog.hiweeds.net/post/hugo-deploy-as-submodule-on-github/
 
  • 工具
  • 开发
  • 建站
  • W计划自动化脚本