Error message here!

Hide Error message here!

忘记密码?

Error message here!

请输入正确邮箱

Hide Error message here!

密码丢失?请输入您的电子邮件地址。您将收到一个重设密码链接。

Error message here!

返回登录

Close

Installing and configuring Hugo

wangwei830 2022-01-23 13:10:15 阅读数:8 评论数:0 点赞数:0 收藏数:0


title: “ Installation configuration hugo”
date: 2021-12-05T12:50:03+08:00
draft: true


Initial configuration

Download from the official website

https://github.com/gohugoio/hugo/releases

Download directory :

C:\Users\Administrator\go\src\HugoMyblog

Installation configuration

Unpack the installation

View version

root@wangwei830:/opt/blog# ./hugo version
hugo v0.89.4-AB01BA6E linux/amd64 BuildDate=2021-11-17T08:24:09Z VendorInfo=gohugoio

establish myblog Table of contents and supporting documents :

root@wangwei830:/opt/blog# hugo new site myblog
Congratulations! Your new Hugo site is created in /opt/blog/myblog.
Just a few more steps and you're ready to go:
1. Download a theme into the same-named folder.
Choose a theme from https://themes.gohugo.io/ or
create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".
Visit https://gohugo.io/ for quickstart guide and full documentation.

Adjust catalog :

Cut the extracted command file to myblog Under the table of contents

Download the template :

root@wangwei830:/opt/blog# 
cd /opt/blog/myblog/themes
git clone https://themes.gohugo.io/themes/hugo-theme-learn/

Local startup service :

root@wangwei830:/opt/blog/myblog# hugo server -t hugo-theme-learn --buildDrafts
Start building sites …
hugo v0.89.4-AB01BA6E linux/amd64 BuildDate=2021-11-17T08:24:09Z VendorInfo=gohugoio
| EN
-------------------+-----
Pages | 7
Paginator pages | 0
Non-page files | 0
Static files | 75
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0
Built in 55 ms
Watching for changes in /opt/blog/myblog/{
archetypes,content,data,layouts,static,themes}
Watching for config changes in /opt/blog/myblog/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

Create a new article

C:\Users\Administrator\go\src\HugoMyblog\hugo_0.89.4_Windows-64bit\myblog> .\hugo.exe new post/ Installation configuration hugo.md

Then write the content of the article

Site hosting

Create a warehouse with the same name as the user

 Simple command line tutorial :
Git Global settings :
git config --global user.name " Wang Wei "
git config --global user.email "wangwei198484@163.com"
establish git Warehouse :
mkdir wangwei830
cd wangwei830
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/wangwei830/wangwei830.git
git push -u origin master
There are warehouses ?
cd existing_git_repo
git remote add origin https://gitee.com/wangwei830/wangwei830.git
git push -u origin master

Binding address

After binding the address, a pbulic Folder

PS C:\Users\Administrator\go\src\HugoMyblog\hugo_0.89.4_Windows-64bit\myblog> .\hugo.exe --theme=hugo-theme-learn --baseUrl="https://wangwei830.github.io/" --buildDrafts
Start building sites …
hugo v0.89.4-AB01BA6E windows/amd64 BuildDate=2021-11-17T08:24:09Z VendorInfo=gohugoio
.File.UniqueID on zero object. Wrap it in if or with: {
{
 with .File }}{
{
 .UniqueID }}{
{
 end }}
| EN
-------------------+-----
Pages | 10
Paginator pages | 0
Non-page files | 0
Static files | 75
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0
Total in 543 ms
PS C:\Users\Administrator\go\src\HugoMyblog\hugo_0.89.4_Windows-64bit\myblog>

push public The contents of the catalog

cd public
git init
git add .
git commit -m "20211205"
git remote add origin https://gitee.com/wangwei830/wangwei830.git
git push -u origin master

Warehouse open Pages service

I need my ID card

Visit blog

wangwei830.git.io

Use

Update article content

cd C:\Users\Administrator\go\src\HugoMyblog\hugo_0.89.4_Windows-64bit\myblog
.\hugo.exe --theme=hugo-theme-learn --baseUrl="https://wangwei830.github.io/" --buildDrafts

Publish new articles

cd C:\Users\Administrator\go\src\HugoMyblog\hugo_0.89.4_Windows-64bit\myblog
.\hugo.exe new post/ Installation configuration hugo.md
.\hugo.exe --theme=hugo-theme-learn --baseUrl="https://wangwei830.github.io/" --buildDrafts

Update the template

cd C:\Users\Administrator\go\src\HugoMyblog\hugo_0.89.4_Windows-64bit\myblog\themes
git clone https://themes.gohugo.io/themes/hugo-book/
git clone https://github.com/alexandrevicenzi/soho

The new template starts the local blog service

cd C:\Users\Administrator\go\src\HugoMyblog\hugo_0.89.4_Windows-64bit\myblog
.\hugo.exe server -t soho --buildDrafts

Catalog design

cd C:\Users\Administrator\go\src\HugoMyblog\hugo_0.89.4_Windows-64bit\myblog
# operating system 
.\hugo.exe new Linux/init.md
.\hugo.exe new Aix/init.md
.\hugo.exe new HPUX/init.md
.\hugo.exe new Windows/init.md
# database 
.\hugo.exe new Mysql/init.md
.\hugo.exe new Postgres/init.md
.\hugo.exe new Oracle/init.md
.\hugo.exe new Tidb/init.md
.\hugo.exe new DB2/init.md
.\hugo.exe new Informix/init.md
# Development 
.\hugo.exe new Python/init.md
.\hugo.exe new Golang/init.md
.\hugo.exe new Csharp/init.md
.\hugo.exe new Shell/init.md
# unclassified 
.\hugo.exe new Other/init.md
# Home page 
.\hugo.exe new _index.md
.\hugo.exe new Linux//init.md
.\hugo.exe new Linux//init.md
.\hugo.exe new Linux//init.md
.\hugo.exe new Linux//init.md
.\hugo.exe new Linux//init.md
.\hugo.exe new Linux//init.md
.\hugo.exe new Linux//init.md
.\hugo.exe new Linux//init.md
.\hugo.exe new Linux//init.md
.\hugo.exe new Linux//init.md
.\hugo.exe new Linux//init.md
.\hugo.exe new Linux//init.md
.\hugo.exe new Linux//init.md
.\hugo.exe new Linux//init.md
Copyright statement
In this paper,the author:[wangwei830],Reprint please bring the original link, thank you