当前位置:网站首页>Blog building 7: Hugo
Blog building 7: Hugo
2022-07-28 08:35:00 【King who personally patrols the mountain】
I plan to stick to blogging for a long time , Considering that the number of blog posts will slowly increase ,hexo The framework will be more and more stretched , So I changed my blog from hexo Migrate to hugo.
install hugo
First of all, from the GitHub Upload and download hugo, Address :https://github.com/gohugoio/hugo
Download the corresponding version according to your computer , Download it and unzip it to a file directory ( Out of habit, you'd better choose the full English path ) And then hugo Add the path address of the file to the system variable path Can be used in .
No need to install !
No need to install !
No need to install !
stay cmd Verify in the command :
hugo version
The following statement appears to prove hugo It can be used normally
Hugo Static Site Generator v0.70.0/extended windows/amd64 BuildDate: unknown
register GitHub account number
Create a new empty warehouse , Warehouse name :usename.github.io, For the back of the GitHub pages To prepare for , If you name it casually , You can't deploy the blog to GitHub Yes .
install Git
I wrote in blog Building 1. See :http://t.csdn.cn/sSAIU Basically, download it and take the next step along the way , And then git Link with your warehouse , In this way, local files can be pushed into your blog warehouse .git The function of is to push your local blog files to GitHub pages On , In this way, others can access your blog through the site address , Happiness comes from sharing .
Build a blog site
In a folder directory , function cmd command :
hugo new site xxx # xxx For you, for the name of your local blog , In the future, all files are in this directory
Then a pile of files will be generated under this directory , Never mind , We only care about content Folder 、theme The folder and config.toml file , This includes our blog .md File storage , Theme setting and hugo Basic page setup , For example, change the website name, author name and so on .
Choose a blog theme
because hugo No default theme , There is no blog page , So first find a blog topic , stay hugo On the official website or GitHub You can find it on , Then follow the operation instructions on different topics , It is suggested to choose a simple , First set up the blog , Then choose the theme slowly , The theme I choose is loveit.
Create a new blog post
hugo new posts/xxx.md
This will content Generate under folder posts Folder , Some topics have a label that points to posts Folder , It is best to create the following , That is, don't directly hugo new xxx.md, Otherwise, you may not find your blog content . Then generate xxx.md file , This file is the one you edit later , Use what you're familiar with markdown The software can write content .
Deploy blog
Use cmd Command or direct git bash here Input :
hugo
Will be generated in the blog root directory public Folder , The documents inside are the documents we want to push to the warehouse . Use... In this directory cmd Command or direct git bash here .
For the first push, you should first establish contact with the warehouse address :
git init
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/usename/usename.github.io.git # ** notes : Change this to your warehouse address , Otherwise, the push will not succeed **
git push -u origin main
Add articles later :
stay public Folder operation
git add .
git commit -m "add blog post"
git push
So far, your blog is basically set up , Then there is blogging and topic selection , As for how to choose the theme , Different people have different opinions. Different people have different opinions .
边栏推荐
- [mindspire YiDianTong robot-01] you may have seen many Knowledge Q & A robots, but this is a little different
- JS cartoon English alphabet typing game source code
- Prescan quick start to master the track editing path of Lecture 16
- Leetcode/ sum of two numbers in a sorted array
- File operation of QT
- PMP practice once a day | don't get lost in the exam -7.13
- Prescan quick start to master the road elements of lecture 15
- Usage of qmap
- Openstack dashboard configuring public network access
- 优炫数据库导入和导出方法
猜你喜欢

Understand the propagation process of EMI electromagnetic interference through five diagrams - the influence of square wave steepness on high-frequency components, the spectrum graph from time sequenc

Es6: template string

一键开关机电路

机器学习如何做到疫情可视化——疫情数据分析与预测实战

SQL注入 ----前置基础

半桥BUCK电路—记录篇

2022牛客多校第二场解题报告

本人男,27岁技术经理,收入太高,心头慌得一比

中标捷报!南大通用GBase 8s中标南瑞集团2022年数据库框架项目

网络安全漏洞分析与漏洞复现
随机推荐
CarSim simulation quick start (XI) - Driver Model (1)
Window 1 - > main window of the application (27)
Matlab file path
一键开关机电路
When unity switches to another scene, he finds that the scene is dimmed
Can‘t connect to server on ‘IP‘ (60)
2022牛客多校第二场解题报告
Draw.io image saving path settings
Opencv+paddle Orc recognize pictures and extract table information
JS candy xiaoxiaole game source code
Can the variable modified by final be modified
UE4 engine customizes screenpass and MRT output
MCU IO port controls 12V voltage on and off, MOS and triode circuit
Blog Building 9: add search function to Hugo
There are two Kafka topics that need to write data intact to MySQL King through Flink. Scheme 1: write two f's
2022 Niuke multi school first problem solving Report
PHPUnit在Window下如何配置
49-OpenCv深入分析轮廓
Chairman tree review
招贤纳士,GBASE高端人才招募进行中