From 9da8027ddcbc30b3803f724359df37f45b39243b Mon Sep 17 00:00:00 2001 From: Kyle Bowman Date: Mon, 30 Sep 2024 09:00:18 -0400 Subject: [PATCH] feat: add link to sorted index --- Makefile | 5 ++++- _static/templates/base.html | 3 +++ scripts/index.sh | 2 +- todo.md | 7 +++++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3a9bc71..cd2e22c 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,13 @@ BUILD_DIR := build MARKDOWN_FILES := $(wildcard $(SRC_DIR)/**/*.md) HTML_FILES := $(patsubst $(SRC_DIR)/%.md, $(BUILD_DIR)/%, $(MARKDOWN_FILES)) -.PHONY: all clean +.PHONY: all clean index all: $(HTML_FILES) +index: + scripts/index.sh > build/index.html + # Build HTML file from Markdown $(BUILD_DIR)/%: $(SRC_DIR)/%.md @mkdir -p $(dir $@) diff --git a/_static/templates/base.html b/_static/templates/base.html index cfc4b1d..2e4607f 100644 --- a/_static/templates/base.html +++ b/_static/templates/base.html @@ -31,6 +31,9 @@ $-- + Index +

$title$

diff --git a/scripts/index.sh b/scripts/index.sh index 263d8b1..6c19420 100755 --- a/scripts/index.sh +++ b/scripts/index.sh @@ -67,5 +67,5 @@ make_boilerplate(){ ######## # MAIN # ######## -FILES="$(find "$BUILD_DIR" -type 'f')" +FILES="$(find "$BUILD_DIR" -type 'f' -not -name "*index.html" | sort)" make_boilerplate "$(make_ul "$FILES")" diff --git a/todo.md b/todo.md index d42896b..5960109 100644 --- a/todo.md +++ b/todo.md @@ -5,8 +5,8 @@ * ~~I only want files in the build directory.~~ * ~~I want a clickable link with a reference to the title.~~ * (Stretch) An automated description would be nice. - * (Stretch) Alphabetize index. - * Add index page to nav bar for every page. + * ~~(Stretch) Alphabetize index.~~ + * ~~Add index page to nav bar for every page.~~ * (Defer) About - add acknowledgements * (Defer) Summaries - index * (Defer) Figure out other categories. @@ -26,7 +26,10 @@ * Can I centralize config? A `make config` would be nice if it includes static content (like `author="Kyle Bowman"`) and dynamic content like `files=$(ls build)`. + * Index.html will eventually need to be renamed b/c it's an "index", not the landing page. * _static should contain only things that are copied into the website + * How to handle site-specific assets, like images? + * Idea: public/_static and public/src. Can I leverage GNU stow or similar link farm? * (Stretch) Reformulate my templates based on jgm's templates so I can merge updates easily. * Write the README -- 2.39.5