aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2022-03-25 12:57:40 +0000
committerYann Herklotz <git@yannherklotz.com>2022-03-25 12:57:40 +0000
commitea4ad462e33384c8bbbddca523f138c6c181e7b6 (patch)
tree3e906e36e1279d8e19793e67e2756c7205ab3519 /Makefile
parentb25f796221dcb16ce2af8bd139d032cf7b5bdb7d (diff)
downloadyannherklotz.com-ea4ad462e33384c8bbbddca523f138c6c181e7b6.tar.gz
yannherklotz.com-ea4ad462e33384c8bbbddca523f138c6c181e7b6.zip
Integrate everything into one makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 30 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index eacef92..10df2ae 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,20 @@
-all: layouts/partials/papers.html layouts/partials/papers_other.html
+DEPS := "(progn\
+(require 'package)\
+(package-initialize)\
+(add-to-list 'package-archives '(\"melpa\" . \"https://melpa.org/packages/\") t)\
+(package-refresh-contents)\
+(package-install 'ox-hugo)\
+(require 'package)\
+(package-initialize)\
+(require 'org)\
+(require 'ox)\
+(require 'ox-hugo)\
+(setq org-confirm-babel-evaluate nil\
+ org-export-with-broken-links t))"
+
+PUBLISH := "(org-hugo-export-wim-to-md :all-subtrees)"
+
+all: public
layouts/partials:
mkdir -p $@
@@ -13,3 +29,16 @@ layouts/partials/%.html: %.bib | layouts/partials
url_artifact artifact $<
sed -r -e 's:\[(.*)\]:<b>\1</b>:g' $@ >$@.new && mv $@.new $@
sed -r -e 's:Yann Herklotz:<b>Yann Herklotz</b>:g' $@ >$@.new && mv $@.new $@
+
+content: content.org
+ emacs --batch --eval $(DEPS) --find-file $< --eval $(PUBLISH)
+
+public: content layouts/partials/papers.html layouts/partials/papers_other.html
+ hugo --minify
+
+clean:
+ rm -rf layouts
+ rm -rf public
+ rm -rf content
+
+.PHONY: all clean