diff --git a/Makefile b/Makefile index aee731e..60b072d 100644 --- a/Makefile +++ b/Makefile @@ -7,13 +7,29 @@ EXE=bin/GenBlog all: install $(CC) $(FLAGS) src/GenBlog.c -o $(EXE) +debug: install + $(CC) $(FLAGS) -DDEBUG src/GenBlog.c -o $(EXE) + install: mkdir -p bin mkdir -p obj + mkdir -p blogs clean: rm -rf obj rm -rf bin blog: all + @# Reset all blogs to start build. + -rm -rf blogs/*.html + @# Setup boilerplate html files for blog files + -@for blog in ./blogs/RawBlogs/*.blog ; do \ + blog=$$(echo $$blog | cut -c 17- | cut -d "." -f 1); \ + cp ./blogs/preamble/start.html ./blogs/$$blog.html; \ + done ./bin/GenBlog + @# Append the end of the file once done + -@for blog in ./blogs/RawBlogs/*.blog ; do \ + blog=$$(echo $$blog | cut -c 17- | cut -d "." -f 1); \ + cat ./blogs/preamble/end.html >> ./blogs/$$blog.html; \ + done diff --git a/blogs/RawBlogs/test.blog b/blogs/RawBlogs/test.blog new file mode 100644 index 0000000..b65a6e7 --- /dev/null +++ b/blogs/RawBlogs/test.blog @@ -0,0 +1,10 @@ +Title +[ +No Box +] +- +Text in a box +_ +- +Another box +- diff --git a/blogs/preamble/end.html b/blogs/preamble/end.html new file mode 100644 index 0000000..fcaaf94 --- /dev/null +++ b/blogs/preamble/end.html @@ -0,0 +1,4 @@ +View page source + + + diff --git a/blogs/preamble/start.html b/blogs/preamble/start.html new file mode 100644 index 0000000..01dd1d0 --- /dev/null +++ b/blogs/preamble/start.html @@ -0,0 +1,42 @@ + + + + +
+ + 🅱️ HOME 🅱️ + +diff --git a/blogs/test.html b/blogs/test.html new file mode 100644 index 0000000..dade83d --- /dev/null +++ b/blogs/test.html @@ -0,0 +1,46 @@ + + + + ++ +View page source + ++
+ + 🅱️ HOME 🅱️ + ++View page source + + + diff --git a/src/GenBlog.c b/src/GenBlog.c index edcd0ba..558e866 100644 --- a/src/GenBlog.c +++ b/src/GenBlog.c @@ -1,6 +1,76 @@ #include+ +View page source + ++