Merge pull request #113 from WaterLemons2k/module Closed#70

Support Golang Module
This commit is contained in:
凡梦星尘 2023-08-21 10:35:19 +08:00 committed by GitHub
commit f59fca14f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 38 additions and 1 deletions

View File

@ -53,6 +53,16 @@ $ cp themes/hugo-theme-next/exampleSite/config.yaml .
$ mv config.toml config.toml.backup
```
Or use `Hugo module` to lead into the theme, see below commands:
```shell
$ cd hugo-next-exmaple
$ hugo mod init hugo-next-exmaple
$ wget -O config.yaml https://github.com/hugo-next/hugo-theme-next/raw/main/exampleSite/config.yaml
$ sed -i 's/hugo-theme-next/github.com\/hugo-next\/hugo-theme-next\/v4/' config.yaml
$ mv config.toml config.toml.backup
```
### 💻 Preview on Local
```shell
@ -74,6 +84,13 @@ $ cd hugo-next-exmaple
$ git submodule update --remote
```
Execute command as below if you are using `Hugo module`:
```shell
$ cd hugo-next-exmaple
$ hugo mod get -u
```
## 📝 New Post
There had ready a new post template for you, It is recommended to use the following Hugo command to quickly create a new post:

View File

@ -52,6 +52,16 @@ $ cp themes/hugo-theme-next/exampleSite/config.yaml .
$ mv config.toml config.toml.backup
```
或通过 `Hugo module` 模式引用本主题,参考如下命令:
```shell
$ cd hugo-next-exmaple
$ hugo mod init hugo-next-exmaple
$ wget -O config.yaml https://github.com/hugo-next/hugo-theme-next/raw/main/exampleSite/config.yaml
$ sed -i 's/hugo-theme-next/github.com\/hugo-next\/hugo-theme-next\/v4/' config.yaml
$ mv config.toml config.toml.backup
```
### 💻 本地预览
```shell
@ -73,6 +83,13 @@ $ cd hugo-next-exmaple
$ git submodule update --remote
```
如使用 `Hugo module`,执行如下命令:
```shell
$ cd hugo-next-exmaple
$ hugo mod get -u
```
> **Note**
> 本主题的代码同时也同步到 `Gitee` 仓库,在国内环境可切换用 [https://gitee.com/hugo-next/hugo-theme-next.git](https://gitee.com/hugo-next/hugo-theme-next.git) 镜像速度更快,也更稳定。

View File

@ -153,7 +153,6 @@ menus:
pageref: /post/math-formula.html
weight: 2
parent: example
parent: example
- identifier: syntax
name: 语法高亮
pageref: /post/syntax-highlighting.html

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module github.com/hugo-next/hugo-theme-next/v4
go 1.11

1
hugo-theme-next.go Normal file
View File

@ -0,0 +1 @@
package hugothemenext

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 996 KiB

After

Width:  |  Height:  |  Size: 973 KiB