Summary Files Commits Branches @commit @diff @stats
path: root / generate.sh
blob: c995b526843711da854e59f030c0a2cf8802bdd5 (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
#! /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
ssg6 src website "Syndamia" "https://syndamia.com"

for file in $(find "./generate-hooks" -type f -name "*.sh"); do
	"$file" website
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
done