`Sitemap` is used to create a structured representation of the files and pages
that make up a website. This structure is created over a layout which we will
talk about in a bit.
By creating a comprehensive sitemap, website owners and visitors can gain a
clear understanding of the website's structure and easily navigate through its
content. It ensures that visitors can find the information they need
efficiently.
Why `sitemap`?
Just like a college library needs to organise their shelves, books in an
order based on cateogry or genre.
Similarly, in a package, we want to organise the documents in different
sections, subsections and TOCs.
`Sitemap` serves as a blueprint or roadmap, providing information about the
organization and hierarchy of content on the website.
How to configure `sitemap` for your site
We create the sitemap in the `FASTN.ftd`. So, we write:
and after a line space
- for `sections` we use `#`
- for `subsections` we use `##`, and
- for `TOCs` and `sub-TOCs` we use `-`
In all the three cases, whatever written before colon is displayed as the title
on webpage and whatever is written after colon, becomes the URL to access it.
First section
We put our first section like, hash for section, home as section name and URL:
# Home: /
Lang:
ftd
Section `Home` is displayed on the webpage, which displays the content of
`index.ftd` document. The URL `/` corresponds to `index.ftd` document.
Whereas, any document other than `index.ftd` file we need to write something
after `/`. For example, there is a file `foo.ftd`, then to access the foo
document, we need to write, `/foo/`.
Second section
Let's add another section.
# Season: /season/summer/
Lang:
ftd
The URL is the path of the document. Inside folder season, there is a document
called `summer.ftd`.
Subsections
Let's give some subsections to this section `season`.
Similarly, we can add TOCs.
TOCs start with single dash or hyphen `-`, followed by TOC title before colon
and after the colon, as usual, the URL.
Also note, between TOCs we do not give a line space.
To know all about this feature you can checkout the video about
[`How to create clean URLs`](/clean-urls/).
Thank you guys, keep watching these videos to learn more about fastn.
Support us by giving a star ⭐ on
[GitHub](https://github.com/fastn-stack/fastn/) and join our fastn community
on [Discord](/discord/).