#Page configuration
Individual .md pages can be configured using the metadata section added to the top of the page.
#Default pages
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:
index.md
readme.md
default.md
welcome.md
*only in the project roothome.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:
#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.
For instance, sample.md would need a matching sample.yml file. The separate .yml file must have the exact same filename as its paired .md page.
Both .yml and .yaml extensions are supported.
Adding your configs into the top metadata section of a .md page, or into a separate .yml file is just a matter of preference. Both techniques produce the same result.
If you add configs to both locations, the page metadata takes precedence, even if they are different configs.
If you add one or more configs to a .md page, Retype will not look for nor read the separate .yml file. Just use one or the other, but not both.
See folder configuration for details on how to configure a folder.
The configuration name authors
is also supported. The name authors
is an alias of author
and both can be used interchangeably.
An author object can also be configured with specific values for the name
, email
, link
, and avatar
.
The author
config is very flexible and can accept one or more author configurations and even a list of mixed types. The following sample demonstrates adding a list of authors. Two authors are added by name and a third is added only by their email address.
Mixed author types are also permitted, including adding a list of authors by name, email, or author configuration objects.
#avatar
#link
#name
This config is Retype PRO only.
The breadcrumb
config controls whether to include the breadcrumb navigation on this page. Default is true
.
Set to false
to disable the breadcrumb navigation on this page.
It is also possible to disable the breadcrumb navigation on all pages within a folder by setting breadcrumb: false
in the folderhindex.yml
configuration file or the folder default page, such as default.md
, readme.md
, or index.md
.
#category
The configuration name categories
is also supported. The name categories
is an alias of category
and both can be used interchangeably.
A category for this page.
A single category
or a list of categories
can be configured in each .md page you would like to categorize.
The category
is meant to be a broad grouping of content, where tags
are meant to describe specific details of the content in that particular page. A page can belong to multiple (zero to many) categories and have multiple (zero to many) tags.
All of the following are acceptable techniques for configuring a single category
or multiple categories
.
If a category
is configured in the page metadata, the category is added to the top of the page under the main title.
Individual category summary pages will be automatically generated by Retype at <url>/categories/<category>
, plus an additional <url>/categories
index page which lists all categories in the project.
#date
A custom publish date for this page.
If a date
is configured, Retype will add the Published date to the top of the page, just under the main title.
The date must be provided in the yyyy-mm-dd
ISO format or yyyy-mm-ddThh:mm
if you want to include a date and a time.
The date
is used by Retype to order blog pages. Newer blog pages are ordered first.
#description
#expanded
Determines whether this folder should be expanded in the tree navigation on initial page load. Default is false
.
Set to true
to expand the folder node in the navigation.
The expanded
option only applies to folders when configured within an index.yml folder configuration file.
Setting expanded: true
within the metadata of an .md page or the paired .yml file will be ignored.
#icon
#image
By default, Retype will try to find the first image on the page and use that image as the feature image to highlight when creating a summary of the page.
You can customize the feature image by setting the image
config to any local path or external image hosted elsewhere.
#Local path
Configure a path to a local file stored within the project.
#External image
Configure a URL to any image hosted elsewhere.
#label
#layout
The layout for the page. Default is default
.
Supported values: default
, central
, page
, and blog
.
#meta
#title
A custom value for the <title>
meta tag.
If set, the value will completely override any <title>
meta tag value generated by Retype.
Default is null
.
With the above sample, the <title>
will be:
Without the meta.title
set, by default, the <title>
would be:
This meta.title
config is not to be confused with the Page title
config, which we recommend not using.
This meta.title
config is also not to be confused with the Project level meta.title
config.
Navigation configuration options to control the behavior of the left sidebar navigation.
#mode
This config is Retype PRO only.
Controls how the sidebar navigation is created and functions. The default functionality is to create the navigation as an expandable Tree structure. The default value for mode
is default
.
The nav.mode
setting can be configured on any page within a top-level folder to convert only that specific folder into a "stack" navigation structure. The remaining top-level folders will maintain their default tree navigation behavior.
The following sample demonstrates how to configure the "stacked" navigation structure for a specific top-level folder:
When configured on a page within a top-level folder, this setting will only affect that specific folder's navigation structure.
To convert the entire navigation component to a stack
type layout, please see the Project nav
setting.
#order
A custom stack order for this page within the left side-bar tree navigation.
Options can include:
- A number such as
100
or-100
- Any string value that will be slotted into the
A -> Z
alpha ordering of all navigation nodes - A SemVer value such as
v2.0
If the order
is set with a number, a larger positive number will give more weight or priority to that page and Retype will bubble up that page in the navigation. For instance, a page configured with order: 100
will be higher in the navigation than a page configured with order: 10
.
Similarily, a page configured with order: -100
will be lower in the navigation than a page configured with order: -10
or any page where no order
is set.
The position of folders within the navigation can be ordered as well using the same order
technique, the only difference that folders are always pinned to the top of their order
group.
In order of precedence, the order
of a page in the navigation would be determined with the following priority:
By default, the home page of the website has an order of 10000
. To add a page in the navigation just above the home page, set a value of order: 10001
or greater. To add a page in the navigation just below the home page, set a value of order: 9999
or lower. To move the home page to the bottom of the navigation, set a negative value, such as order: -10000
.
#Order by number
Larger number = order higher in the stack.
No order number or 0
= order by alpha
Smaller number = order lower in the stack.
If multiple pages have the same order
number, secondary ordering in that cluster is by alpha.
#Order by alpha
Order values by alpha.
a
= higher z
= lower
#Order by v{semver}
Order by semver with latest release at the top
Items prefixed with v
would be grouped below the alpha ordered items.
#permalink
A custom URL path for this page or folder which overrides the default path generated by Retype.
A permalink
allows the folder and file structure to remain unchanged, but allowing the final URL's to be customized.
Configuring the permalink
is an excellent solution when moving to Retype from another platform and you would like to maintain existing public URL's, but would prefer to re-organize your .md files into a new structure. A permalink
allows for a clean disconnect of the page path from the final published URL path.
In the following sample, the generated URL by Retype would be /guide/2021-06-25-publishing-to-github-pages/
, but we override with a custom permalink which will publish the page to /tutorial/publish-to-github-pages/
.
If a permalink
is configured on a folder, or on a readme.md or index.md page within the folder, or on an index.yml file within the folder, that permalink
is assumed to be the base permalink for all pages within that folder.
The following scenario demonstrates a basic scenario where we configure all pages within the /guides/
folder to be served from the custom URL location of /tutorials/
.
To accomplish this goal, configure the permalink
on the readme.md, then all other pages within the same folder will adjust as well. The configuration.md page will now be served from /tutorials/configuration/
.
#redirect
Redirect requests for this page to another location.
The redirect
can be set to another page within this project, or an external link.
For example, you have an existing setup.md page and you want to move the content to getting-started.md, but other websites might still be linking to your old example.com/setup/ page and you want to ensure those links still work. You would then set the following redirect
page config in setup.md to redirect to getting-started.md
.
Retype will automatically handle any incoming example.com/setup requests and redirect to the new example.com/getting-started location.
Retype is also smart enough to scan your project for any setup.md links and replace those with a link directly to getting-started.md.
#route
See permalink.
A list of tags can be added to the metadata at the top of each .md page you would like to tag.
The tags
are meant to describe specific details of the content in that page. Tags are similar to category
, although category
is meant to describe be a broad grouping of content. A page can belong to multiple (zero to many) categories and have multiple (zero to many) tags.
If tags are configured in the page metadata, a list of tag links are added to the bottom of the page. See the bottom of this page for a working sample.
Individual tag summary pages will be automatically generated by Retype at <url>/tags/<tag>
, plus an additional <url>/tags
index page which lists all tags and their count used within the project.
Check out the pages of this website configured with the guide tag.
Multiple tags can be added to the list by separating each with a comma ,
.
A list style syntax is also supported for tags
:
#templating
Templating can be disabled on a per-page basis by setting templating: false
in the page metadata.
#title
The title
config instructs Retype to add a primary # Page Title
to your page, but it is recommended to manually add a # Page Title
to each of your pages, instead of setting a title
.
As a general rule, the actual content of your page should not be configured in the page metadata.
The title
is primarily used to support backwards compatibiity with the .md content style from other older legacy static site generator applications.
The following sample demonstrates setting the title
config instead of explicitly using a # Page Title
to your page.
Try to avoid using the title
config. Please add a real page # Page Title
to your document. The # Page Title
will be rendered in HTML as <h1>Page Title</h1>
.
For example, the sample above should ideally be written as the following instead of using a title
config.
#visibility
Configure the visibility of the page to be public
, hidden
, protected
, or private
. Default is public
.
With hidden
, the page will still be created and added to the final website, but it is hidden. You can still link to the page or share a link to the page.
Retype would ensure no automatically generated links or references to the hidden page are created. If on a public page, a link to a hidden page is made by an author, the link will work and the hidden page will be visible.
The following sample demonstrates hiding a page:
The History component will continue to function as normal. Any hidden page visited would still be logged in the history, although that history is only available to the visitor.
Setting visibility: hidden
on a page is a good way to create a draft or secret page that you do not want included in the navigation, but you still want to share a link to the page for others to view if they have the link.
#protected
To create a protected page, add visibility: protected
and then set the password for the project using the --password
flag.
Only one password can be configured per project. The password protection functionality within Retype is not designed to be a comprehensive security layer with features such as multiple accounts or roles. Only the most basic password protection for pages is enabled.
The following sample (password: test) demonstrates creating a protected page:
Then call either of the following commands to set the password for the project:
The project password can also be set as an Environment variable by using RETYPE_PASSWORD
.
An entire folder can be set to protected
by adding an index.yml
file with the following configuration to the root of the folder. See the folder docs for additional examples.
#private
To create a private page, add visibility: private
and then set the password for the project using the --password
flag.
Only one password can be configured per project. The password protection functionality within Retype is not designed to be a comprehensive security layer with features such as multiple accounts or roles. Only the most basic password protection for pages is enabled.
The following sample (password: test) demonstrates creating a private page:
Then call either of the following commands to set the password for the project:
The project password can also be set as an Environment variable by using RETYPE_PASSWORD
.
For hidden
and private
pages, Retype does not provide a link to the page, but it still uses the same naming convention as all other pages. For instance, if your site is hosted at https://example.com
and the page was called my-hidden-page.md
, the URL would be https://example.com/my-hidden-page/
.
An entire folder can be set to private
by adding an index.yml
file with the following configuration to the root of the folder. See the folder docs for additional examples.