2022-04-13 04:18:00 -07:00
|
|
|
---
|
|
|
|
|
eleventyNavigation:
|
|
|
|
|
key: CreateANewArticle
|
|
|
|
|
title: How to create a new article?
|
|
|
|
|
parent: ImprovingTheDocumentation
|
|
|
|
|
order: 10
|
|
|
|
|
---
|
|
|
|
|
|
2025-06-14 02:38:21 -07:00
|
|
|
To write a new article, create a new Markdown file next to the existing files in the section that you want to put your
|
|
|
|
|
article in. So, if for example you want to create an article called "Keeping your repo clean with .gitignore" in the
|
|
|
|
|
"Working with Git Repositories" section, put a new file called for example `gitignore.md` into the `content/git` directory.
|
|
|
|
|
Please adhere to the [file naming conventions](/improving-documentation/docs-contributor-faq#how-should-files-be-named%3F).
|
2022-04-13 04:18:00 -07:00
|
|
|
|
2025-06-14 02:38:21 -07:00
|
|
|
Then, add the `eleventyNavigation` header to your newly created file.
|
|
|
|
|
That header contains information about the article's place in the structure of the site.
|
2022-04-13 04:18:00 -07:00
|
|
|
|
|
|
|
|
It can look like this:
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
---
|
|
|
|
|
eleventyNavigation:
|
|
|
|
|
key: WhatIsCodeberg
|
|
|
|
|
title: What is Codeberg?
|
|
|
|
|
parent: GettingStarted
|
|
|
|
|
order: 10
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Foo
|
|
|
|
|
Hello foo!
|
|
|
|
|
|
|
|
|
|
## Bar
|
|
|
|
|
Hello bar!
|
|
|
|
|
```
|
|
|
|
|
|
2025-06-14 02:38:21 -07:00
|
|
|
Every section and article has a unique `key`. If `parent` is set to the `key` of another section, the current article
|
|
|
|
|
will become a child of that other section.
|
2022-04-13 04:18:00 -07:00
|
|
|
|
|
|
|
|
The other fields are `title` and `order`, where
|
|
|
|
|
|
2025-06-14 02:38:21 -07:00
|
|
|
- `title` is merely a display name and determines the menu entry label as well as the article's heading but has no other
|
|
|
|
|
"technical" semantics and
|
|
|
|
|
- `order` is a number that can be used to enforce a specific order of articles (which is good for step-by-step guides
|
|
|
|
|
such as Getting Started for example).
|
2022-04-13 04:18:00 -07:00
|
|
|
|
2025-06-14 02:38:21 -07:00
|
|
|
So to create a new article, find the `key` of your desired parent section in its Markdown source code and use it as the
|
|
|
|
|
`parent` for your new article.
|
2022-04-13 04:18:00 -07:00
|
|
|
|
2025-06-14 02:38:21 -07:00
|
|
|
After the header is in place, you can now start writing your article in Markdown. It is recommended to add a blank line
|
|
|
|
|
after the header's trailing three dashes.
|
2022-04-13 04:18:00 -07:00
|
|
|
|
2023-11-26 21:45:00 -08:00
|
|
|
{% admonition "warning" %}
|
|
|
|
|
|
2025-06-14 02:38:21 -07:00
|
|
|
Please do not repeat the article's title as a first-level heading in Markdown. It will added automatically when
|
|
|
|
|
generating the final site.
|
2023-11-26 21:45:00 -08:00
|
|
|
|
|
|
|
|
{% endadmonition %}
|