blob: 8b71947c6cc2bc72441d0a567d9edb3234f03d75 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#! /bin/sh
# Make sure this script is ran as www-data!
# Also, the syndamiadotcom folder MUST be owned by www-data!
if [ ! -d "website" ]; then
mkdir website
fi
# Remove record of previously generated files
rm -f website/.files
# Generate files
ssg src website "Syndamia" "https://syndamia.com"
allnormfiles=$(find './website' -type f -name "*.html")
for script in $(find "./generate-hooks" -type f -name "*.awk"); do
for file in $allnormfiles; do
awk -f "$script" "$file" > tmp && mv -f tmp "$file"
done
done
#
# Tiny version
#
if [ ! -d "tiny.website" ]; then
mkdir tiny.website
fi
# Just take what is already made, no need to regenerate everything
cp -r website/* tiny.website/
# Remove unnecessary files
rm -f tiny.website/*.css
rm -rf tiny.website/fonts/
rm -f tiny.website/.files
# Remove references to stylesheets in all files
for file in $(find "tiny.website" -type f -name "*.html"); do
sed -i 's/^.*stylesheet.*//g' $file
sed -i 's/<\/head>/\t<style>img[src$="svg"] { max-height: 1em; }<\/style>\n<\/head>/' $file
done
|