实战手把手带你从0到1搭建自己的hugo博客站点(持续更新)

动漫百科时间:2024-04-27 16:15:07点击:65
前置条件

如果你想拥有一个心可以栖身的地方,那么就来和我一起搭建一个属于自己的博客平台,在这里,你可以随心所欲!

1、什么是hugo1.hugo官网

至此,hugo的环境变量就配置好了,我们打开cmd,输入hugo查看是否有效果:

有成果输出,表示hugo安装正常。

3.本地预览1.创建本地站点根目录

自己来到D:\目录下,然后输入如下命令,进行创建本地站点根目录:

$hugonewsite!YournewHugositeisinD:\.Justafewmoreandyou'retogo:1.aintothesame-.ayourownwiththe"hugonew".2.youwanttoaddsome.Youcanadd"hugonew\.".3.the-inlivevia"hugo".forandfull.hg@-/d$cd/hg@-/d/$ls/./data/////hg@-/d/
2.下载hugo主题

⚠️因为hugo没有内置主题,所以你需要去下载一个:

hg@-/d/$git/into'/meme'...::5583,done.::100%(740/740),done.::100%(289/289),done.:5583(507),451(451),pack-4843:100%(5583/5583),9.31MiB|12.59MiB/s,done.:100%(3086/3086),done.hg@-/d/$rm.tomlcp/meme/-/en/.toml.toml
3.创建第一个测试文件
hg@-/d/$hugonewpost/."D:\\\\\\post\\.md"@-/d/$echo"iloveyou,xyyhurt!"/post/.md
git--user.name"hg"git--user."@qq.com"
$ssh-Tgit@.com
:""date:2023-05-:["hugo"]:["hugo"]

🍀但有的主题,需要把.toml给替换掉,例如meme主题:

hg@-/d/$git/memeinto'/meme'...::5583,done.::100%(740/740),done.::100%(289/289),done.:5583(507),451(451),pack-4843:100%(5583/5583),9.31MiB|12.59MiB/s,done.:100%(3086/3086),done.hg@-/d/$rm.tomlcp/meme/-/en/.toml.toml
📍hugo命令

💧查看hugo版本

PSD:\hugov0.98.0-+/=2023-04-:23:30Z=

💧创建本地站点根目录

$hugonewsite!YournewHugositeisinD:\.Justafewmoreandyou'retogo:1.aintothesame-.ayourownwiththe"hugonew".2.youwanttoaddsome.Youcanadd"hugonew\.".3.the-inlivevia"hugo".forandfull.hg@-/d$cd/hg@-/d/$ls/./data/////hg@-/d/
最后

好了,关于玩转hugo实验就到这里了,感谢大家阅读,最后贴上我女神的,祝大家生活欢愉,每天都过的有意义哦,我们下期见!

lov

推荐内容