Reorganize directory structure

This commit is contained in:
Konstantin Nazarov 2021-08-19 22:25:18 +01:00
parent a2e8bda421
commit 8d3fde7d3e
Signed by: knazarov
GPG key ID: 4CFE0A42FA409C22
11 changed files with 16 additions and 16 deletions

View file

@ -1,32 +1,32 @@
ODIR=output ODIR=output
PAGES_SRC := $(wildcard pages/*) PAGES_SRC := $(wildcard content/pages/*)
PAGES_DST := $(patsubst pages/%,$(ODIR)/%/index.html,$(PAGES_SRC)) PAGES_DST := $(patsubst content/pages/%,$(ODIR)/%/index.html,$(PAGES_SRC))
PROJECTS_SRC := $(wildcard projects/*) PROJECTS_SRC := $(wildcard content/projects/*)
PROJECTS_DST := $(patsubst projects/%,$(ODIR)/projects/%/index.html,$(PROJECTS_SRC)) PROJECTS_DST := $(patsubst content/projects/%,$(ODIR)/projects/%/index.html,$(PROJECTS_SRC))
POSTS_SRC := $(wildcard posts/*) POSTS_SRC := $(wildcard content/posts/*)
POSTS_DST := $(patsubst posts/%,$(ODIR)/posts/%/index.html,$(POSTS_SRC)) 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 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 $@)" 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 $@)" 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 $@)" mkdir -p "$(dir $@)"
cat "$<" | ./mdpage.sh > "$@" cat "$<" | ./bin/mdpage.sh > "$@"
$(ODIR)/posts/index.html: $(POSTS_SRC) $(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 $(ODIR)/index.html: content/index.md
cat index.md | ./mdpage.sh --notitle > "$@" cat content/index.md | ./bin/mdpage.sh --notitle > "$@"
$(ODIR)/style.css: style.css $(ODIR)/style.css: style.css
cp style.css $(ODIR)/style.css cp style.css $(ODIR)/style.css

View file

@ -21,7 +21,7 @@ render() {
[ "$NOTITLE" == "0" ] && echo "# $TITLE"; [ "$NOTITLE" == "0" ] && echo "# $TITLE";
echo "$LASTLINE"; echo "$LASTLINE";
cat cat
} | awk -f markdown.awk | ./page.sh "$TITLE" } | awk -f ./bin/markdown.awk | ./bin/page.sh "$TITLE"
} }

View file