1- # k0s Team Blog — Adding a post (Hugo)
1+ # The Zero Friction Kubernetes Blog
22
3- This repo powers the k0s team blog using [ Hugo] ( https://gohugo.io/ ) . If you can open a PR, you can publish a post.
3+ The repository that powers the [ k0sproject community blog] [ blog ] static site.
4+ Built with [ Hugo] and the [ PaperMod] theme. If you can open a pull request, you
5+ can publish a post.
6+
7+ [ blog ] : https://blog.k0sproject.io/
8+ [ Hugo ] : https://gohugo.io/
9+ [ PaperMod ] : https://github.com/adityatelange/hugo-PaperMod
410
511## Quick start
612
7- 1 . Create a new post (Hugo “ leaf bundle” with its own folder):
13+ 1 . Create a new post (Hugo " leaf bundle" with its own folder):
814
9- ``` sh
10- hugo new content/posts/my-post-title/index.md
11- ```
15+ ``` sh
16+ hugo new content/posts/my-post-title/index.md
17+ ```
1218
13192 . Open the generated file and fill in front matter (see below).
14- 3 . Add any images/files into the ** same folder** as the post (e.g., ` content/posts/my-post-title/diagram.png ` ).
15- 4 . Preview locally:
1620
17- ``` sh
18- hugo server -D
19- ```
21+ 3 . Add any images/files into the ** same folder** as the post (e.g.,
22+ ` content/posts/my-post-title/diagram.png ` ).
2023
21- 5 . When ready to publish, set ` draft: false ` and open a PR.
24+ 4 . Preview locally:
2225
23- ---
26+ ``` sh
27+ hugo server -D
28+ ```
29+
30+ 5 . When ready to publish, set ` draft: false ` and open a pull request.
2431
2532## Front matter (copy–paste)
2633
@@ -44,52 +51,66 @@ cover:
4451
4552Write Markdown content ** below** the front matter.
4653
47- ** Notes **
54+ Additional notes:
4855
4956* ` date ` is ISO-8601; use UTC or your local time.
5057* Leave ` draft: true ` while iterating; change to ` false ` to publish.
5158* Use ` tags ` /` categories ` that already exist where possible.
52- * If the ` summary ` is omitted, the first paragraph in the article will be used as summary.
53-
54- ---
59+ * If the ` summary ` is omitted, the first paragraph in the article will be used
60+ as summary.
5561
5662## Images & media
5763
58- * Keep assets ** inside the post’ s folder** (leaf bundle).
64+ * Keep assets ** inside the post' s folder** (leaf bundle).
5965 Example tree:
6066
61- ```
67+ ``` text
6268 content/blog/my-post-title/
6369 ├─ index.md
6470 ├─ cover.png
6571 └─ diagram.png
6672 ```
73+
6774* Reference them with relative paths:
6875
6976 ``` md
7077 
7178 ```
79+
7280* Optional Hugo figure shortcode:
7381
7482 ``` md
7583 {{< figure src="diagram.png" caption="Control plane layout" >}}
7684 ```
85+
7786* Aim for small files (<1 MB). Add meaningful alt text.
7887
79- ---
88+ ## Local development
89+
90+ Prerequisites:
8091
81- ## Local preview
92+ * Git (for cloning the repository and its submodule)
93+ * Hugo ** extended** version (0.120.0 or newer recommended)
8294
8395``` sh
84- hugo server -D
96+ git clone https://github.com/k0sproject/blog.git blog.k0sproject.io
97+ cd blog.k0sproject.io
98+ git submodule update --init --recursive
8599```
86100
87- * ` -D ` shows drafts.
88- * Visit the URL Hugo prints and verify formatting, links, code blocks, and images.
101+ Start a live-reloading development server (Hugo watches for changes and
102+ refreshes the browser automatically):
89103
90- ---
104+ ``` sh
105+ hugo server --buildDrafts --buildFuture
106+ ```
107+
108+ Visit < http://localhost:1313/ > to preview the site. This approach ensures assets
109+ such as CSS are served correctly; loading ` public/index.html ` directly from the
110+ filesystem will usually miss theme assets because the site is built with the
111+ production ` baseURL ` .
91112
92- ## Pull Request checklist
113+ ## Pull request checklist
93114
94115* [ ] ` title ` , ` date ` , ` author ` , ` summary ` set
95116* [ ] ` draft: false ` for publishing
@@ -98,11 +119,14 @@ hugo server -D
98119* [ ] No broken relative paths
99120* [ ] Post matches the tone and headings of existing posts
100121
101- ---
102-
103122## Conventions
104123
105124* ** File/folder name** : use-kebab-case (` my-post-title ` )
106125* ** Code blocks** : use fenced blocks with language hints (e.g., ` sh ` , ` yaml ` )
107- * ** Internal links** : prefer relative links within the repo
126+ * ** Internal links** : prefer relative links within the repository
127+
128+ ## License
108129
130+ Content and configuration are distributed under the Creative Commons
131+ Attribution-ShareAlike 4.0 International license. See ` LICENSE ` for the
132+ full text.
0 commit comments