Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 24 lines (16 sloc) 0.793 kb
3e05554 @psycotica0 Initial Commit
authored
1
f39eb81 @psycotica0 Changed File Extensions.
authored
2 # This is meant to take the mime files and run them through this tag's template engine to get static html files
ba60928 @psycotica0 Added Next and Previous to Template Input
authored
3 # It also fills in some per-tag info
2c81646 @psycotica0 Added Basic Documentation
authored
4
f39eb81 @psycotica0 Changed File Extensions.
authored
5 tag="${1##*.}"
ba60928 @psycotica0 Added Next and Previous to Template Input
authored
6 base="$(basename "$1" ".$tag")"
7 dependedFile="$base.converted"
f39eb81 @psycotica0 Changed File Extensions.
authored
8
02a6bf5 @psycotica0 Changed Tag Handling
authored
9 redo-ifchange "$dependedFile" "$tag.tagtemplate" "tagindex"
ba60928 @psycotica0 Added Next and Previous to Template Input
authored
10
02a6bf5 @psycotica0 Changed Tag Handling
authored
11 # Find our position for our tag in the index
12 pos="$(grep "^$tag " < "tagindex" | grep -n " ${base}\$" | cut -d ':' -f 1)"
ba60928 @psycotica0 Added Next and Previous to Template Input
authored
13
14 if [ "$pos" -gt 1 ]; then
02a6bf5 @psycotica0 Changed Tag Handling
authored
15 prev="$(grep "^$tag " < "tagindex" | sed -n "$(expr "$pos" - 1)"p | cut -d ' ' -f2-)"
ba60928 @psycotica0 Added Next and Previous to Template Input
authored
16 else
17 prev=""
18 fi
19
20 # Sed returns "" for me when I walk off the edge of the file
02a6bf5 @psycotica0 Changed Tag Handling
authored
21 next="$(grep "^$tag " < "tagindex" | sed -n "$(expr "$pos" + 1)"p | cut -d ' ' -f2-)"
ba60928 @psycotica0 Added Next and Previous to Template Input
authored
22
cb1ce58 @psycotica0 Make the tagtemplates Executable
authored
23 (echo "Next-Link: $next"; echo "Previous-Link: $prev"; cat "$dependedFile") | "./$tag.tagtemplate"
Something went wrong with that request. Please try again.