Minor HTML syntax fixes

This commit is contained in:
Lucas Cimon 2019-02-13 21:50:27 +01:00
parent 8e23860b4f
commit 2332fbdf26
No known key found for this signature in database
GPG Key ID: 08DA831E717571EE
4 changed files with 8 additions and 9 deletions

6
run.sh
View File

@ -5,14 +5,14 @@
set -o pipefail -o errexit -o nounset -o xtrace
install () {
pip install beautifulsoup4 html5lib html5validator markdown pelican pillow
pip install beautifulsoup4 markdown pelican pillow
./gen_statics_bundles.py || true
}
install_dev () {
npm install -g eslint eslint-config-strict eslint-plugin-filenames htmlhint stylelint
npm install stylelint-config-standard
pip install pre-commit
pip install html5lib html5validator pre-commit
pre-commit install
}
@ -33,7 +33,7 @@ test_ludochaordic () {
# 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.|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
html5validator --root output/ --ignore-re='.*(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/

View File

@ -10,8 +10,8 @@
<meta name="twitter:url" content="{{ SITEURL }}/{{ article.url }}" >
<meta itemprop="url" content="{{ SITEURL }}/{{ article.url }}" >
{% if article.summary %}
<meta property="og:description" content="{{ article.summary|striptags|e }}" >
<meta name="twitter:description" content="{{ article.summary|striptags|e }}" >
<meta property="og:description" content="{{ article.summary|striptags|escape }}" >
<meta name="twitter:description" content="{{ article.summary|striptags|escape }}" >
{% endif %}
{% if article.date %}
<meta property="og:article:published_time" content="{{ article.date.strftime('%Y-%m-%d') }}" >

View File

@ -19,9 +19,9 @@
<meta itemprop="image" content="{{ SITEURL }}/{{ META_IMAGE }}">
{% endif %}
{% if page.summary %}
<meta property="og:description" content="{{ page.summary|striptags }}" >
<meta name="twitter:description" content="{{ page.summary|striptags }}" >
<meta itemprop="description" content="{{ page.summary|striptags }}">
<meta property="og:description" content="{{ page.summary|striptags|escape }}" >
<meta name="twitter:description" content="{{ page.summary|striptags|escape }}" >
<meta itemprop="description" content="{{ page.summary|striptags|escape }}">
{% endif %}
{% endblock %}

View File

@ -10,7 +10,6 @@
{% if CATEGORY_SAVE_AS %} • <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>{% endif %}
{% if DISQUS_SITENAME %} • <br class="uk-visible-small"><i class="uk-icon-comment"></i> <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread" itemprop="discussionUrl"></a>{% endif %}
</p>
<!--{{ article.summary }}-->
<p class="uk-article-lead" itemprop="description">{{ article.summary|striptags|striptags }}</p>
{% if not MG_DISABLE_SUMMARY %}<p>{{ ' '.join(article.content.split(' ')[:75])|striptags|striptags }}...</p>{% endif %}
<a href="{{ SITEURL }}/{{ article.url }}">Read More</a>