Reputation: 43
I'm trying to create a landing page similar to how mkdocs-material's doc site (https://squidfunk.github.io/mkdocs-material/) has. I am using mkdocs-material for my docs site.
Upvotes: 4
Views: 7611
Reputation: 5868
You will need to use a custom template for a specific page (e.g. home page) and providing the implementation for this template. So for the home page you are looking for this file: .overrides/home.html. You'll want to copy it over to your own overrides directory or take my example as reference. Make sure you've set your custom_dir
in mkdocs.yml
:
theme:
custom_dir: material
...
In the front matter of your index.md
, you need to specify the template to use:
---
title: Title
template: home.html
---
You need a newline at the end of your md file. If you don't have one, the content will not display. I guess it's processed as having null content if you don't include the newline.
Upvotes: 22
Reputation: 17
Well you can find the source code / setup of that site in its respository. https://github.com/squidfunk/mkdocs-material This should be a good example.
Upvotes: 0