From fddbbf4c50bcd7a17a86942f77fbef223179e045 Mon Sep 17 00:00:00 2001 From: Akbar Rahman Date: Tue, 2 Jan 2024 18:20:47 +0000 Subject: [PATCH] use readme.md instead of index.md --- gronk.py | 10 +++++----- readme.md | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gronk.py b/gronk.py index 4b5dd60..275d771 100755 --- a/gronk.py +++ b/gronk.py @@ -118,8 +118,8 @@ class FileMap: 'tags': [], } - if 'index.md' in [f.name for f in filepath.iterdir()]: - with open(filepath.joinpath('index.md'), + if 'readme.md' in [f.name for f in filepath.iterdir()]: + with open(filepath.joinpath('readme.md'), encoding='utf-8') as file_pointer: for key, val in frontmatter.load( file_pointer).to_dict().items(): @@ -358,7 +358,7 @@ def process_home_index(args, notes_git_head_sha1=None): """ post = {'title': 'gronk', 'content': ''} - custom_content_file = args.notes.joinpath('index.md') + custom_content_file = args.notes.joinpath('readme.md') if custom_content_file.is_file(): fmpost = frontmatter.loads(custom_content_file.read_text()).to_dict() for key, val in fmpost.items(): @@ -487,8 +487,8 @@ def main(args): # render each file for file in files: - # don't render index.md as index as it is used for directory - if file == "index.md": + # don't render readme.md as index as it is used for directory + if file == "readme.md": continue render_file(root.joinpath(file)) diff --git a/readme.md b/readme.md index 6e6fe3e..a95a842 100644 --- a/readme.md +++ b/readme.md @@ -53,7 +53,7 @@ Set the following environment variables (or create a .env file) and run `docker ## Custom Directory Index and Metadata -To add custom content to a directory index, put it in a file called `index.md` under the directory. +To add custom content to a directory index, put it in a file called `readme.md` under the directory. You can set the following frontmatter variables to customise the directory index of a directory: @@ -61,7 +61,7 @@ You can set the following frontmatter variables to customise the directory index |------------------------|-------------------|--------------------------------------------------------------------------------------------| | `tags` | `[]` | list of tags, used by search and inherited by any notes and subdirectories | | `uuid` | none | unique id to reference directory, used for permalinking | -| `content_after_search` | `false` | show custom content in `index.md` after search bar and directory index | +| `content_after_search` | `false` | show custom content in `readme.md` after search bar and directory index | | `automatic_index` | `true` | show the automatically generated directory index. required for search bar to function. | | `search_bar` | `true` | show search bar to search directory items. requires `automatic_index` (enabled by default) | @@ -99,8 +99,8 @@ a file called `styles.css`. To add additional styling, the default styling will attempt to import `styles.css` from the root of the notes directory. -To add additional content to the homepage, create a file called `index.md` at the top level of your notes directory. -To set the HTML `title` tag, set `title` in the frontmatter of `index.md`: +To add additional content to the homepage, create a file called `readme.md` at the top level of your notes directory. +To set the HTML `title` tag, set `title` in the frontmatter of `readme.md`: ```markdown ---