Understanding Sitemap

In this video we learn about `sitemap`
`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:
-- fastn.sitemap:

# Section: 

## SubSection: 

- TOC-1: 
- TOC-2: 
- SubTOC-2-1: 
- SubTOC-2-2: 

...
Lang:
ftd
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`.
## Autumn: /season/autumn/

## Spring: /season/spring/

## Summer: /season/summer/

## Winter: /season/winter/
Lang:
ftd

TOCs

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.
- Sunrise: /season/day-event/sunrise/
- Sunset: /season/day-event/sunset/
Lang:
ftd
and so on, you can give any number of TOCs and even sub-TOCs to the sections or subsections.
# Home: /

# Season: /season/summer/


## Autumn Season: /season/autumn/

- Sunrise: /season/day-event/sunrise/
- Sunset: /season/day-event/sunset/

## Spring Season: /season/spring/

- Sunrise: /season/day-event/sunrise/
- Today's News: /season/day-event/news/rained/
- Sunset: /season/day-event/sunset/

## Summer Season: /season/summer/

- Sunrise: /season/day-event/sunrise/
- Sunset: /season/day-event/sunset/

## Winter Season: /season/winter/

- Sunrise: /season/day-event/sunrise/
- Sunset: /season/day-event/sunset/
Lang:
ftd
The URLs can be cleaned and customized by using the `document feature` of sitemap.
# Home: /

# Season: /current-season/
document: /season/summer.ftd


## Autumn: /autumn/
document: /season/autumn.ftd

- Sunrise: /sunrise-in-autumn/
document: /season/day-event/sunrise.ftd
- Sunset: /sunset-in-autumn/
document: /season/day-event/sunset.ftd

## Spring: /spring/
document: /seasons/spring.ftd

- Sunrise: /sunrise-in-spring/
document: /season/day-event/sunrise.ftd
- Today's News: /news-of-the-day/
document: /season/day-event/news/rained.ftd
- Sunset: /sunset-in-spring/
document: /season/day-event/sunset.ftd

## Summer: /summer/
document: /season/summer.ftd

- Sunrise: /sunrise-in-summer/
document: /season/day-event/sunrise.ftd
- Sunset: /sunset-in-summer/
document: /season/day-event/sunset.ftd

## Winter: /winter/
document: /season/winter.ftd

- Sunrise: /sunrise-in-winter/
document: /season/day-event/sunrise.ftd
- Sunset: /sunset-in-winter/
document: /season/day-event/sunset.ftd
Lang:
ftd
To know all about this feature you can checkout the video about [`How to create clean URLs`](/expander/sitemap-document).
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/).

Support `fastn`!

Enjoying `fastn`? Please consider giving us a star ⭐️ on [GitHub](https://github.com/fastn-stack/fastn) to show your support!
[⭐️](https://github.com/fastn-stack/fastn)

Getting Help

Have a question or need help? Visit our [GitHub Q&A discussion](https://github.com/fastn-stack/fastn/discussions/categories/q-a) to get answers and subscribe to it to stay tuned. Join our [Discord](https://discord.gg/a7eBUeutWD) channel and share your thoughts, suggestion, question etc. Connect with our [community](/community/)!
[💻️](/community/)

Found an issue?

If you find some issue, please visit our [GitHub issues](https://github.com/fastn-stack/fastn/issues) to tell us about it.

Quick links:

- [Install `fastn`](install/) - [Create `fastn` package](create-fastn-package/) - [Expander Crash Course](expander/) - [Syntax Highlighting in Sublime Text](/sublime/)

Join us

We welcome you to join our [Discord](https://discord.gg/a7eBUeutWD) community today. We are trying to create the language for human beings and we do not believe it would be possible without your support. We would love to hear from you.
Copyright © 2023 - [FifthTry.com](https://www.fifthtry.com/)