ramlife

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  261 随笔 :: 110 文章 :: 15 评论 :: 47万 阅读

安装 go

先在 https://go.dev/doc/install 下载压缩包,然后进行安装

rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.5.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version

后面还需要修改 bashrc,修改环境变量。

安装 hugo

sudo snap install hugo

quickstart

生成一个最简单的网页

hugo new site quickstart
cd quickstart
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
echo "theme = 'ananke'" >> config.toml
hugo server

第一个测试文章

  • 生成
hugo new posts/my-first-post.md
  • 修改, vim content/posts/my-first-post.md 添加以下内容
## Introduction

This is **bold** text, and this is *emphasized* text.

Visit the [Hugo](https://gohugo.io) website!
  • 因为上面是草稿,想要看到草稿需要允许草稿启动 hugo server --buildDrafts 或者 hugo server -D

配置文件修改

config.toml 这个里面可以修改网站基本的一些设置。

生成

hugo 就可以生成所需文件,放在 public 文件夹下。 可以浏览器打开这个文件夹下的 index.html 来查看。

参考:

Download and install
https://go.dev/doc/install

Install Hugo on Linux.
https://gohugo.io/installation/linux/

gohugo-theme-ananke
https://github.com/theNewDynamic/gohugo-theme-ananke

Basic usage
https://gohugo.io/getting-started/usage/#draft-future-and-expired-content

Quick Start
https://gohugo.io/getting-started/quick-start/

posted on   ramlife  阅读(213)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示