X-Git-Url: https://git.based.quest/?p=web-old.git;a=blobdiff_plain;f=blogit;h=c1063d11a0296e607d3b0b8259fb95ee53fb312e;hp=e54f9e38a57297145f032f13c32f6ecba4ec445d;hb=HEAD;hpb=adfee06df091b3da3c1208326312b7766815c822 diff --git a/blogit b/blogit index e54f9e3..c1063d1 100755 --- a/blogit +++ b/blogit @@ -6,10 +6,11 @@ include config endif # The following can be configured in config -BLOG_DATE_FORMAT_INDEX ?= %x -BLOG_DATE_FORMAT ?= %x %X +BLOG_DATE_FORMAT_INDEX ?= %d/%m/%Y +BLOG_DATE_FORMAT ?= %d/%m/%Y %X BLOG_TITLE ?= blog BLOG_DESCRIPTION ?= blog +BLOG_AUTHOR ?= John Doe BLOG_URL_ROOT ?= http://localhost/blog BLOG_FEED_MAX ?= 20 BLOG_FEEDS ?= rss atom @@ -67,6 +68,8 @@ blog/index.html: $(ARTICLES) $(TAGFILES) $(addprefix templates/,$(addsuffix .htm export TITLE; \ DESCRIPTION="$(BLOG_DESCRIPTION)"; \ export DESCRIPTION; \ + AUTHOR="$(BLOG_AUTHOR)"; \ + export AUTHOR; \ envsubst < templates/header.html > $@; \ envsubst < templates/index_header.html >> $@; \ envsubst < templates/tag_list_header.html >> $@; \ @@ -107,6 +110,8 @@ blog/@%.html: $(TAGFILES) $(addprefix templates/,$(addsuffix .html,header tag_in mkdir -p blog TITLE="$(BLOG_TITLE) - Articles tagged $*"; \ TAGS="$*"; \ + AUTHOR=""; \ + export AUTHOR; \ export TITLE; \ export TAGS; \ envsubst < templates/header.html > $@; \ @@ -133,7 +138,7 @@ blog/%.html: $(BLOG_SRC)/%.md $(addprefix templates/,$(addsuffix .html,header ar mkdir -p blog TITLE=" $(BLOG_TITLE) - $(shell head -n1 $<)"; \ export TITLE; \ - AUTHOR="$(shell git log -n 1 --reverse --format="%cn" -- "$<")"; \ + AUTHOR="$(shell git log -n 1 --reverse --format="%an" -- "$<")"; \ export AUTHOR; \ DATE_POSTED="$(shell git log --diff-filter=A --date="format:$(BLOG_DATE_FORMAT)" --pretty=format:'%ad' -- "$<")"; \ export DATE_POSTED; \