Adding .pre-commit-config.yaml

This commit is contained in:
Lucas Cimon 2017-08-10 18:30:29 +02:00
parent 6c0b67a3c6
commit 29e3d34afe
15 changed files with 141 additions and 131 deletions

34
.pre-commit-config.yaml Executable file
View File

@ -0,0 +1,34 @@
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: v0.9.1
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
args:
- --no-markdown-linebreak-ext
- repo: git://github.com/Lucas-C/pre-commit-hooks
sha: v1.0.1
hooks:
- id: remove-crlf
exclude: npp/.*\.xml
- id: remove-tabs
- repo: https://github.com/Lucas-C/pre-commit-hooks-html
sha: v1.2.1
hooks:
- id: validate-html
args:
- --remove-mustaches
- --mustache-remover=jinja2
- --templates-include-dir=templates
- "--ignore=Expected \"<!DOCTYPE html>\""
- "--ignore=Element \"title\" must not be empty"
- "--ignore=Element \"head\" is missing a required instance of child element \"title\""
- "--ignore=The \"itemprop\" attribute was specified, but the element is not a property of any item"
- "--ignore=Bad value \"DUMMY\" for attribute \"datetime\""
exclude: templates/tipue_search.html
- repo: local
hooks:
- id: make
name: make
language: system
entry: make
files: ''

View File

@ -2,8 +2,6 @@
{% block title %}Archives{% endblock %}
{% block description %}{% endblock %}
{% include 'common_seo.html' %}
{% block content %}
<div class="uk-width-medium-4-5">
<h1 class="uk-heading-large">Archives</h1>

View File

@ -2,8 +2,6 @@
{% block title %}Categories{% endblock %}
{% block description %}{% endblock %}
{% include 'common_seo.html' %}
{% block content %}
<div class="uk-width-medium-4-5">
<h1 class="uk-heading-large">Categories</h1>

View File

@ -1,5 +1,3 @@
{% extends "index.html" %}
{% block title %}{{ category|capitalize }}{% endblock %}
{% block description %}{% endblock %}
{% include 'common_seo.html' %}

View File

@ -1,16 +0,0 @@
{% block seo %}
<meta property="og:title" content="{{ SITENAME }}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ SITEURL }}" />
<meta name="twitter:url" content="{{ SITEURL }}" />
<meta itemprop="name" content="{{ SITENAME }}">
<meta itemprop="url" content="{{ SITEURL }}">
{% if META_IMAGE %}
<meta property="og:image" content="{{ META_IMAGE }}" />
<meta property="og:image:type" content="{{ META_IMAGE_TYPE }}" />
<meta name="twitter:image" content="{{ META_IMAGE }}" />
<meta itemprop="image" content="{{ META_IMAGE }}"/>
{% endif %}
{% endblock %}

View File

@ -3,7 +3,7 @@
<p class="uk-article-meta"><time datetime="{{ article.date.strftime('%Y-%m-%d') }}" itemprop="datePublished">{{ article.locale_date }}</time><a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>{% 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(' ')[:SUMMARY_MAX_LENGTH ])|striptags|striptags }}...</p>{% endif %}
{% if not MG_DISABLE_SUMMARY %}<p>{{ ' '.join(article.content.split(' ')[:SUMMARY_MAX_LENGTH])|striptags|striptags }}...</p>{% endif %}
<a href="{{ SITEURL }}/{{ article.url }}">Read More</a>
{% include "partials/inline-tags.html" %}
<hr class="uk-article-divider">

View File

@ -2,8 +2,6 @@
{% block title %}Search results{% endblock %}
{% block description %}{% endblock %}
{% include 'common_seo.html' %}
{% block content %}
<div class="uk-width-medium-4-5">
<h1 class="uk-heading-large">Search results</h1>