当前位置:网站首页>Hugo blog building tutorial
Hugo blog building tutorial
2022-06-13 04:14:00 【Cun Yuyao】
Preface
With utilization Hexo
、docsify
、vuepress
Wait for the framework to build the blog experience , Let's take a look today Hugo
.Hugo
It's based on Go
Language and the implementation of the static web site generator , It is simple and easy to use 、 Efficient and easy to expand 、 Features of rapid deployment .
Let's start with Hugo
Official documents in Chinese and English , It is convenient for everyone to consult when encountering problems :
Let's take a look , How to use it Hugo
To build a blog .
Set up process
install Hugo
Since you want to use Hugo
, You need to install it first . If you want to install through binary installation package , First of all, you need to choose the installation package suitable for your platform , Then download it .
Here is not only suitable for Windows
Installation package of platform , It also includes Linux
The platform and macOS
Installation package of platform . More Than This , For different users , Also carefully provided 32
Bit and 64
Bits to choose from . Even for chips of different architectures, corresponding installation packages are provided , Can be said to be very careful .
But my demonstration here is mainly based on macOS
platform , So I will not install it in the form of installation package , Through here homebrew
One line of command can be easily done .
brew install hugo
If your macOS
Is not installed on homebrew
, Then hurry to install it .
Here's a warm reminder , Domestic users shall comply with homebrew
Basically, the installation through the official website will fail , So here is another installation method , Install through the following script .
/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"
Check for success
Although after installation through the above command , The console prompts us that the installation is successful , But we have no idea , Just want to see if the low installation is successful . At this time, you can view Hugo
The way the version number is , Laique Hugo
Is the installation successful .
hugo version
If the installation is successful , Then after executing the order, it will be like the above , Prompt you for the installed Hugo
Version of .
Initialize the website
Now that it's installed , The next step is to initialize our website directory . By the following command , We can accomplish Hugo
The project is initialized !
hugo new site [ Project name ]
hugo new site JavaPark
After the project is initialized , The resulting directory is as follows .
Here we need to pay attention to config.toml
, This is the configuration file for the project , Mainly used to configure Hugo
, The configuration in this file will be valid for the whole project .theme
The directory is mainly used to place topics , There is usually one inside theme.toml
, Used to configure the theme .
By default ,config.toml
There will only be the following three configurations .
Set the theme
To style our website , We need to choose a favorite topic .Hugo
It's not like Hexo
Provides more topics , But there are still many good ones , You can go to the skin list to find .
Here I choose a skin m10c
, Enter the project we initialized , Then use the following command to download the topic to theme
Under the folder .
git clone https://github.com/vaga/hugo-theme-m10c.git themes/m10c
Then go to the project configuration file config.toml
in , Set the theme .
theme = "m10c"
preview
After setting the theme , You can preview ! Start with the following command Hugo
The server , Then enter http://localhost:1313
You can preview !
hugo server -D
summary
The above is how to use Hugo
Set up a blog , Mainly from Hugo
install 、 Initialize project 、 Theme Settings 、 Preview and other aspects Hugo
Use , The rest is writing . It's a very difficult thing , I hope you can stick to it . Actually Hugo
There are many other ways to play , I won't introduce them one by one here , You can go to the official website to explore more ways to play .
边栏推荐
- 【自动化测试】关于unittest你需要知道的事
- Et framework -22 creating serverinfo entities and events
- Billions of data to determine whether the element exists
- 高等数学(第七版)同济大学 习题1-2 个人解答
- try-catch finally执行顺序的例题
- 史上最详细的Swin-Transformer 掩码机制(mask of window attentation)————shaoshuai
- 单片机外设介绍:温度传感器 DS18B20
- Google Chrome browser reports an error: net:: err_ BLOCKED_ BY_ CLIENT
- R: Airline customer value analysis practice
- [test development] use case
猜你喜欢
ET框架-22 创建ServerInfo实体及事件
Single chip microcomputer: MODBUS multi computer communication program design
SCM: introduction to Modbus communication protocol
How to use debounce in lodash to realize anti shake
环评图件制作-数据处理+图件制作
leetcode.1 --- 两数之和
[web] cookies and sessions
Google Chrome browser reports an error: net:: err_ BLOCKED_ BY_ CLIENT
Call C function in Lua
单片机:PCF8591 应用程序
随机推荐
单片机信号发生器程序
2022 spring semester summary
USB-IF BC1.2充电协议解读
解答私信@田田WX //2022-6-12 C语言 51单片机LED模拟交通灯
Real time question answering of single chip microcomputer / embedded system
[Yugong series] June 2022 Net architecture class 081 API customization task of distributed middleware schedulemaster
Lambda end operation collect
JSTL -- JSP standard tag library
Uni app enables pull-up loading and pull-down refresh (pull-down with animation)
ROS话题与节点
十億數據量 判斷元素是否存在
Modeling discussion series 143 data processing, analysis and decision system development
Data analysis report
Manage PC startup items
单片机:A/D(模数转换)的主要指标
Call C function in Lua
How can a sweeping robot avoid obstacles without "mental retardation"? Analysis of five mainstream obstacle avoidance techniques
knife4j aggregation 2.0.9支持路由文档自动刷新
1.4.2 Capital Market Theroy
Advanced Mathematics (Seventh Edition) Tongji University exercises 1-2 personal solutions