Skip to content

Commit 0f02894

Browse files
committed
init
0 parents  commit 0f02894

File tree

127 files changed

+6030
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+6030
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Hugo build lock file
2+
.hugo_build.lock
3+
4+
# Hugo generated files and directories
5+
/public/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "themes/PaperMod"]
2+
path = themes/PaperMod
3+
url = https://github.com/adityatelange/hugo-PaperMod.git

archetypes/default.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
+++
2+
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
3+
date = {{ .Date }}
4+
draft = true
5+
+++
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
title: "簡單、快速、美觀:如何用 Hugo 打造專屬部落格 (一):撰寫你的第一篇文章"
3+
date: 2024-09-28T00:27:05+08:00
4+
draft: true
5+
cover:
6+
image: "images/hugo_blog_image.png"
7+
alt: "Hugo Blog"
8+
caption: "The world’s fastest framework for building websites" #
9+
---
10+
11+
# 為什麼選 Hugo?
12+
13+
市面上各種部落格琳瑯滿目,例如 Wordpress、Medium、Blogger、方格子、痞客邦等等。 我選擇 [Hugo](https://gohugo.io/) 作為架站工具的原因有幾點:
14+
15+
- 完全免費
16+
- 編輯簡單快速
17+
- 100% 不受站方管制
18+
- 佈景主題不錯看
19+
20+
# Hugo 是什麼?
21+
22+
Hugo 是用 Go 做的一個靜態網站生成器,它方便編輯且介面簡潔,發布也非常迅速。 你可以在筆電 (本地端) 任意創作並隨時預覽成果。
23+
24+
[Markdown](https://hackmd.io/@eMP9zQQ0Qt6I8Uqp2Vqy6w/SyiOheL5N/%2FBVqowKshRH246Q7UDyodFA?type=book)是它主要撰寫文章的格式。 如果你沒接觸過,可以點連結看介紹,我通常是用到才查。
25+
26+
你想加強個人品牌或風格,Hugo 社群亦有豐富的[佈景主題](https://themes.gohugo.io/)。看不慣你也可以自己改,寫一些程式碼即可。
27+
28+
# 安裝 Hugo 到 Mac
29+
30+
安裝步驟真的非常簡單,只需下幾個指令就可完成。 安裝過程會用到 [brew](https://brew.sh/)[git](https://github.com/),沒用過它們的話,建議先去安裝和申請帳號。
31+
32+
## 1. 下載 Hugo
33+
34+
開啟你的 `terminal`,並輸入以下指令
35+
36+
```
37+
brew install hugo
38+
```
39+
40+
## 2. 建立新 Blog
41+
42+
安裝完成後,我們立即可以使用下方指令建立一個新的 blog。`--format yaml` 不是必要條件,它的作用僅是把設定檔改成 `yaml` 格式
43+
44+
```
45+
hugo new site blog --format yaml
46+
```
47+
48+
成功執行後,你會得到一個 `blog` 的資料夾。 接著請進入資料夾
49+
50+
```
51+
cd blog
52+
```
53+
54+
## 3. 下載佈景主題
55+
56+
![Hugo Themes](/images/hugo_themes.png)
57+
58+
[佈景主題](https://themes.gohugo.io/)裡面挑選你中意的主題,點進去主題裡,找到下載指令並輸入。 下載方式有好幾種,但我覺得直接用`submodule`即可,例如我選 **PaperMod**,它指令長這樣。下載成功後,你會發現 themes 資料夾底下跑出主題的名字
59+
60+
```
61+
git submodule add --depth=1 https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod
62+
```
63+
64+
接著找到 `hugo.yaml` 檔案,設定主題
65+
66+
```
67+
baseURL: https://example.org/
68+
languageCode: en-us
69+
title: Your Blog Name
70+
theme: PaperMod
71+
```
72+
73+
# 產生第一篇文章
74+
75+
產生文章的指令很簡單,請參考以下格式:
76+
77+
```
78+
hugo new posts/你的文章標題.md
79+
80+
```
81+
82+
輸入後,它會在 `content` 的資料夾產生 `posts/你的文章標題.md` 文章。 大概長這樣
83+
84+
```
85+
---
86+
title: '簡單、快速、美觀:如何用 Hugo 打造專屬部落格 (一):撰寫你的第一篇文章'
87+
date: 2024-09-28T00:27:05+08:00
88+
draft: true
89+
---
90+
```
91+
92+
接著請再輸入以下指令,讓我們把 hugo 跑起來。
93+
94+
```
95+
hugo server -D
96+
```
97+
98+
成功跑起來的話,你會看到在訊息中看到 `http://localhost:1313/` 的預覽網址。 請在瀏覽器輸入網址,便可以獲得一個即時預覽的部落格 (本地端)。 你修改存檔的內容,它立即重新編譯並顯示。
99+
100+
![預覽部落格](/images/preview_blog.png)
101+
102+
# 小結
103+
104+
在本篇文章中,我們介紹了如何用 Hugo 安裝並啟動一個基本的部落格網站,也介紹如何設定佈景主題,以及建立文章。
105+
106+
在接下來的文章中,我們將進一步了解如何發布你的第一篇部落格文章,讓我們繼續探索吧!

hugo.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
baseURL: https://example.org/
2+
languageCode: zh-TW
3+
title: BC
4+
theme: PaperMod
5+
6+
params:
7+
homeInfoParams:
8+
Title: "Hi there \U0001F44B"
9+
Content: Welcome to my blog
10+
11+
socialIcons:
12+
- name: LinkedIn
13+
url: "https://www.linkedin.com/in/bc-lee/"
14+
- name: github
15+
url: "https://github.com/onenight"

static/images/hugo_blog_image.png

1.52 MB
Loading

static/images/hugo_themes.png

2.86 MB
Loading

static/images/preview_blog.png

3.36 MB
Loading
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Bug Report 🐞
2+
description: Create a report to help us improve
3+
title: "[Bug]: "
4+
labels: ["bug", "triage"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out this bug report :)
10+
- Kindly **DO NOT** ask for instructions.
11+
- Use [Discussions](https://github.com/adityatelange/hugo-PaperMod/discussions) section if you have a query or doubts or any orther relevant question.
12+
- You may join [Discord community](https://discord.gg/ahpmTvhVmp) to interact with fellow contributors and users
13+
- Read project's [Wiki](https://github.com/adityatelange/hugo-PaperMod/wiki) for detailed documentation.
14+
- Read project's [FAQs](https://github.com/adityatelange/hugo-PaperMod/wiki/FAQs) section for Frequently asked questions.
15+
- Search for previous [Issues](https://github.com/adityatelange/hugo-PaperMod/issues)/[Pull Requests](https://github.com/adityatelange/hugo-PaperMod/pulls) if this issue is already reported or fix has been created.
16+
- type: textarea
17+
id: what_happened
18+
attributes:
19+
label: What happened?
20+
description: Also tell us, what did you expect to happen?
21+
placeholder: A bug happened! Here are the screenshots.. Tell us what you see!
22+
validations:
23+
required: true
24+
- type: textarea
25+
id: steps_to_reproduce
26+
attributes:
27+
label: Steps to reproduce
28+
description: How to reproduce this issue. Here are the steps...
29+
placeholder: |
30+
1. Go to '...'
31+
2. Click on '....'
32+
3. Scroll down to '....'
33+
4. See error
34+
validations:
35+
required: true
36+
- type: dropdown
37+
id: hugo_version
38+
attributes:
39+
label: Hugo Version
40+
description: What version of Hugo are you running?
41+
options:
42+
- Hugo >= 0.112.4 (Recommended - Minimum version required for PaperMod)
43+
- Hugo < 0.112.4 (Incompatible - Not recommended to build PaperMod on lower verions)
44+
validations:
45+
required: true
46+
- type: input
47+
id: papermod_version
48+
attributes:
49+
label: PaperMod Version
50+
description: What version of PaperMod are you running?
51+
placeholder: |
52+
PaperMod v7.0 or
53+
Branch master or
54+
Commit-id: 3f50861a0ced88f9b614a43662edeb4c0bc45da8
55+
validations:
56+
required: true
57+
- type: dropdown
58+
id: browser_type
59+
attributes:
60+
label: What kind of devices are you seeing the problem on?
61+
multiple: true
62+
options:
63+
- Mobile
64+
- Desktop
65+
validations:
66+
required: false
67+
- type: dropdown
68+
id: browsers
69+
attributes:
70+
label: What browsers are you seeing the problem on?
71+
multiple: true
72+
options:
73+
- Firefox
74+
- Chrome
75+
- Safari
76+
- Microsoft Edge
77+
validations:
78+
required: false
79+
- type: input
80+
id: browser_version
81+
attributes:
82+
label: Browser Version
83+
description: Please add browser version or enter user agent string (navigator.userAgent)
84+
placeholder: ex. Google Chrome 86.0
85+
validations:
86+
required: false
87+
- type: textarea
88+
id: logs
89+
attributes:
90+
label: Relevant log output
91+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
92+
render: shell
93+
validations:
94+
required: true
95+
- type: input
96+
id: repo_url
97+
attributes:
98+
label: Repository/Source Code link where this issue can be reproduced
99+
description: Please add url of the repository where this issue can be reproduced
100+
placeholder: https://github.com/<username>/<repo name>
101+
validations:
102+
required: false
103+
- type: checkboxes
104+
id: terms
105+
attributes:
106+
label: Code of Conduct
107+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/adityatelange/hugo-PaperMod?tab=coc-ov-file#readme).
108+
options:
109+
- label: I agree to follow this project's Code of Conduct
110+
required: true
111+
validations:
112+
required: true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: PaperMod Discussions
4+
url: https://github.com/adityatelange/hugo-PaperMod/discussions
5+
about: Please ask and answer questions/doubts here, DO NOT open an issue for questions.

0 commit comments

Comments
 (0)