Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: how to create a blog post #3285

Merged
merged 44 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
456ce72
docs: How o create a blog post
StackScribe Mar 18, 2024
1fbf9b4
markdown, spell errors
StackScribe Mar 18, 2024
80447c2
add words to expect
StackScribe Mar 18, 2024
623ab2f
more markdown fixes
StackScribe Mar 18, 2024
3a21948
yet more markdown fixes
StackScribe Mar 18, 2024
f9f86ca
xref
StackScribe Mar 18, 2024
2086853
fixes
StackScribe Mar 18, 2024
ffabf2e
indents
StackScribe Mar 18, 2024
fdf6585
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
335c629
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
4c0750b
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
0703dff
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
c8a6bb9
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
47caf16
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
378b919
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
1638d2f
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
23e57d3
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
9e302c6
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
0459516
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
6e7c214
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
7f1d380
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
c838e3b
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
9f2fe72
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
3ab6f34
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
360de3c
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
c6cbc11
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
64f8f23
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
91f5eb6
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
3628030
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
57f0bb4
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
810c968
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
bb2c17b
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
5b562ad
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
0c0c31e
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
42b7771
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
f09ba42
Add more line to synopsis of front matter
StackScribe Mar 19, 2024
23cfcfe
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
1279cb2
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 19, 2024
4f2556b
docs/blog/.authors.yml
StackScribe Mar 19, 2024
f5b4166
identeifer
StackScribe Mar 19, 2024
21bd478
more identifier
StackScribe Mar 19, 2024
7e9b54e
rework blog-title information
StackScribe Mar 20, 2024
c41cb05
Update docs/docs/contribute/docs/blog.md
StackScribe Mar 21, 2024
0f552d3
Update docs/docs/contribute/docs/blog.md
odubajDT Mar 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ GOBIN
gocognit
gocyclo
gofmt
GOGC
golangci
gomega
gomod
Expand Down Expand Up @@ -415,6 +416,7 @@ multigroup
mutatingwebhookconfigurations
mwc
mwh
myblog
mycert
mydata
myhost
Expand Down Expand Up @@ -460,6 +462,7 @@ operatorvalue
optionskeptnsh
ossf
otel
otelcol
otelprom
otelsdk
otelurl
Expand Down Expand Up @@ -539,6 +542,7 @@ runsendevent
runtimes
runtimespec
Sambhav
sampleuser
sbom
schedulinggates
sclient
Expand All @@ -553,6 +557,7 @@ sendserviceaccount
serrors
serviceaccount
serviceaccountspec
serviceapp
serviceport
setuptools
Shandilya
Expand Down Expand Up @@ -686,6 +691,3 @@ Yash
yml
YOURNAME
yourregistry
GOGC
otelcol
serviceapp
205 changes: 205 additions & 0 deletions docs/docs/contribute/docs/blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
---
comments: true
---

# Blogs

Blogs are authored in markdown,
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
submitted and reviewed as PRs,
published as part of the "Documentation" web site,
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
and built using the same tools and GitHub practices
as other documentation.
However, you must take a few additional steps when writing a blog.
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

Keptn uses the
[blog plugin from mkdocs-material](https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/)
to manage the blog infrastructure.
To integrate your blog with the blog plugin,
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
you must also do the following:

* Create an entry in the `docs/blog/.authors.yml` file
for each author of the blog.
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

* The GitHub user ID used to identify yourself
in the `docs/.authors.yml` file
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
must be added to the `.github/actions/spelling/expect.txt` file
so that the spell checker knows about it.
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

* Blog source is added to the `docs/blog/posts` directory.
Individual blogs are not listed in the `mkdocs.yaml` file
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
like other documentation.
Instead, the blog plugin manages integration of all blogs
with source in the `blogs` directory.
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

* Additional metadata is required as part of the source files's front matter.
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

Each of these requirements is discussed on this page.

## Populate docs/blog/.authors.yml file

The value of the `authors:` field in the blog's front matter
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
links to an entry in the `blogs/authors.yml` file.
odubajDT marked this conversation as resolved.
Show resolved Hide resolved
The blog plugin uses this information to render author information
on the blog page.
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

The basic fields that we require are documented here.
For information about additional fields that are available, see the mkdocs
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
[authors_file](https://squidfunk.github.io/mkdocs-material/plugins/blog/#config.authors_file).
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

```yaml
authors:
...
<GitHub-UserID>:
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
name: <Fullname>
description: <Role>
avatar: <avatar-for-picture>
url: <Github-URL-for-user>
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
```

### author.yml fields
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

* **GitHub-UserID** -- This is the user ID used to log into GitHub.
it serves as a key for the record.
* **name:** -- Your first and last name
as it should appear in the posted blog
* **description:** Your role as it should appear in the posted blog.
For example, "Keptn Maintainer", "Keptn Contributor", "Keptn User",
your role in another project or title at a company
with the name of the project or company..
* **avatar:** URL for the picture to use in blog posts.
To use the same picture you use on GitHub,
open the image in a new tab and use the URL displayed in the address bar.
* **url:** -- URL for your record on GitHub.
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

### authors.yml example

```yaml
authors:
...
sampleuser:
name: Sample User
description: Senior Software Developer, Example, Inc.
avatar: https://avatars.githubusercontent.com/u/...
url: https://github.com/sampleuser
```

## Update spelling/expect.txt file with your ID

The spell checker will flag your user ID as an unrecognized word.
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
You can manually add this string to the
`.github/actions/spelling/expect.txt` file
as part of your PR,
although the easiest way to handle this is to push your PR
then resolve the error as discussed on the
[Spell Checker](spell-check.md)
page.

## Blog source code
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

Your blog should be developed using the standard Git
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
flow documented in
[Working with Git](../general/git/index.md).
When you have created a local branch:

* Create a .md file in the `docs/blog/posts` directory.
Give the file a meaningful name;
remember that many people from different organizations
may be contributing to this directory.

You do not need to modify the `mkdocs.yml` file for your blog.

* If your blog has graphics, screen shots, YAML files, etc.
that will be included,
create an `assets` subdirectory for those files
in a subdirectory that has the same name
as the root name of your .md file.
For example, if your source file is named `myblog.md`
(which is not actually detailed enough to be a good file name),
you need to create a myblog/assets subdirectory.
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

* Follow the instructions in
[Blog front matter](#blog-front-matter)
to provide the metadata required by the blog plugin.

* The text that follows the `#` line until the first `##` line
is the introduction to your article
and also the abstract that is displayed on the "Blogs" landing page.
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

Other coding notes for blogs:

* Blog posts are considered part of the MkDocs NAV path.
This means that:

* Use the practices documented in
[External links and internal cross-references](code-docs.md/#external-links-and-internal-cross-references)
for your blog.
* You can use a local build to render your blog locally as you write.
See
[Build documentation locally](local-building.md)
for details.
* The `readthedocs.build` preview associated with your PR
contains the rendered version of your blog
so that you and your reviewers can see it.

## Blog front matter

The blog plugin requires some information to manage the blog.
This is specified as part of the file's metadata.
Here we document the fields that are required.
Additional fields can be added; see the
[blog plugin documentation](https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/#writing-your-first-post)
for more information.

```md
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
---
date: YYYY-MM-DD
authors: [<GitHub-UserID>]
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
description: >
<Brief description of this blog, all in one source line>
categories:
- <cat-1>
- <cat-2>
- ...
comments: true
---

# <blog title>
```

### Blog front matter fields

* **date** -- Date when blog was most recently posted
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
* **authors** -- Author of this blog,
identified by the Github User ID that is used as the key
in the `docs/blog/.authors.yml` file.
This is used to generate the author information
that is displayed.
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
* **description: >** -- Brief description
* **categories:** -- Keywords used to generate entries in the "Categories"
section of the "Blogs" landing page.
Set as many categories as appropriate and use reasonable terminology.
If an existing category matches a category you want for your blog,
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
be sure to match that terminology exactly.
For example, "Installation" is an existing category
so it would be inappropriate to define "Installing" as a category.
* **comments: true**
* **blog-title** -- The title that is displayed for your blog,
coded as a level 1 (`#`) header.
mowies marked this conversation as resolved.
Show resolved Hide resolved

### Front matter example

```md
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
---
date: 2024-02-01
authors: [sampleuser]
description: >
This blog details how to integrate Keptn with MyTool.
categories:
- SRE
- Analysis
- MyTool
comments: true
---

# Using Keptn with MyTool
```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ nav:
- Source File Structure: docs/contribute/docs/source-file-structure.md
- Coding the docs: docs/contribute/docs/code-docs.md
- Spell Checker: docs/contribute/docs/spell-check.md
- Blogs: docs/contribute/docs/blog.md
- Published Doc Structure: docs/contribute/docs/publish.md
- Word list: docs/contribute/docs/word-list.md
- Blog:
Expand Down