]> git.rocketbowman.com Git - jetsam.git/commitdiff
chore: refactor to split content from framework
authorKyle Bowman <kyle+github@rocketbowman.com>
Sun, 22 Sep 2024 23:54:18 +0000 (19:54 -0400)
committerKyle Bowman <kyle+github@rocketbowman.com>
Sun, 22 Sep 2024 23:54:18 +0000 (19:54 -0400)
Makefile
README.md [new file with mode: 0644]
_static/acknowledgements.md [new file with mode: 0644]
demo/note1.md [new file with mode: 0644]
demo/note2.md [new file with mode: 0644]
src/acknowledgements.md [deleted file]
src/note1.md [deleted file]
src/note2.md [deleted file]
src/public [new symlink]

index a657707e6e64d1d99272bfba80b0ee8c02c4b6b5..3a9bc71a2445df506924e977a18c38ab50407a53 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,27 +1,24 @@
 SRC_DIR := src
 BUILD_DIR := build
 
-MARKDOWN_FILES := $(wildcard $(SRC_DIR)/*.md)
+MARKDOWN_FILES := $(wildcard $(SRC_DIR)/**/*.md)
 HTML_FILES := $(patsubst $(SRC_DIR)/%.md, $(BUILD_DIR)/%, $(MARKDOWN_FILES))
 
 .PHONY: all clean
 
 all: $(HTML_FILES)
 
-# Create the build directory if it doesn't exist
-$(BUILD_DIR):
-       mkdir -p $(BUILD_DIR)
-
 # Build HTML file from Markdown
-$(BUILD_DIR)/%: $(SRC_DIR)/%.md | $(BUILD_DIR)
-       pandoc \
+$(BUILD_DIR)/%: $(SRC_DIR)/%.md 
+       @mkdir -p $(dir $@)
+       @pandoc \
                --from=markdown+wikilinks_title_before_pipe \
                --to=html5 \
                --standalone \
                --template=_static/templates/base.html \
                --output=$@ $<
+       @echo "Building $@ from $<"
 
 # Clean up generated HTML files
 clean:
-       rm -rf $(BUILD_DIR)
-
+       rm -rf $(BUILD_DIR)
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..3fd9d22
--- /dev/null
+++ b/README.md
@@ -0,0 +1,19 @@
+# Usage
+
+Write markdown. Use the Makefile to build render it to HTML via pandoc.
+
+## Adding Content
+The Makefile builds all Markdown files in `src` or one of 
+its subdirectories. You can add files directly to `src`. Or, 
+if you want to keep your content separate from the functionality,
+you can use symlinks.
+
+From `src`, use `ln -s ../../dir src/dir` to make it appear that your 
+markdown files are in the directory, even if they are in a separate 
+
+# Common Errors
+
+## "pandoc: build/public/note1: withFile: does not exist (No such file or directory)"
+
+Pandoc does not build the directory by default. Check that the build/public 
+directory exists.
\ No newline at end of file
diff --git a/_static/acknowledgements.md b/_static/acknowledgements.md
new file mode 100644 (file)
index 0000000..fbc68b8
--- /dev/null
@@ -0,0 +1,14 @@
+---
+title: acknowledgements
+author: Kyle Bowman
+---
+
+This site is heavily influenced by the following projects:
+
+| Project | Website | License |
+| ------- | ------- | ------- |
+| Sakura CSS | https://github.com/oxalorg/sakura | [MIT License](https://github.com/oxalorg/sakura/blob/master/LICENSE.txt) |
+| Normalize CSS | https://github.com/necolas/normalize.css | [MIT License](https://github.com/necolas/normalize.css/blob/master/LICENSE.md) |
+| Vim Deep Space | https://github.com/tyrannicaltoucan/vim-deep-space/ | [MIT License](https://github.com/tyrannicaltoucan/vim-deep-space/blob/master/LICENSE) |
+
+Thank you for your contributions to the open source community!
\ No newline at end of file
diff --git a/demo/note1.md b/demo/note1.md
new file mode 100644 (file)
index 0000000..9663da6
--- /dev/null
@@ -0,0 +1,6 @@
+---
+title: Note 1
+author: Kyle Bowman
+---
+
+This is a note that links to [[note2]].
\ No newline at end of file
diff --git a/demo/note2.md b/demo/note2.md
new file mode 100644 (file)
index 0000000..2851e55
--- /dev/null
@@ -0,0 +1,6 @@
+---
+title: Note 2
+author: Kyle Bowman
+---
+
+This is a note that links to [[note1]].
\ No newline at end of file
diff --git a/src/acknowledgements.md b/src/acknowledgements.md
deleted file mode 100644 (file)
index fbc68b8..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
----
-title: acknowledgements
-author: Kyle Bowman
----
-
-This site is heavily influenced by the following projects:
-
-| Project | Website | License |
-| ------- | ------- | ------- |
-| Sakura CSS | https://github.com/oxalorg/sakura | [MIT License](https://github.com/oxalorg/sakura/blob/master/LICENSE.txt) |
-| Normalize CSS | https://github.com/necolas/normalize.css | [MIT License](https://github.com/necolas/normalize.css/blob/master/LICENSE.md) |
-| Vim Deep Space | https://github.com/tyrannicaltoucan/vim-deep-space/ | [MIT License](https://github.com/tyrannicaltoucan/vim-deep-space/blob/master/LICENSE) |
-
-Thank you for your contributions to the open source community!
\ No newline at end of file
diff --git a/src/note1.md b/src/note1.md
deleted file mode 100644 (file)
index 9663da6..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: Note 1
-author: Kyle Bowman
----
-
-This is a note that links to [[note2]].
\ No newline at end of file
diff --git a/src/note2.md b/src/note2.md
deleted file mode 100644 (file)
index 2851e55..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: Note 2
-author: Kyle Bowman
----
-
-This is a note that links to [[note1]].
\ No newline at end of file
diff --git a/src/public b/src/public
new file mode 120000 (symlink)
index 0000000..0276007
--- /dev/null
@@ -0,0 +1 @@
+../../public/
\ No newline at end of file