Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .hugo_build.lock
Empty file.
82 changes: 53 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
# k0s Team Blog — Adding a post (Hugo)
# The Zero Friction Kubernetes Blog

This repo powers the k0s team blog using [Hugo](https://gohugo.io/). If you can open a PR, you can publish a post.
The repository that powers the [k0sproject community blog][blog] static site.
Built with [Hugo] and the [PaperMod] theme. If you can open a pull request, you
can publish a post.

[blog]: https://blog.k0sproject.io/
[Hugo]: https://gohugo.io/
[PaperMod]: https://github.com/adityatelange/hugo-PaperMod

## Quick start

1. Create a new post (Hugo leaf bundle with its own folder):
1. Create a new post (Hugo "leaf bundle" with its own folder):

```sh
hugo new content/posts/my-post-title/index.md
```
```sh
hugo new content/posts/my-post-title/index.md
```

2. Open the generated file and fill in front matter (see below).
3. Add any images/files into the **same folder** as the post (e.g., `content/posts/my-post-title/diagram.png`).
4. Preview locally:

```sh
hugo server -D
```
3. Add any images/files into the **same folder** as the post (e.g.,
`content/posts/my-post-title/diagram.png`).

5. When ready to publish, set `draft: false` and open a PR.
4. Preview locally:

---
```sh
hugo server -D
```

5. When ready to publish, set `draft: false` and open a pull request.

## Front matter (copy–paste)

Expand All @@ -44,52 +51,66 @@ cover:

Write Markdown content **below** the front matter.

**Notes**
Additional notes:

* `date` is ISO-8601; use UTC or your local time.
* Leave `draft: true` while iterating; change to `false` to publish.
* Use `tags`/`categories` that already exist where possible.
* If the `summary` is omitted, the first paragraph in the article will be used as summary.

---
* If the `summary` is omitted, the first paragraph in the article will be used
as summary.

## Images & media

* Keep assets **inside the posts folder** (leaf bundle).
* Keep assets **inside the post's folder** (leaf bundle).
Example tree:

```
```text
content/blog/my-post-title/
├─ index.md
├─ cover.png
└─ diagram.png
```

* Reference them with relative paths:

```md
![Control plane layout](./diagram.png)
```

* Optional Hugo figure shortcode:

```md
{{< figure src="diagram.png" caption="Control plane layout" >}}
```

* Aim for small files (<1 MB). Add meaningful alt text.

---
## Local development

Prerequisites:

## Local preview
* Git (for cloning the repository and its submodule)
* Hugo **extended** version (0.120.0 or newer recommended)

```sh
hugo server -D
git clone https://github.com/k0sproject/blog.git blog.k0sproject.io
cd blog.k0sproject.io
git submodule update --init --recursive
```

* `-D` shows drafts.
* Visit the URL Hugo prints and verify formatting, links, code blocks, and images.
Start a live-reloading development server (Hugo watches for changes and
refreshes the browser automatically):

---
```sh
hugo server --buildDrafts --buildFuture
```

Visit <http://localhost:1313/> to preview the site. This approach ensures assets
such as CSS are served correctly; loading `public/index.html` directly from the
filesystem will usually miss theme assets because the site is built with the
production `baseURL`.

## Pull Request checklist
## Pull request checklist

* [ ] `title`, `date`, `author`, `summary` set
* [ ] `draft: false` for publishing
Expand All @@ -98,11 +119,14 @@ hugo server -D
* [ ] No broken relative paths
* [ ] Post matches the tone and headings of existing posts

---

## Conventions

* **File/folder name**: use-kebab-case (`my-post-title`)
* **Code blocks**: use fenced blocks with language hints (e.g., `sh`, `yaml`)
* **Internal links**: prefer relative links within the repo
* **Internal links**: prefer relative links within the repository

## License

Content and configuration are distributed under the Creative Commons
Attribution-ShareAlike 4.0 International license. See `LICENSE` for the
full text.
20 changes: 20 additions & 0 deletions assets/css/extended/social-icons.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.custom-icon-social-k0sproject {
display: inline-flex;
align-items: center;
}

.custom-icon-social-k0sproject > span {
display: inline-flex;
}

.custom-icon-social-k0sproject .icon-dark {
display: none;
}

body.dark .custom-icon-social-k0sproject .icon-light {
display: none;
}

body.dark .custom-icon-social-k0sproject .icon-dark {
display: inline-flex;
}
14 changes: 8 additions & 6 deletions hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
baseURL: https://blog.k0sproject.io/
languageCode: en
title: k0s - The Kubernetes Distribution
title: The Zero Friction Kubernetes Blog
theme: PaperMod
enableRobotsTXT: true
markup:
highlight:
noClasses: false
copyright:
copyright: >-
Copyright &copy; 2023 k0sproject a Series of LF Projects, LLC.
For website terms of use, trademark policy and other project policies please see [Linux Foundation policies](https://lfprojects.org/policies/).
- All rights reserved.
Expand All @@ -17,13 +17,15 @@ params:
showCodeCopyButtons: true
showShareButtons: true
descriptions: true
author: k0s team
author: k0sproject authors
homeInfoParams:
Title: k0s - The Kubernetes Distribution
Content: The Official Blog of k0s Community
Title: The Zero Friction Kubernetes Blog
Content: Official blog of the k0sproject community
socialIcons:
- name: Website
- name: k0s
url: https://k0sproject.io
- name: k0smotron
url: https://k0smotron.io
- name: GitHub
url: https://github.com/k0sproject
- name: X
Expand Down
21 changes: 21 additions & 0 deletions layouts/partials/social_icons.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<div class="social-icons" {{ with .align }}align="{{ . }}" {{- end }}>
{{- range site.Params.socialIcons }}
{{- $icon := trim .name " " | lower -}}
<a href="{{ trim .url " " | safeURL }}" target="_blank" rel="noopener noreferrer me"
title="{{ (.title | default .name) | title }}">
{{- if eq $icon "k0s" -}}
<span class="custom-icon custom-icon-social-k0sproject">
<span class="icon-light">{{- partial "svg/k0s-logo-light.svg" . -}}</span>
<span class="icon-dark">{{- partial "svg/k0s-logo-dark.svg" . -}}</span>
</span>
{{- else if eq $icon "k0smotron" -}}
<span class="custom-icon custom-icon-social-k0sproject">
<span class="icon-light">{{- partial "svg/k0smotron-logo-light.svg" . -}}</span>
<span class="icon-dark">{{- partial "svg/k0smotron-logo-dark.svg" . -}}</span>
</span>
{{- else -}}
{{- partial "svg.html" . -}}
{{- end -}}
</a>
{{- end }}
</div>
14 changes: 14 additions & 0 deletions layouts/partials/svg/k0s-logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions layouts/partials/svg/k0s-logo-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions layouts/partials/svg/k0smotron-logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions layouts/partials/svg/k0smotron-logo-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.