静态页面快速搭建神器HUGO
August 7, 2019
标题不搞个UPPER_CASE
彷佛不能显示出雨果的官威。
狂 #
我赌你没见过哪个框架,敢在他们官网首页正中,写下这样一句话?
The world’s fastest framework for building websites
Preface #
I’m not going to translate this sharing, since the words above sums it up in its entirety.
跑得比记者还快 #
假定你是python的环境,那么
pip install hugo
雨果你就安装好了。
hugo new site name
没有前戏环境直接搭建完毕。name即目录名。
Congratulations! Your new Hugo site is created in D:\lamzed.
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.
到官网找个你心水的theme
,扒拉下来,摆到对应目录,
敲下hugo new blog01.md
,然后vim
进去一顿输出,
接着hugo server
啪的一下很快网站就推出去了。
星剖 #
雨果提供了许多不错的主题,simple星剖
就是让你不动脑筋。
lamzed's page
使用的就是他们的一个叫book
的极简风格theme
。
但要是套个前端组件,或者稍微客制化下,你的站点可能会酷炫许多。
抛瓦 #
简单却power抛瓦
,或者dio
。就说部署这点,简直无敌。
部署速度 #
它的部署速度
贼™快,总能让我high
到不行。
就是我的指头敲击回车的一刹那,甚至行程都还没走完——
还来不及听到那令人愉悦的段落声响,我眼前的终端就已经执行完了全部命令:
黑乎乎的窗口显示简单的数字和字母,
13ms
,这四个字符组合起来,真让我着迷。
热部署 #
平平无奇的卖点,只是千不该万不该让上一秒还在用tomcat
汤姆猫的我
下一秒和hugo
雨果相遇。
change detected, rebuilding site.
也就total in 3ms
而已。
响应式 #
嗯,对于博客站点来说,这玩意是真香。
课代表发言 #
总的来说,雨果的抛瓦包含以下三点。是个极其适合静态页面快速搭建的框架。
1. 部署快,它让开发编程的爽了
2. 热部署,它让写稿搬砖的爽了
3. 响应式,它让围观白嫖的爽了
安利完了撒花 #
这是
lamzed的奇妙页面
的第一篇blog
,没技术含量,就随笔来的。
对工作时长超过两年半的架构师们来说, 雨果也不过是个小孩玩具一样的东西。
可但是——
既然我选择了雨果搭建自己的博客,那我肯定要稍微吹一下它啊。吹爆!
2021.2.13 改,删了废话。这个日期,新年哟~
彩蛋福利 #
或者,你也可以直接阅读
Getting Started with Hugo
和
Creating a New Theme
这两份文档。
不带翻译的绝好阅读材料
!wink~