If you read the previous section carefully, you know that content is in sites/mysite/pages
Content if a collection of folder and pages in mardown format.
Home content is at root pages folder. We name it generally home.md
Then, we can create as many folders as we want.
I invite you to visit content of sites/examples/pages folder. Sometimes an example is worth a thousand words.
This is an example of my website structure (a little simplified) :
pages
|
|____ blog
| |
| |___ article-a
| | |
| | |____ page.md
| |
| |___ article-b
| |
| |____ page.md
|
|____ mes-projets
| |
| |____ page.md
|
|____ mes-prestations
| |
| |____ page.md
|
|
|____ me-suivre
| |
| |____ page.md
|
|
|____ on-parle-de-mon-travail
| |
| |____ page.md
|
|
|____ fruga
| |
| |____ doc
| |
| |____ en
| |
| |____ introduction
| | |
| | |____ page.md
| |
| |____ get-started
| | |
| | |____ page.md
| |
| |____ indexdocfr.md
|____ mentions-legales
| |
| |____ page.md
|
|
|____ politique-de-confidentialite
| |
| |____ page.md
|
|
|_____ home.md
Folders
Website structure depends of the folders.
By default, they'll even automatically define the URL to access the resource. (it's possible to overwrite this behavior).
For example, to access "get-started" at the end of the branch "fruga", the URL is : /fruga/doc/en/get-started
It's also possible to preceded by a counter. For example. Par exemple "01.introduction", "02.get-started". This counter won't appear in URL but will allow manual sorting for a listing page for example. In fact, that's what's done here.
Markdown files
Markdown files are for extension .md and must be into folders.
For now, only one .md files can be in a directory.
You've probably notice they don't have always the same name. We can see home.md, page.md, indexdocfr.md in my example.
This name will make a link with the template.
For example, all my blog pages, my informations pages use "page" template. If you take a look at https://yoandemacedo.com/mes-projets/ or https://yoandemacedo.com/blog/pourquoi-site-statique/, you'll see they have the same structure.
The page listing all sections of Fruga's documentation use "indexdocen" template.
Home page uses "home" template.
In next section, we'll take a look at how templates work.
Now, take a look at mardown content.
My homepage, home.md, starts like that :
---
title: 'Yoan De Macedo'
---
Passionné par le web depuis mes débuts sur la toile avec mon modem 33.6k, j'en ai fait mon métier.
First section is delimited by 3 dashes, then a line break. It's the file header.
Second section is the content of the page. This content can use markdown.
Different keywords can be used in the first section. You'll able to use it in templates.
A predifined list exists (it's bound to evolve) :
We'll see how to use it in templates.
Let's focus on "slug" keyword. I explained earlier how the URL to access a page is generated via the path that leading to it (folder names).
It's possible to overwrite it.
If add this in the header of indexdocen.md :
slug: 'english'
then the page won't be acessible with /fruga/doc/en/get-started/ anymore but /fruga/doc/english/get-started/
You can add other keyword as you want then use it in templates.
If you're unfamiliar with mardown, you'll find interesting information here : https://www.markdownguide.org/basic-syntax/
(Sorry for the sometimes approximate English. If you want me to correct something, please contact me.)