pelican-mg/run.sh

43 lines
1.7 KiB
Bash
Raw Normal View History

2017-12-02 23:59:03 +00:00
#!/bin/bash
2017-12-03 00:08:21 +00:00
# USAGE: ./run.sh ( install | test_ludochaordic )
2017-12-02 23:59:03 +00:00
set -o pipefail -o errexit -o nounset -o xtrace
install () {
2019-02-13 20:50:27 +00:00
pip install beautifulsoup4 markdown pelican pillow
2019-02-13 19:13:31 +00:00
./gen_statics_bundles.py || true
2017-12-04 22:53:23 +00:00
}
install_dev () {
2019-02-13 20:02:26 +00:00
npm install -g eslint eslint-config-strict eslint-plugin-filenames htmlhint stylelint
2017-12-05 08:04:20 +00:00
npm install stylelint-config-standard
2019-02-13 20:50:27 +00:00
pip install html5lib html5validator pre-commit
2017-12-02 23:59:03 +00:00
pre-commit install
}
test_ludochaordic () {
cd ..
2019-02-13 20:02:26 +00:00
if ! [ -d pelican-plugins ]; then
git clone https://github.com/getpelican/pelican-plugins.git
cd pelican-plugins
git submodule update --init image_process representative_image tag_cloud
cd ..
fi
[ -d ludochaordic ] || git clone https://github.com/Lucas-C/ludochaordic.git
2017-12-02 23:59:03 +00:00
cd ludochaordic
2017-12-03 00:03:01 +00:00
../pelican-mg/gen_imgs_from_mds.py content/*.md
2018-02-16 00:47:25 +00:00
make DEBUG=1 OUTPUTDIR=output publish
2017-12-02 23:59:03 +00:00
2018-02-17 00:44:26 +00:00
# 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
2017-12-05 08:04:20 +00:00
2017-12-03 16:34:54 +00:00
cp ../pelican-mg/.htmlhintrc output/
2017-12-02 23:59:03 +00:00
htmlhint output/
}
eval "$1"