From 234e7046c08df51149af1ad86760f7919c898978 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 15 Feb 2024 18:07:13 +0000 Subject: [PATCH] List recent notes on homepage --- docs/README.md | 3 +++ hooks/notes.py | 2 ++ mkdocs.yml | 3 +++ theme/home.html | 20 ++++++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 hooks/notes.py create mode 100644 theme/home.html diff --git a/docs/README.md b/docs/README.md index 17e0f0d..e90ce1a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1 +1,4 @@ +--- +template: home.html +--- # Notes diff --git a/hooks/notes.py b/hooks/notes.py new file mode 100644 index 0000000..b31d251 --- /dev/null +++ b/hooks/notes.py @@ -0,0 +1,2 @@ +def on_env(env, config, files): + env.tests["startswith"] = str.startswith diff --git a/mkdocs.yml b/mkdocs.yml index 15aa607..1b48ff5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -16,6 +16,7 @@ theme: icon: logo: fontawesome/regular/note-sticky favicon: https://theorangeone.net/favicon.ico + custom_dir: theme/ palette: # Palette toggle for light mode - scheme: default @@ -33,6 +34,8 @@ theme: icon: material/brightness-4 name: Switch to light mode +hooks: + - hooks/notes.py # Extensions markdown_extensions: diff --git a/theme/home.html b/theme/home.html new file mode 100644 index 0000000..208639d --- /dev/null +++ b/theme/home.html @@ -0,0 +1,20 @@ +{% extends "base.html" %} + +{% block content %} + {{ super() }} + +

Recent notes

+ + + +

View all →

+{% endblock %}