forked from lucachr/pelican-mg
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun.sh
executable file
·44 lines (34 loc) · 1.75 KB
/
run.sh
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/bash
# USAGE: ./run.sh ( install | install_dev | test_ludochaordic )
set -o pipefail -o errexit -o nounset -o xtrace
install () {
./gen_statics_bundles.py || true
}
install_dev () {
sudo npm install -g eslint eslint-plugin-filenames htmlhint stylelint
npm install eslint-config-strict stylelint-config-standard
pip install html5lib html5validator pre-commit
pre-commit install
}
test_ludochaordic () {
cd ..
if ! [ -d pelican-plugins ]; then
git clone https://github.com/getpelican/pelican-plugins.git
cd pelican-plugins
git submodule update --init ctags_generator deadlinks image_process representative_image tag_cloud
cd ..
fi
[ -d ludochaordic ] || git clone https://github.com/Lucas-C/ludochaordic.git
cd ludochaordic
pip install -r requirements.txt
../pelican-mg/gen_imgs_from_mds.py content/*.md
sed -i '/PLUGINS +=/d' publishconf.py
invoke publish -- -D
git checkout HEAD publishconf.py
# Too many missing img alt attributes in thoses:
rm output/street-art-and-hedonogeolostism-in-london.html output/variante-2-joueurs-pour-bang-le-jeu-de-des.html
html5validator --root output/ --ignore-re='.*(Element "eof" not allowed as child of element "p" in this context.|Element "style" not allowed as child of element.*|Text not allowed in element "iframe" in this context.|Attribute "allow" not allowed on element "iframe" at this point.|No "p" element in scope but a "p" end tag seen.|End tag "p" implied, but there were open elements.|Unclosed element "a".|End tag "div" seen, but there were open elements.)' # issue with pelican renderer: <p> contains legally only inline-/inline-block-elements
cp ../pelican-mg/.htmlhintrc output/
htmlhint output/
}
eval "$1"