当前位置:网站首页>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 .
边栏推荐
- An article to understand data warehouse: metadata classification, metadata management
- New generation cloud native message queue (II)
- Mysql-怎么添加用户和设置权限?
- 2022牛客多校第二场解题报告
- 解决EMC、EMI传导干扰的八大方法
- GBASE亮相联通云巡展(四川站) 以专业赋能云生态
- Prescan quick start to proficient in lecture 17, speed curve editor
- ASP. Net core foundation IV
- 单片机IO口控制12V电压通断,MOS和三极管电路
- 本人男,27岁技术经理,收入太高,心头慌得一比
猜你喜欢

5张图告诉你:同样是职场人,差距怎么这么大?

Allure use

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

Prescan quick start to proficient in lecture 17, speed curve editor

CAT1 4G+以太网开发板232数据通过4G模块TCP发到服务器

Prescan quick start to master the road elements of lecture 15

HCIP---LDP和MPLS技术(详解)

Blog Building 9: add search function to Hugo

网络安全漏洞分析与漏洞复现

Es6: arrow function usage
随机推荐
Usage of qmap
博客搭建九:hugo添加搜索功能
QT 怎么删除布局里的所有控件?
JS cartoon English alphabet typing game source code
Understand CDN
Day112.尚医通:手机验证码登录功能
SQL function
一篇文章搞懂数据仓库:元数据分类、元数据管理
【MindSpore易点通机器人-01】你也许见过很多知识问答机器人,但这个有点不一样
Tell you step by step what you need to do to apply for PMP? What should I do?
Hcip --- LDP and MPLS Technology (detailed explanation)
2022牛客多校第二场解题报告
sql server时间字段排序
博客搭建七:hugo
PostgreSQL is the world's most advanced open source relational database
JS candy xiaoxiaole game source code
Usage of constructors
五张图看懂EMI电磁干扰的传播过程-方波陡峭程度对高频成分的影响,时序到频域频谱图形,波形形状对EMI辐射的影响。
Creation of status bar (29)
How to build the protection system of class protection technology of 2022 series of ISO compliance (Part I)