---
weight: 100
date: "2023-05-03T22:37:22+01:00"
draft: false
author: "Colin Wilson"
title: "Démarrage rapide"
icon: "rocket_launch"
toc: true
description: "Un guide qui rapide pour créer un nouveau contenu dans Lotus Docs"
publishdate: "2023-05-03T22:37:22+01:00"
tags: ["Beginners"]
---

## Créer un nouveau contenu

Navigate to the root of your Hugo project and use the `hugo new` command to create a file in the `content/docs` directory:

```shell
hugo new docs/example-page.md
```

This will create a markdown file named `example-page.md` with the following default front matter:

```toml
+++
title = "Example Page"
description = ""
icon = "article"
date = "2023-05-22T00:27:57+01:00"
lastmod = "2023-05-22T00:27:57+01:00"
draft = false
toc = true
weight = 999
+++
```

Modify the options to suit your needs.

The code below shows the front matter code used to create this page, along with some markdown in the body:

```md
+++
weight = 100
date = "2023-05-03T22:37:22+01:00"
draft = true
author = "Colin Wilson"
title = "Quickstart"
icon = "rocket_launch"
toc = true
description = "A quickstart guide to creating new content in Lotus Docs"
publishdate = "2023-05-03T22:37:22+01:00"
tags = ["Beginners"]
+++

## Create New Content

Navigate to the root of your Hugo project and use the `hugo new` command to create a file in the `content/docs` directory:

    ```shell
    hugo new docs/examplepage.md
    ```
...
```

## Ordering Content

Lotus Docs uses a simple weighting method for ordering content and creating menus.

The front matter `weight` variable is used to order all content and auto-generate the menu structure (including the sidebar menu and page navigation buttons). Lower weight values take higher precedence. So content with lower weights come first and are so ordered in the menu.

## Auto-Generated Menu

As mentioned, Lotus Docs auto-generates menus and navigation links using the [front matter](https://gohugo.io/content-management/front-matter/#predefined) weight variable. For example, Navigate to the `content/docs` directory and create two content files, `doc-one.md` and `doc-two.md`, then edit the weight values to `100` and `200` respectively:

{{< alert text="It's good practice to increment the weight of your posts by a factor of <code>100</code>. This ensures plenty of room to insert new posts between existing items should you need to." />}}

Your directory structure should now look like this:

```treeview
content/
└── docs/
    ├── doc-one.md
    └── doc-two.md
```

Links to both posts are now visible in the sidebar menu where `doc-one.md` will come before and be placed above `doc-two.md`:

![sidebar menu items example](https://res.cloudinary.com/lotuslabs/image/upload/v1684719173/Lotus%20Docs/images/sidebar_menu_example_01-modified_qkb2si.png)

{{< alert context="info" text="The option to manually arrange content via a predefined menu structure in <code>hugo.toml</code> as opposed to auto-generated via content weights is on the Lotus Docs roadmap." />}}

## Second Level Menu Items

Second level menu items can be generated by first creating a **'parent'** directory containing an `_index.md` file, e.g.:

```shell
hugo new docs/parent-directory/_index.md
```

The above command creates a directory named `parent-directory` under `content/docs`:

```treeview
content/
└── docs/
    └── parent-directory/
```

You can now create second level items inside the `parent-directory` as normal. Run the `hugo new` command again to create a post inside the newly created `parent-directory`:

```shell
hugo new docs/parent-directory/doc-three.md
```

Your directory/file structure should now look like this:

```treeview
content/
└── docs/
    └── parent-directory/
        └── doc-three.md
```

This is reflected in the sidebar menu with `parent-directory` acting as a dropdown menu containing a link to the **Doc Three** post:

![sidebar parent menu example](https://res.cloudinary.com/lotuslabs/image/upload/v1684802032/Lotus%20Docs/images/sidebar_menu_example_02_jsecye.png)