From 8d3fde7d3e8ed21b0668d0083ec7d5cf6a8f021d Mon Sep 17 00:00:00 2001 From: Konstantin Nazarov Date: Thu, 19 Aug 2021 22:25:18 +0100 Subject: [PATCH] Reorganize directory structure --- Makefile | 30 +++++++++---------- markdown.awk => bin/markdown.awk | 0 mdpage.sh => bin/mdpage.sh | 2 +- page.sh => bin/page.sh | 0 toc.sh => bin/toc.sh | 0 index.md => content/index.md | 0 {pages => content/pages}/about/note.md | 0 {pages => content/pages}/contact/note.md | 0 {pages => content/pages}/projects/note.md | 0 .../a_very_productive_os_x_workflow/note.md | 0 .../zettelkasten_associative_thought/note.md | 0 11 files changed, 16 insertions(+), 16 deletions(-) rename markdown.awk => bin/markdown.awk (100%) rename mdpage.sh => bin/mdpage.sh (89%) rename page.sh => bin/page.sh (100%) rename toc.sh => bin/toc.sh (100%) rename index.md => content/index.md (100%) rename {pages => content/pages}/about/note.md (100%) rename {pages => content/pages}/contact/note.md (100%) rename {pages => content/pages}/projects/note.md (100%) rename {posts => content/posts}/a_very_productive_os_x_workflow/note.md (100%) rename {posts => content/posts}/zettelkasten_associative_thought/note.md (100%) diff --git a/Makefile b/Makefile index 4cd89a1..e5f79e8 100644 --- a/Makefile +++ b/Makefile @@ -1,32 +1,32 @@ ODIR=output -PAGES_SRC := $(wildcard pages/*) -PAGES_DST := $(patsubst pages/%,$(ODIR)/%/index.html,$(PAGES_SRC)) +PAGES_SRC := $(wildcard content/pages/*) +PAGES_DST := $(patsubst content/pages/%,$(ODIR)/%/index.html,$(PAGES_SRC)) -PROJECTS_SRC := $(wildcard projects/*) -PROJECTS_DST := $(patsubst projects/%,$(ODIR)/projects/%/index.html,$(PROJECTS_SRC)) +PROJECTS_SRC := $(wildcard content/projects/*) +PROJECTS_DST := $(patsubst content/projects/%,$(ODIR)/projects/%/index.html,$(PROJECTS_SRC)) -POSTS_SRC := $(wildcard posts/*) -POSTS_DST := $(patsubst posts/%,$(ODIR)/posts/%/index.html,$(POSTS_SRC)) +POSTS_SRC := $(wildcard content/posts/*) +POSTS_DST := $(patsubst content/posts/%,$(ODIR)/posts/%/index.html,$(POSTS_SRC)) all: $(PAGES_DST) $(PROJECTS_DST) $(POSTS_DST) $(ODIR)/style.css $(ODIR)/index.html $(ODIR)/posts/index.html -$(ODIR)/%/index.html: pages/%/note.md +$(ODIR)/%/index.html: content/pages/%/note.md mkdir -p "$(dir $@)" - cat "$<" | ./mdpage.sh --notitle > "$@" + cat "$<" | ./bin/mdpage.sh --notitle > "$@" -$(ODIR)/projects/%/index.html: projects/%/note.md +$(ODIR)/projects/%/index.html: content/projects/%/note.md mkdir -p "$(dir $@)" - cat "$<" | ./mdpage.sh > "$@" + cat "$<" | ./bin/mdpage.sh > "$@" -$(ODIR)/posts/%/index.html: posts/%/note.md +$(ODIR)/posts/%/index.html: content/posts/%/note.md mkdir -p "$(dir $@)" - cat "$<" | ./mdpage.sh > "$@" + cat "$<" | ./bin/mdpage.sh > "$@" $(ODIR)/posts/index.html: $(POSTS_SRC) - ./toc.sh posts "/posts" | awk -f markdown.awk | ./page.sh Posts > "$@" + ./bin/toc.sh content/posts "/posts" | awk -f ./bin/markdown.awk | ./bin/page.sh Posts > "$@" -$(ODIR)/index.html: index.md - cat index.md | ./mdpage.sh --notitle > "$@" +$(ODIR)/index.html: content/index.md + cat content/index.md | ./bin/mdpage.sh --notitle > "$@" $(ODIR)/style.css: style.css cp style.css $(ODIR)/style.css diff --git a/markdown.awk b/bin/markdown.awk similarity index 100% rename from markdown.awk rename to bin/markdown.awk diff --git a/mdpage.sh b/bin/mdpage.sh similarity index 89% rename from mdpage.sh rename to bin/mdpage.sh index 2e5d070..8cb25ad 100755 --- a/mdpage.sh +++ b/bin/mdpage.sh @@ -21,7 +21,7 @@ render() { [ "$NOTITLE" == "0" ] && echo "# $TITLE"; echo "$LASTLINE"; cat - } | awk -f markdown.awk | ./page.sh "$TITLE" + } | awk -f ./bin/markdown.awk | ./bin/page.sh "$TITLE" } diff --git a/page.sh b/bin/page.sh similarity index 100% rename from page.sh rename to bin/page.sh diff --git a/toc.sh b/bin/toc.sh similarity index 100% rename from toc.sh rename to bin/toc.sh diff --git a/index.md b/content/index.md similarity index 100% rename from index.md rename to content/index.md diff --git a/pages/about/note.md b/content/pages/about/note.md similarity index 100% rename from pages/about/note.md rename to content/pages/about/note.md diff --git a/pages/contact/note.md b/content/pages/contact/note.md similarity index 100% rename from pages/contact/note.md rename to content/pages/contact/note.md diff --git a/pages/projects/note.md b/content/pages/projects/note.md similarity index 100% rename from pages/projects/note.md rename to content/pages/projects/note.md diff --git a/posts/a_very_productive_os_x_workflow/note.md b/content/posts/a_very_productive_os_x_workflow/note.md similarity index 100% rename from posts/a_very_productive_os_x_workflow/note.md rename to content/posts/a_very_productive_os_x_workflow/note.md diff --git a/posts/zettelkasten_associative_thought/note.md b/content/posts/zettelkasten_associative_thought/note.md similarity index 100% rename from posts/zettelkasten_associative_thought/note.md rename to content/posts/zettelkasten_associative_thought/note.md