From: Kyle Bowman Date: Sun, 22 Sep 2024 23:54:18 +0000 (-0400) Subject: chore: refactor to split content from framework X-Git-Url: https://git.rocketbowman.com/?a=commitdiff_plain;h=2a2c8af8288689dafc235f263d48c4879a5785f2;p=jetsam.git chore: refactor to split content from framework --- diff --git a/Makefile b/Makefile index a657707..3a9bc71 100644 --- 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 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 index 0000000..fbc68b8 --- /dev/null +++ b/_static/acknowledgements.md @@ -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 index 0000000..9663da6 --- /dev/null +++ b/demo/note1.md @@ -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 index 0000000..2851e55 --- /dev/null +++ b/demo/note2.md @@ -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 index fbc68b8..0000000 --- a/src/acknowledgements.md +++ /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 index 9663da6..0000000 --- a/src/note1.md +++ /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 index 2851e55..0000000 --- a/src/note2.md +++ /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 index 0000000..0276007 --- /dev/null +++ b/src/public @@ -0,0 +1 @@ +../../public/ \ No newline at end of file