portability improvements
This commit is contained in:
parent
c13516e0b0
commit
e24aa4d479
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
.cache/
|
.cache/
|
||||||
_site/
|
_site/
|
||||||
.direnv/
|
.direnv/
|
||||||
|
engine/envvars.sh
|
||||||
|
|
14
Makefile
14
Makefile
|
@ -67,7 +67,7 @@ ALL += indexcache
|
||||||
DST_INDEX_FILES ?= $(patsubst %.xml,%.index, $(DST_XML_FILES))
|
DST_INDEX_FILES ?= $(patsubst %.xml,%.index, $(DST_XML_FILES))
|
||||||
MK_INDEX_ENTRY := ./engine/mk-index-entry.sh
|
MK_INDEX_ENTRY := ./engine/mk-index-entry.sh
|
||||||
INDEX_CACHE_DIR ?= $(CACHE_DIR)/rss
|
INDEX_CACHE_DIR ?= $(CACHE_DIR)/rss
|
||||||
$(INDEX_CACHE_DIR)/%.index: $(INDEX_CACHE_DIR)/%.xml $(MK_INDEX_ENTRY)
|
$(INDEX_CACHE_DIR)/%.index: $(INDEX_CACHE_DIR)/%.xml $(MK_INDEX_ENTRY) $(ENV_VARS)
|
||||||
@mkdir -p $(INDEX_CACHE_DIR)
|
@mkdir -p $(INDEX_CACHE_DIR)
|
||||||
$(MK_INDEX_ENTRY) "$<" "$@"
|
$(MK_INDEX_ENTRY) "$<" "$@"
|
||||||
|
|
||||||
|
@ -81,8 +81,14 @@ $(HTML_INDEX): $(DST_INDEX_FILES) $(MKINDEX) $(INDEX_TEMPLATE)
|
||||||
index: $(HTML_INDEX)
|
index: $(HTML_INDEX)
|
||||||
ALL += index
|
ALL += index
|
||||||
|
|
||||||
|
ENV_VARS := ./engine/envvars.sh
|
||||||
|
NIX_FILES := ./shell.nix $(shell find nix -type f)
|
||||||
|
$(ENV_VARS): $(NIX_FILES)
|
||||||
|
echo "export PATH=\"${PATH}\"" >> ./engine/envvars.sh
|
||||||
|
ALL += ./engine/envvars.sh
|
||||||
|
|
||||||
# RSS
|
# RSS
|
||||||
DST_RSS_FILES ?= $(patsubst %.xml,%.rss, $(DST_XML_FILES))
|
DST_RSS_FILES ?= $(patsubst %.xml,%.rss, $(DST_XML_FILES)) $(ENV_VARS)
|
||||||
MK_RSS_ENTRY := ./engine/mk-rss-entry.sh
|
MK_RSS_ENTRY := ./engine/mk-rss-entry.sh
|
||||||
$(RSS_CACHE_DIR)/%.rss: $(RSS_CACHE_DIR)/%.xml $(MK_RSS_ENTRY)
|
$(RSS_CACHE_DIR)/%.rss: $(RSS_CACHE_DIR)/%.xml $(MK_RSS_ENTRY)
|
||||||
@mkdir -p $(RSS_CACHE_DIR)
|
@mkdir -p $(RSS_CACHE_DIR)
|
||||||
|
@ -90,7 +96,7 @@ $(RSS_CACHE_DIR)/%.rss: $(RSS_CACHE_DIR)/%.xml $(MK_RSS_ENTRY)
|
||||||
|
|
||||||
RSS := $(DST_DIR)/rss.xml
|
RSS := $(DST_DIR)/rss.xml
|
||||||
MKRSS := engine/mkrss.sh
|
MKRSS := engine/mkrss.sh
|
||||||
$(RSS): $(DST_RSS_FILES) $(MKRSS)
|
$(RSS): $(DST_RSS_FILES) $(MKRSS) $(ENV_VARS)
|
||||||
$(MKRSS)
|
$(MKRSS)
|
||||||
|
|
||||||
.PHONY: rss
|
.PHONY: rss
|
||||||
|
@ -115,7 +121,7 @@ gmi: $(DST_GMI_FILES)
|
||||||
# GEMINI INDEX
|
# GEMINI INDEX
|
||||||
GMI_INDEX := $(DST_DIR)/index.gmi
|
GMI_INDEX := $(DST_DIR)/index.gmi
|
||||||
MK_GMI_INDEX := engine/mk-gemini-index.sh
|
MK_GMI_INDEX := engine/mk-gemini-index.sh
|
||||||
$(GMI_INDEX): $(DST_GMI_FILES) $(MK_GMI_INDEX)
|
$(GMI_INDEX): $(DST_GMI_FILES) $(MK_GMI_INDEX) $(ENV_VARS)
|
||||||
@mkdir -p $(DST_DIR)
|
@mkdir -p $(DST_DIR)
|
||||||
$(MK_GMI_INDEX)
|
$(MK_GMI_INDEX)
|
||||||
ALL += $(GMI_INDEX)
|
ALL += $(GMI_INDEX)
|
||||||
|
|
|
@ -1,6 +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
|
||||||
|
source ./engine/envvars.sh
|
||||||
# Directory
|
# Directory
|
||||||
webdir="_site"
|
webdir="_site"
|
||||||
postsdir="$webdir/posts"
|
postsdir="$webdir/posts"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
cd "$(git rev-parse --show-toplevel)" || exit 1
|
cd "$(git rev-parse --show-toplevel)" || exit 1
|
||||||
|
source ./engine/envvars.sh
|
||||||
xfic="$1"
|
xfic="$1"
|
||||||
dst="$2"
|
dst="$2"
|
||||||
|
|
||||||
|
@ -10,9 +11,11 @@ indexdir=".cache/rss"
|
||||||
dateaccessor='.yyydate'
|
dateaccessor='.yyydate'
|
||||||
# title and keyword shouldn't be changed
|
# title and keyword shouldn't be changed
|
||||||
titleaccessor='title'
|
titleaccessor='title'
|
||||||
|
keywordsaccessor='meta[name=keywords]::attr(content)'
|
||||||
|
|
||||||
finddate(){ < $1 hxselect -c $dateaccessor | sed 's/\[//g;s/\]//g;s/ .*$//' }
|
finddate(){ < $1 hxselect -c $dateaccessor | sed 's/\[//g;s/\]//g;s/ .*$//' }
|
||||||
findtitle(){ < $1 hxselect -c $titleaccessor }
|
findtitle(){ < $1 hxselect -c $titleaccessor }
|
||||||
|
findkeywords(){ < $1 hxselect -c $keywordsaccessor | sed 's/,/ /g' }
|
||||||
|
|
||||||
autoload -U colors && colors
|
autoload -U colors && colors
|
||||||
|
|
||||||
|
@ -20,7 +23,6 @@ blogfile="$(echo "$xfic"|sed 's#.xml$#.html#;s#^'$indexdir'/#posts/#')"
|
||||||
printf "%-30s" $blogfile
|
printf "%-30s" $blogfile
|
||||||
d=$(finddate $xfic)
|
d=$(finddate $xfic)
|
||||||
echo -n " [$d]"
|
echo -n " [$d]"
|
||||||
rssdate=$(formatdate $d)
|
|
||||||
title=$(findtitle $xfic)
|
title=$(findtitle $xfic)
|
||||||
keywords=( $(findkeywords $xfic) )
|
keywords=( $(findkeywords $xfic) )
|
||||||
printf ": %-55s" "$title ($keywords)"
|
printf ": %-55s" "$title ($keywords)"
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
autoload -U colors && colors
|
autoload -U colors && colors
|
||||||
cd "$(git rev-parse --show-toplevel)" || exit 1
|
cd "$(git rev-parse --show-toplevel)" || exit 1
|
||||||
|
source ./engine/envvars.sh
|
||||||
# Directory
|
# Directory
|
||||||
webdir="_site"
|
webdir="_site"
|
||||||
indexfile="$webdir/index.html"
|
indexfile="$webdir/index.html"
|
||||||
|
|
|
@ -1,6 +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
|
||||||
|
source ./engine/envvars.sh
|
||||||
# Directory
|
# Directory
|
||||||
webdir="_site"
|
webdir="_site"
|
||||||
postsdir="$webdir/posts"
|
postsdir="$webdir/posts"
|
||||||
|
|
|
@ -1,6 +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
|
||||||
|
source ./engine/envvars.sh
|
||||||
# Directory
|
# Directory
|
||||||
webdir="_site"
|
webdir="_site"
|
||||||
postsdir="$webdir/posts"
|
postsdir="$webdir/posts"
|
||||||
|
@ -104,4 +105,4 @@ cp -f "$rssfile" "$legacyenrss"
|
||||||
cp -f "$rssfile" "$legacyfrrss"
|
cp -f "$rssfile" "$legacyfrrss"
|
||||||
|
|
||||||
rm -rf $tmpdir
|
rm -rf $tmpdir
|
||||||
echo "* RSS [done]"
|
echo "\* RSS [done]"
|
||||||
|
|
|
@ -1,6 +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
|
||||||
|
source ./engine/envvars.sh
|
||||||
webdir="_optim"
|
webdir="_optim"
|
||||||
|
|
||||||
sizeof() {
|
sizeof() {
|
||||||
|
|
Loading…
Reference in a new issue