Documentation/content/improving-documentation/create-article.md
Jan Klippel 5bdac45ee5 Create a new section documentation
Extract important articles from the now lengthy FAQ.
This helps to find the documented basics.
Move the Docs-Contributor-FAQ to the new documentation section.
2022-04-14 12:34:58 +02:00

1.9 KiB

eleventyNavigation
key title parent order
CreateANewArticle How to create a new article? ImprovingTheDocumentation 10

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.

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.

It can look like this:

---
eleventyNavigation:
  key: WhatIsCodeberg
  title: What is Codeberg?
  parent: GettingStarted
  order: 10
---

## Foo
Hello foo!

## Bar
Hello bar!

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.

The other fields are title and order, where

  • 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).

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.

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.

Please do not repeat the article's title as a first-level heading in Markdown. It will added automatically when generating the final site.