Skip to content

Commit

Permalink
More default pages content into an include and add to Page config docs
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreymcgill committed Jul 24, 2023
1 parent 4111a7b commit 13f745f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
17 changes: 17 additions & 0 deletions _includes/snippets/default-pages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Folder default pages are **.md** files that will be treated as the index (default) page of the folder.

Retype will search using the following case insensitive priority:

1. `index.md`
2. `readme.md`
3. `default.md`
4. `welcome.md` *only in the project root

Within a sub-folder, if you add a Markdown **.md** file with the exact same name as the folder name, Retype will also treat that `.md` as a default page. For instance, given the following basic project structure, the **/sample/sample.md** file will function as a default page for the folder. The result will be the same as though you named it **/sample/index.md**:

```
sample
|-- sample.md
readme.md
retype.yml
```
4 changes: 4 additions & 0 deletions configuration/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ order: 100
This is a sample page demonstrating page metadata.
```

## Default pages

{{ include "snippets/default-pages.md" }}

## Separate .yml file

If you would prefer to keep the page metadata separated and placed outside of the **.md** content page, the config can be moved into a paired **.yml** file.
Expand Down
11 changes: 1 addition & 10 deletions configuration/reserved_words.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,7 @@ If you manually create a **CNAME** file within the root of the [input](/configur

### Default pages

Folder default pages are custom **.md** files that will be treated as the index page of the folder.

Retype will search using the following case insensitive priority:

1. `index.md`
2. `readme.md`
3. `default.md`
4. `welcome.md` *only in the project root

For instance, creating a the file **docs/index.md** will create a custom page accessible from the path `https://example.com/docs/`. The **index.md** page instructs Retype to create an **index.html** file within the **docs/** folder.
{{ include "snippets/default-pages.md" }}

### Project config

Expand Down

0 comments on commit 13f745f

Please sign in to comment.