From 8e23860b4ff5fc8922df2fd3289750a4b9267610 Mon Sep 17 00:00:00 2001 From: Lucas Cimon Date: Wed, 13 Feb 2019 21:02:26 +0100 Subject: [PATCH] Renommage bundle JS --- run.sh | 22 +++++------ ...E-0-MG_FILTER_TAGS-0-SHORTSHA1-12d0265.js} | 0 ...E-0-MG_FILTER_TAGS-1-SHORTSHA1-12d0265.js} | 39 +++++++++++-------- ...E-1-MG_FILTER_TAGS-0-SHORTSHA1-12d0265.js} | 0 ...E-1-MG_FILTER_TAGS-1-SHORTSHA1-12d0265.js} | 39 +++++++++++-------- 5 files changed, 54 insertions(+), 46 deletions(-) rename static/{bundle-SHARE-0-MG_FILTER_TAGS-0-SHORTSHA1-efddc02.js => bundle-SHARE-0-MG_FILTER_TAGS-0-SHORTSHA1-12d0265.js} (100%) rename static/{bundle-SHARE-0-MG_FILTER_TAGS-1-SHORTSHA1-efddc02.js => bundle-SHARE-0-MG_FILTER_TAGS-1-SHORTSHA1-12d0265.js} (99%) rename static/{bundle-SHARE-1-MG_FILTER_TAGS-0-SHORTSHA1-efddc02.js => bundle-SHARE-1-MG_FILTER_TAGS-0-SHORTSHA1-12d0265.js} (100%) rename static/{bundle-SHARE-1-MG_FILTER_TAGS-1-SHORTSHA1-efddc02.js => bundle-SHARE-1-MG_FILTER_TAGS-1-SHORTSHA1-12d0265.js} (99%) diff --git a/run.sh b/run.sh index e67cc10..cff5ab8 100755 --- a/run.sh +++ b/run.sh @@ -5,12 +5,12 @@ set -o pipefail -o errexit -o nounset -o xtrace install () { - pip install pelican markdown beautifulsoup4 pillow + pip install beautifulsoup4 html5lib html5validator markdown pelican pillow ./gen_statics_bundles.py || true } install_dev () { - npm install -g eslint eslint-config-strict eslint-plugin-filenames stylelint + npm install -g eslint eslint-config-strict eslint-plugin-filenames htmlhint stylelint npm install stylelint-config-standard pip install pre-commit pre-commit install @@ -18,24 +18,22 @@ install_dev () { test_ludochaordic () { cd .. - git clone https://github.com/getpelican/pelican-plugins.git - cd pelican-plugins - git submodule update --init image_process representative_image tag_cloud - - cd .. - git clone https://github.com/Lucas-C/ludochaordic.git + 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 cd ludochaordic - npm install -g htmlhint - pip install html5lib html5validator - ../pelican-mg/gen_imgs_from_mds.py content/*.md make DEBUG=1 OUTPUTDIR=output publish # 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 "style" not allowed as child of element.*|Text not allowed in element "iframe" in this context.|No "p" element in scope but a "p" end tag seen.)' # issue with pelican renderer:

contains legally only inline-/inline-block-elements + html5validator --root output/ --ignore-re='.*(Element "style" not allowed as child of element.*|Text not allowed in element "iframe" in this context.|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:

contains legally only inline-/inline-block-elements cp ../pelican-mg/.htmlhintrc output/ htmlhint output/ diff --git a/static/bundle-SHARE-0-MG_FILTER_TAGS-0-SHORTSHA1-efddc02.js b/static/bundle-SHARE-0-MG_FILTER_TAGS-0-SHORTSHA1-12d0265.js similarity index 100% rename from static/bundle-SHARE-0-MG_FILTER_TAGS-0-SHORTSHA1-efddc02.js rename to static/bundle-SHARE-0-MG_FILTER_TAGS-0-SHORTSHA1-12d0265.js diff --git a/static/bundle-SHARE-0-MG_FILTER_TAGS-1-SHORTSHA1-efddc02.js b/static/bundle-SHARE-0-MG_FILTER_TAGS-1-SHORTSHA1-12d0265.js similarity index 99% rename from static/bundle-SHARE-0-MG_FILTER_TAGS-1-SHORTSHA1-efddc02.js rename to static/bundle-SHARE-0-MG_FILTER_TAGS-1-SHORTSHA1-12d0265.js index 4dcb678..435e1c8 100644 --- a/static/bundle-SHARE-0-MG_FILTER_TAGS-1-SHORTSHA1-efddc02.js +++ b/static/bundle-SHARE-0-MG_FILTER_TAGS-1-SHORTSHA1-12d0265.js @@ -21,13 +21,15 @@ if(e=u.split("-"),h=d[u]?d[u]:d["bottom-left"],this.justified&&this.justified.le window.tagFilters = {}; function parseQuery(queryString) { - let query = {}; - (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&').forEach(pair => { - pair = pair.split('='); - let name = decodeURIComponent(pair[0]); - let values = decodeURIComponent(pair[1] || '').split(','); - if (!query[name]) { query[name] = []; } - Array.prototype.push.apply(query[name], values); + const query = {}; + (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&').forEach((pair) => { + pair = pair.split('='); + const name = decodeURIComponent(pair[0]); + const values = decodeURIComponent(pair[1] || '').split(','); + if (!query[name]) { + query[name] = []; + } + Array.prototype.push.apply(query[name], values); }); return query; } @@ -97,18 +99,21 @@ if(e=u.split("-"),h=d[u]?d[u]:d["bottom-left"],this.justified&&this.justified.le updateArticlesVisibility(); }; - // This is a bit redundant with /tag/$tag.html pages, but is slightly more powerful as it allow to combine multiple filters - let queryParams = parseQuery(window.location.search); - for (let [qpName, qpValue] of Object.entries(queryParams)) { - if (!qpValue) { continue; } + // This is a bit redundant with /tag/$tag.html pages, + // but is slightly more powerful as it allow to combine multiple filters + const queryParams = parseQuery(window.location.search); + for (const [ qpName, qpValue ] of Object.entries(queryParams)) { + if (!qpValue) { + continue; + } if (qpName === 'lang') { - let buttonElem = document.getElementById('lang-tag-filter'); - window.toggleLangTagFilter.bind(buttonElem)(qpValue[0]); + const buttonElem = document.getElementById('lang-tag-filter'); + window.toggleLangTagFilter.bind(buttonElem)(qpValue[0]); } else if (qpName === 'tags') { - qpValue.forEach(tag => { - let buttonElem = document.getElementById(tag + '-tag-filter'); - window.toggleTagFilter.bind(buttonElem)(tag); - }); + qpValue.forEach((tag) => { + const buttonElem = document.getElementById(`${ tag }-tag-filter`); + window.toggleTagFilter.bind(buttonElem)(tag); + }); } } }()); diff --git a/static/bundle-SHARE-1-MG_FILTER_TAGS-0-SHORTSHA1-efddc02.js b/static/bundle-SHARE-1-MG_FILTER_TAGS-0-SHORTSHA1-12d0265.js similarity index 100% rename from static/bundle-SHARE-1-MG_FILTER_TAGS-0-SHORTSHA1-efddc02.js rename to static/bundle-SHARE-1-MG_FILTER_TAGS-0-SHORTSHA1-12d0265.js diff --git a/static/bundle-SHARE-1-MG_FILTER_TAGS-1-SHORTSHA1-efddc02.js b/static/bundle-SHARE-1-MG_FILTER_TAGS-1-SHORTSHA1-12d0265.js similarity index 99% rename from static/bundle-SHARE-1-MG_FILTER_TAGS-1-SHORTSHA1-efddc02.js rename to static/bundle-SHARE-1-MG_FILTER_TAGS-1-SHORTSHA1-12d0265.js index b4a4a50..0ce2d6c 100644 --- a/static/bundle-SHARE-1-MG_FILTER_TAGS-1-SHORTSHA1-efddc02.js +++ b/static/bundle-SHARE-1-MG_FILTER_TAGS-1-SHORTSHA1-12d0265.js @@ -267,13 +267,15 @@ $(document).ready(() => { window.tagFilters = {}; function parseQuery(queryString) { - let query = {}; - (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&').forEach(pair => { - pair = pair.split('='); - let name = decodeURIComponent(pair[0]); - let values = decodeURIComponent(pair[1] || '').split(','); - if (!query[name]) { query[name] = []; } - Array.prototype.push.apply(query[name], values); + const query = {}; + (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&').forEach((pair) => { + pair = pair.split('='); + const name = decodeURIComponent(pair[0]); + const values = decodeURIComponent(pair[1] || '').split(','); + if (!query[name]) { + query[name] = []; + } + Array.prototype.push.apply(query[name], values); }); return query; } @@ -343,18 +345,21 @@ $(document).ready(() => { updateArticlesVisibility(); }; - // This is a bit redundant with /tag/$tag.html pages, but is slightly more powerful as it allow to combine multiple filters - let queryParams = parseQuery(window.location.search); - for (let [qpName, qpValue] of Object.entries(queryParams)) { - if (!qpValue) { continue; } + // This is a bit redundant with /tag/$tag.html pages, + // but is slightly more powerful as it allow to combine multiple filters + const queryParams = parseQuery(window.location.search); + for (const [ qpName, qpValue ] of Object.entries(queryParams)) { + if (!qpValue) { + continue; + } if (qpName === 'lang') { - let buttonElem = document.getElementById('lang-tag-filter'); - window.toggleLangTagFilter.bind(buttonElem)(qpValue[0]); + const buttonElem = document.getElementById('lang-tag-filter'); + window.toggleLangTagFilter.bind(buttonElem)(qpValue[0]); } else if (qpName === 'tags') { - qpValue.forEach(tag => { - let buttonElem = document.getElementById(tag + '-tag-filter'); - window.toggleTagFilter.bind(buttonElem)(tag); - }); + qpValue.forEach((tag) => { + const buttonElem = document.getElementById(`${ tag }-tag-filter`); + window.toggleTagFilter.bind(buttonElem)(tag); + }); } } }());