Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lopins committed Oct 30, 2024
0 parents commit a9f5e02
Show file tree
Hide file tree
Showing 1,581 changed files with 59,866 additions and 0 deletions.
Empty file added .gitattributes
Empty file.
48 changes: 48 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: GitHub Pages - CI

on:
push:
paths-ignore:
- "images/**"
- "LICENSE"
- "README.md"
- "README_**"
- "README-**"
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
ref: main
submodules: true
fetch_depth: 1
persist-credentials: false

- name: Setup Hugo 🔧
uses: peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
extended: true

- name: Build 🔧
run: |
hugo --buildDrafts --gc --logLevel info --minify
- name: Deploy 🚀
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages # default: gh-pages
publish_dir: ./public # default: public
# cname: github.com
# user_name: 'github-actions[bot]'
# user_email: 'github-actions[bot]@users.noreply.github.com'
# commit_message: ${{ github.event.head_commit.message }}
# full_commit_message: ${{ github.event.head_commit.message }}
# enable_jekyll: true
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.DS_Store
Thumbs.db
db.json
*.log
node_modules/
public/
.deploy*/
.hugo_build.lock
_multiconfig.yml
package-lock.json
yarn.lock

# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so

# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

*.exe
*.test
Empty file added .gitmodules
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 awesome-actions-template

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
107 changes: 107 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<div align="right">
<a href="README_CN.md">中文</a> | <strong>English</strong>
</div>

<img src="https://cdn.fosstodon.org/accounts/avatars/111/137/925/464/599/407/original/5a723b0c04db75a8.png" alt="Hugo logo" width="100" height="100" align="right" />

<div align="center">

<h1> Hugo Template </h1>

<p>A fast and flexible static site generator built with love by bep, spf13, and friends in <a href="https://go.dev/">Go</a>.</p>

</div>

<hr/>

<div align="center">
<a href="https://themes.gohugo.io">Demo</a> |
<a href="https://gohugo.io">Official</a> |
<a href="https://gohugo.io/documentation/">Docs</a> |
<a href="https://discourse.gohugo.io">Community</a>
</div>

<hr/>

## Get Started

### Define Domain

Change the `baseURL` in `config.yml` or `config.toml` to your site's URL

```yml
baseURL: "https://lopins.github.io/hugo-template"
```
### [Configure Theme](https://github.com/lopins/hugo-template/issues/2)
1. pull theme into `themes/` and update it.

`git submodule add git@github.com:zhaohuabing/hugo-theme-cleanwhite.git themes/cleanwhite && git submodule update --init --recursive`

`cp -r exampleSite/* ../`

2. In `config.yml` or `config.toml`, change the value of the `theme` property to "cleanwhite"

~~3. update `editPost: "https://github.com/lopins/hugo-template/tree/main/content"` in `config.yml` or `config.toml`~~

### Push to Github

`git add . && git commit -m ':wrench:docs(themes): Add or update configuration files' && git push origin main`

### [Publish Article](https://github.com/lopins/hugo-template/issues/1)

1. Install

Click "Use this template" -> "Create a new repository"

![1. Create a new repository](https://github.com/user-attachments/assets/1046f118-8c2a-4ed8-bc8b-1258941455c4)

2. Set up

Set up and enable GitHub Pages service

![2. Set up GitHub Pages branch](https://github.com/user-attachments/assets/acd90bfd-0a25-4809-a39b-fc5d562f414b)

3. Publish

Publish an article on the "hugo branch" of Github.

![3. Write or Upload an Markdown file](https://github.com/user-attachments/assets/2b1a97ea-ac79-4647-a340-f71569699c11)

## Notice

### **Submodule** to Change Theme

```
# Add Submodule - Upadte Submodule
git submodule add git@github.com:zhaohuabing/hugo-theme-cleanwhite.git themes/cleanwhite
git submodule update --init --recursive

# Delete Submodule
git submodule deinit -f themes/cleanwhite
rm -rf .git/modules/themes/cleanwhite
rm -rf themes/cleanwhite
git config --remove-section submodule.themes/cleanwhite
git config -f .gitmodules --remove-section submodule.themes/cleanwhite
git rm --cached themes/cleanwhite
git add . && git commit -m 'Update .gitmodules before removing submodule'


# Display Submodule - Pull Submodule - Sync Submodule
git submodule status
git submodule foreach git pull origin main
git submodule sync
```
### Permission
If you meet the problem like `remote: Permission to xxx denied to github-actions[bot].`
When you push your changes, you need to give the permission to the `github-actions[bot]` in your repo's.
By following the steps below: `Settings -> Actions -> General -> Workflow permissions -> Read and write permissions -> Save`.
## License
[MIT License](LICENSE).
107 changes: 107 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<div align="right">
<strong>中文</strong> | <a href="README.md">English</a>
</div>

<img src="https://cdn.fosstodon.org/accounts/avatars/111/137/925/464/599/407/original/5a723b0c04db75a8.png" alt="Hugo logo" width="100" height="100" align="right" />

<div align="center">

<h1> Hugo Template </h1>

<p>一个由bep、spf13和其好友基于<a href="https://go.dev/">Go</a>构建的快速灵活的静态站点生成器框架。 这是它的模板。</p>

</div>

<hr/>

<div align="center">
<a href="https://themes.gohugo.io">演示</a> |
<a href="https://gohugo.io">官网</a> |
<a href="https://gohugo.io/documentation/">文档</a> |
<a href="https://discourse.gohugo.io">社区</a>
</div>

<hr/>

## 快速开始

### 修改域名

修改 `config.yml` 或者 `config.toml` 中的 `baseURL`

```yml
baseURL: "https://lopins.github.io/hugo-template"
```
### [配置主题](https://github.com/lopins/hugo-template/issues/2)
1. 拉取主题并进入 `themes/` 并更新相关信息

`git submodule add git@github.com:zhaohuabing/hugo-theme-cleanwhite.git themes/cleanwhite && git submodule update --init --recursive`

`cp -r exampleSite/* ../`

2. 在 `config.yml` 或者 `config.toml` 修改 `theme` 属性值为 "cleanwhite"`

~~3. 在 `config.yml` 或者 `config.toml` 修改 `editPost: "https://github.com/lopins/hugo-template/tree/main/content"`~~
### 应用配置
`git add . && git commit -m ':wrench:docs(themes): Add or update configuration files' && git push origin main`

### [发布文章](https://github.com/lopins/hugo-template/issues/1)

1. 启用站点

点击 "Use this template" -> "Create a new repository"

![1. Create a new repository](https://github.com/user-attachments/assets/1046f118-8c2a-4ed8-bc8b-1258941455c4)

2. 配置站点

设置并且启用 GitHub Pages 服务

![2. Set up GitHub Pages branch](https://github.com/user-attachments/assets/acd90bfd-0a25-4809-a39b-fc5d562f414b)

3. 发布文章

发布文章在 `hugo` 分支。

![3. Write or Upload an Markdown file](https://github.com/user-attachments/assets/2b1a97ea-ac79-4647-a340-f71569699c11)

## 特别注意

### 使用 **Submodule** 切换主题

```
# Add Submodule - Upadte Submodule
git submodule add git@github.com:zhaohuabing/hugo-theme-cleanwhite.git themes/cleanwhite
git submodule update --init --recursive

# Delete Submodule
git submodule deinit -f themes/cleanwhite
rm -rf .git/modules/themes/cleanwhite
rm -rf themes/cleanwhite
git config --remove-section submodule.themes/cleanwhite
git config -f .gitmodules --remove-section submodule.themes/cleanwhite
git rm --cached themes/cleanwhite
git add . && git commit -m 'Update .gitmodules before removing submodule'


# Display Submodule - Pull Submodule - Sync Submodule
git submodule status
git submodule foreach git pull origin main
git submodule sync
```
### 权限问题
如果你遇到类似 `remote: Permission to xxx denied to github-actions[bot].`
当你推送更改时,你需要设置仓库的 `github-actions[bot]` 权限.
设置步骤: `Settings -> Actions -> General -> Workflow permissions -> Read and write permissions -> Save`.
## 开源协议
[MIT License](LICENSE).
69 changes: 69 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
baseURL = 'https://www.wooooden.com/'
languageCode = 'zh-CN'
title = '装配师'

theme = 'huishou'

enableRobotsTXT = true
paginate = 5 #frontpage pagination
preserveTaxonomyNames = true
hasCJKLanguage = true

[outputs]
home = ['html', 'rss']
section = ['html', 'rss']
taxonomy = ['html']
term = ['html']

[permalinks]
posts = "/news/:slug/"

[params]
# contentTypeName = "posts"
phoneNumber = '185-1668-7118'
companyName = '佳匠实业'
companyAddress = '上海市松江区石湖荡镇石湖新路95号'
companyStart = '2018'
companyBeian = '沪ICP备2021004498号'

[menu]
[[menu.main]]
identifier = "home"
name = "首页"
url = "/"
weight = 1
[[menu.main]]
identifier = "product"
name = "产品中心"
url = "/product/"
weight = 2
[[menu.main]]
identifier = "case"
name = "案例中心"
url = "/case/"
weight = 3
[[menu.main]]
identifier = "esg"
name = "ESG理念"
url = "/esg/"
weight = 4
[[menu.main]]
identifier = "news"
name = "行业资讯"
url = "/news/"
weight = 5
[[menu.main]]
identifier = "about"
name = "关于我们"
url = "/about/"
weight = 6
[[menu.main]]
identifier = "kefu"
name = "联系我们"
url = "/kefu/"
weight = 7

[module]
[module.hugoVersion]
extended = true
min = "0.125.0"
Loading

0 comments on commit a9f5e02

Please sign in to comment.