]> git.rocketbowman.com Git - jetsam.git/commitdiff
feat: add link to sorted index
authorKyle Bowman <kylebowman14@gmail.com>
Mon, 30 Sep 2024 13:00:18 +0000 (09:00 -0400)
committerKyle Bowman <kylebowman14@gmail.com>
Mon, 30 Sep 2024 13:07:55 +0000 (09:07 -0400)
Makefile
_static/templates/base.html
scripts/index.sh
todo.md

index 3a9bc71a2445df506924e977a18c38ab50407a53..cd2e22c32120944b5f3766f25f3da6c85edb7fba 100644 (file)
--- 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 $@)
index cfc4b1d9469c2391d03bc46eb0e5b33dfc3b550e..2e4607f4dd30b353e72eecb5806f6a655eeb5812 100644 (file)
@@ -31,6 +31,9 @@ $--    <link href="atom.xml" type="application/atom+xml" rel="alternate" title="
   <body>
     <nav>
       $navigation$
+      <div style="text-align: right">
+        <a href="../index.html">Index</a>
+      </div>
     </nav>
     <header>
       <h1>$title$</h1>
index 263d8b1f96412617269633f4a9a37bb297043b29..6c19420116f36149927d05ba4281a615fefd3c87 100755 (executable)
@@ -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 d42896ba349fe234628e1d86d7fbba3fc32bbd00..5960109bdfb1cf536202ba3b4ac7ed0e826755ad 100644 (file)
--- 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.
         * 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