From 015c3a1d7cd0a1f68e70bf3e1254ec541ea16ae5 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Sun, 29 Nov 2020 22:16:57 -0500 Subject: moved template to templates, updated makefile --- Makefile | 29 ++++++++------- favicon.ico | Bin 0 -> 53694 bytes template.html | 93 ------------------------------------------------ templates/template.html | 69 +++++++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 106 deletions(-) create mode 100644 favicon.ico delete mode 100644 template.html create mode 100644 templates/template.html diff --git a/Makefile b/Makefile index 6a26510..2f822c0 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,27 @@ -# simple date to RFC date: -# date -j -f "%Y-%m-%d" -R 2020-10-29 +# Written for FreeBSD make(1), or pmake. Not tested with GNU make. -all: - echo done. +TEMPLATE = templates/template.html +RSS_TEMPLATE = templates/rss.xml -serve: +.PHONY: all clean serve post + +serve: all python3.7 -m http.server 3000 -resume: - echo unimplemented! +clean: + rm -f index.html + rm -f rss.xml + +profile/adamcarpenter.pdf: profile/adamcarpenter.html + touch profile/adamcarpenter.pdf -post: +post: clean @read -p "Title: " TITLE; \ read -p "Category: " CATEGORY; \ SHORT_DATE=`date +"%Y-%m-%d"`; \ LONG_DATE=`date -R`; \ - mkdir -p posts/$$category; \ - FILENAME=posts/$$category/`date +"%Y-%m-%d-"``echo $$title | tr "[:upper:]" "[:lower:]" | tr "[:blank:]" -`.html; \ + mkdir -p posts/$$CATEGORY; \ + FILENAME=posts/$$CATEGORY/`date +"%Y-%m-%d-"``echo $$TITLE | tr "[:upper:]" "[:lower:]" | tr "[:blank:]" -`.html; \ + cp $(TEMPLATE) $$FILENAME; \ $$EDITOR $$FILENAME; \ - sed -i .bak '5 a\ - $$TITLE https://www.53hor.net/$$FILENAME https://www.53hor.net/$$FILENAME $$LONG_DATE - ' rss.xml diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..c6c9d94 Binary files /dev/null and b/favicon.ico differ diff --git a/template.html b/template.html deleted file mode 100644 index 568fe5c..0000000 --- a/template.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - 53hornet ➙ {{ title }} - - - - - -
-

- {{ title }} -

- -

- {{ description }} -

- - - - {{ article }} - -
-	  
-int sample_code() {
-  let x = 1;
-  let y = x;
-  return 0;
-}
-	  
-	  
- -
- {{ blockquote }} -
-
- - diff --git a/templates/template.html b/templates/template.html new file mode 100644 index 0000000..ef925d0 --- /dev/null +++ b/templates/template.html @@ -0,0 +1,69 @@ + + + + + + + + + + + + + 53hornet ➙ {{ title }} + + + + + +
+

+ {{ title }} +

+ + {{ content }} +
+ + -- cgit v1.2.3