📝 Upgrade the README.md file.

This commit is contained in:
elkan1788 2025-01-30 16:10:45 +08:00
parent 86e8ee7e7d
commit 13d9ad7f32
2 changed files with 46 additions and 22 deletions

View File

@ -35,6 +35,18 @@
Before use `Hugo NexT` theme, please make sure installed `Git` & `Hugo Extened` software in your PC.
### 📦 Install Hugo
If you want to quickly preview the actual effect of the theme, you can directly clone the repository code of the current theme and run the example site:
```shell
$ git clone --single-branch -b main https://github.com/hugo-next/hugo-theme-next.git hugo-theme-next
$ cd hugo-theme-next/exampleSite/
$ sh startup.sh
```
Open a computer browser and enter `http://127.0.0.1:1414/`, then you can access and view it.
### 📰 Use Template
If there your first time build blog site, Recommended use template of `Github` which can easily create your site code. Click & visit this repository: [hugo-theme-next-starter](https://github.com/hugo-next/hugo-theme-next-starter), then click the green button which name call `Use this template` upper right corner on the page. Just like below image:
@ -48,26 +60,26 @@ After do that click the green button which name call `Create repository from tem
If you had a blog site, then use `submodule` to lead into the theme, see below commands:
```shell
$ cd hugo-next-exmaple
$ cd hugo-next-example
$ git submodule add https://github.com/hugo-next/hugo-theme-next.git themes/hugo-theme-next
$ cp themes/hugo-theme-next/exampleSite/config.yaml .
$ mv config.toml config.toml.backup
$ cp themes/hugo-theme-next/exampleSite/hugo.yaml .
$ mv hugo.toml hugo.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
$ cd hugo-next-example
$ hugo mod init hugo-next-example
$ wget -O hugo.yaml https://github.com/hugo-next/hugo-theme-next/raw/main/exampleSite/hugo.yaml
$ sed -i 's/hugo-theme-next/github.com\/hugo-next\/hugo-theme-next\/v4/' hugo.yaml
$ mv hugo.toml hugo.toml.backup
```
### 💻 Preview on Local
```shell
$ cd hugo-next-exmaple
$ cd hugo-next-example
$ hugo server
```
@ -81,14 +93,14 @@ Done that input adrress http://127.0.0.1:1313/ on browser will see the effect &
Execute command as below in your site directory when the theme upgrade.
```shell
$ cd hugo-next-exmaple
$ cd hugo-next-example
$ git submodule update --remote
```
Execute command as below if you are using `Hugo module`:
```shell
$ cd hugo-next-exmaple
$ cd hugo-next-example
$ hugo mod get -u
```

View File

@ -35,6 +35,18 @@
在使用 `Hugo NexT` 主题之前,请确认你的电脑上已经安装 `Git``Hugo Extened` 两款软件。
### 📦 快速预览
如想快速预览主题实际效果,可直接克隆当前主题的仓库代码,然后运行示例站点:
```shell
$ git clone --single-branch -b main https://github.com/hugo-next/hugo-theme-next.git hugo-theme-next
$ cd hugo-theme-next/exampleSite/
$ sh startup.sh
```
打开电脑浏览器输入`http://127.0.0.1:1414/`即可访问查看。
### 📰 使用模板
如果你是初次建站的话,可以使用 `Github` 的模板功能,一键生成你的站点仓库代码。访问 [hugo-theme-next-starter](https://github.com/hugo-next/hugo-theme-next-starter) 点击右上角的 `Use this template` 绿色按钮然后填写代码仓库的相关信息,参考如下:
@ -48,26 +60,26 @@
如果你已经有站点,可通过 `submodule` 模式引用本主题,参考如下命令:
```shell
$ cd hugo-next-exmaple
$ cd hugo-next-example
$ git submodule add https://github.com/hugo-next/hugo-theme-next.git themes/hugo-theme-next
$ cp themes/hugo-theme-next/exampleSite/config.yaml .
$ mv config.toml config.toml.backup
$ cp themes/hugo-theme-next/exampleSite/hugo.yaml .
$ mv hugo.toml hugo.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
$ cd hugo-next-example
$ hugo mod init hugo-next-example
$ wget -O hugo.yaml https://github.com/hugo-next/hugo-theme-next/raw/main/exampleSite/hugo.yaml
$ sed -i 's/hugo-theme-next/github.com\/hugo-next\/hugo-theme-next\/v4/' hugo.yaml
$ mv hugo.toml hugo.toml.backup
```
### 💻 本地预览
```shell
$ cd hugo-next-exmaple
$ cd hugo-next-example
$ hugo server
```
@ -81,14 +93,14 @@ $ hugo server
后续更新主题只需要在你的站点目录中,执行如下命令:
```shell
$ cd hugo-next-exmaple
$ cd hugo-next-example
$ git submodule update --remote
```
如使用 `Hugo module`,执行如下命令:
```shell
$ cd hugo-next-exmaple
$ cd hugo-next-example
$ hugo mod get -u
```