so much simpler
This commit is contained in:
parent
771a21ff3e
commit
78c176d73e
7 changed files with 25 additions and 26 deletions
38
Makefile
38
Makefile
|
@ -39,8 +39,9 @@ PANDOC := pandoc \
|
||||||
--standalone
|
--standalone
|
||||||
$(DST_DIR)/%.html: $(SRC_DIR)/%.org $(TEMPLATE)
|
$(DST_DIR)/%.html: $(SRC_DIR)/%.org $(TEMPLATE)
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
$(PANDOC) $< \
|
$(PANDOC) $< --output $@.tmp
|
||||||
--output $@
|
minify --mime text/html $@.tmp > $@
|
||||||
|
@rm $@.tmp
|
||||||
ALL += $(DST_PANDOC_FILES)
|
ALL += $(DST_PANDOC_FILES)
|
||||||
|
|
||||||
# HTML INDEX
|
# HTML INDEX
|
||||||
|
@ -51,6 +52,13 @@ $(HTML_INDEX): $(DST_PANDOC_FILES) $(MKINDEX)
|
||||||
$(MKINDEX)
|
$(MKINDEX)
|
||||||
ALL += $(HTML_INDEX)
|
ALL += $(HTML_INDEX)
|
||||||
|
|
||||||
|
# RSS
|
||||||
|
RSS := $(DST_DIR)/rss.xml
|
||||||
|
MKRSS := engine/mkrss.sh
|
||||||
|
$(RSS): $(DST_PANDOC_FILES) $(MKRSS)
|
||||||
|
$(MKRSS)
|
||||||
|
ALL += $(RSS)
|
||||||
|
|
||||||
# ORG -> GEMINI
|
# ORG -> GEMINI
|
||||||
EXT := .org
|
EXT := .org
|
||||||
SRC_GMI_FILES ?= $(shell find $(SRC_DIR) -type f -name "*$(EXT)" $(NO_DRAFT))
|
SRC_GMI_FILES ?= $(shell find $(SRC_DIR) -type f -name "*$(EXT)" $(NO_DRAFT))
|
||||||
|
@ -71,7 +79,12 @@ $(GMI_INDEX): $(DST_GMI_FILES) $(MK_GMI_INDEX)
|
||||||
$(MK_GMI_INDEX)
|
$(MK_GMI_INDEX)
|
||||||
ALL += $(GMI_INDEX)
|
ALL += $(GMI_INDEX)
|
||||||
|
|
||||||
|
# RSS
|
||||||
|
GEM_ATOM := $(DST_DIR)/gem-atom.xml
|
||||||
|
MK_GEMINI_ATOM := engine/mk-gemini-atom.sh
|
||||||
|
$(GEM_ATOM): $(DST_GMI_FILES) $(MK_GEMINI_ATOM)
|
||||||
|
$(MK_GEMINI_ATOM)
|
||||||
|
ALL += $(GEM_ATOM)
|
||||||
|
|
||||||
# Images
|
# Images
|
||||||
SRC_IMG_FILES ?= $(shell find $(SRC_DIR) -type f -name "*.jpg" -or -name "*.jpeg" -or -name "*.gif" -or -name "*.png")
|
SRC_IMG_FILES ?= $(shell find $(SRC_DIR) -type f -name "*.jpg" -or -name "*.jpeg" -or -name "*.gif" -or -name "*.png")
|
||||||
|
@ -94,23 +107,9 @@ $(DST_DIR)/%.png: $(SRC_DIR)/%.png
|
||||||
convert "$<" -quality 50 -resize 800x800\> "$@"
|
convert "$<" -quality 50 -resize 800x800\> "$@"
|
||||||
|
|
||||||
ALL += $(DST_IMG_FILES)
|
ALL += $(DST_IMG_FILES)
|
||||||
|
|
||||||
# OPTIM PHASE
|
|
||||||
|
|
||||||
OPTIM_DIR ?= _optim
|
|
||||||
ENGINE_DIR ?= engine
|
|
||||||
ENGINE_SCRIPTS := $(shell find $(ENGINE_DIR) -type f)
|
|
||||||
OPTIM := engine/pre-deploy.sh
|
|
||||||
$(OPTIM_DIR)/index.html:$(DST_RAW_FILES) $(DST_GMI_FILES) $(DST_PANDOC_FILES) $(HTML_INDEX) $(ENGINE_SCRIPTS) $(OPTIM)
|
|
||||||
@mkdir -p $(OPTIM_DIR)
|
|
||||||
$(OPTIM)
|
|
||||||
|
|
||||||
optim: $(OPTIM_DIR)/index.html
|
|
||||||
|
|
||||||
|
|
||||||
# DEPLOY
|
# DEPLOY
|
||||||
|
|
||||||
deploy: $(OPTIM_DIR)/index.html
|
deploy: $(ALL)
|
||||||
engine/sync.sh # deploy to her.esy.fun
|
engine/sync.sh # deploy to her.esy.fun
|
||||||
engine/ye-com-fastpublish.hs # deploy to yannesposito.com (via github pages)
|
engine/ye-com-fastpublish.hs # deploy to yannesposito.com (via github pages)
|
||||||
|
|
||||||
|
@ -119,5 +118,4 @@ fast: $(ALL)
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -rf $(DST_DIR)/*
|
-[ ! -z "$(DST_DIR)" ] && rm -rf $(DST_DIR)/*
|
||||||
-rm -rf $(OPTIM_DIR)/*
|
|
||||||
|
|
|
@ -5,5 +5,5 @@ echo "Watching $PWD/{src,templates}"
|
||||||
# fswatch --exclude='\\.#' src | while read event; do
|
# fswatch --exclude='\\.#' src | while read event; do
|
||||||
fswatch --exclude='^.*\.#.*$' src templates | while read event; do
|
fswatch --exclude='^.*\.#.*$' src templates | while read event; do
|
||||||
echo "$event"
|
echo "$event"
|
||||||
make
|
./engine/build.sh
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
cd "$(git rev-parse --show-toplevel)" || exit 1
|
cd "$(git rev-parse --show-toplevel)" || exit 1
|
||||||
make
|
make -j $(getconf _NPROCESSORS_ONLN)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
cd "$(git rev-parse --show-toplevel)" || exit 1
|
cd "$(git rev-parse --show-toplevel)" || exit 1
|
||||||
# Directory
|
# Directory
|
||||||
webdir="_optim"
|
webdir="_site"
|
||||||
postsdir="$webdir/posts"
|
postsdir="$webdir/posts"
|
||||||
rssfile="$webdir/gem-atom.xml"
|
rssfile="$webdir/gem-atom.xml"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
cd "$(git rev-parse --show-toplevel)" || exit 1
|
cd "$(git rev-parse --show-toplevel)" || exit 1
|
||||||
# Directory
|
# Directory
|
||||||
webdir="_optim"
|
webdir="_site"
|
||||||
postsdir="$webdir/posts"
|
postsdir="$webdir/posts"
|
||||||
rssfile="$webdir/rss.xml"
|
rssfile="$webdir/rss.xml"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
cd "$(git rev-parse --show-toplevel)" || exit 1
|
cd "$(git rev-parse --show-toplevel)" || exit 1
|
||||||
webdir="_optim"
|
webdir="_site"
|
||||||
|
|
||||||
[[ -d $webdir ]] || { echo "no $webdir directory"; exit 1 }
|
[[ -d $webdir ]] || { echo "no $webdir directory"; exit 1 }
|
||||||
|
|
||||||
|
@ -9,5 +9,6 @@ echo -n "Uploading website"
|
||||||
rsync --progress\
|
rsync --progress\
|
||||||
--partial \
|
--partial \
|
||||||
--delete \
|
--delete \
|
||||||
|
--exclude '.git' \
|
||||||
-avHe ssh ${webdir}/ root@esy.fun:/var/www/her.esy.fun/
|
-avHe ssh ${webdir}/ root@esy.fun:/var/www/her.esy.fun/
|
||||||
echo " [done]"
|
echo " [done]"
|
||||||
|
|
|
@ -67,7 +67,7 @@ checkDir = do
|
||||||
toolsExists <- testdir "engine"
|
toolsExists <- testdir "engine"
|
||||||
if (not toolsExists)
|
if (not toolsExists)
|
||||||
then exit (ExitFailure 1)
|
then exit (ExitFailure 1)
|
||||||
else return "_optim"
|
else return "_site"
|
||||||
|
|
||||||
mainRepository = "git@github.com:yogsototh/yannesposito.com.git"
|
mainRepository = "git@github.com:yogsototh/yannesposito.com.git"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue