From 459a13bf79fad103f2305debf849ed25d1e37d34 Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Wed, 12 Feb 2014 11:47:22 +0100 Subject: [PATCH 1/3] HTML error in notmyidea:
  • not allowed in
    .
  • tags need to be inside of
      or
        . Thanks to the w3c_validate plugin for finding this. --- pelican/tests/output/basic/authors.html | 7 +++++-- pelican/tests/output/basic/tags.html | 7 +++++-- pelican/tests/output/custom/authors.html | 7 +++++-- pelican/tests/output/custom/tags.html | 7 +++++-- pelican/themes/notmyidea/templates/authors.html | 4 +++- pelican/themes/notmyidea/templates/tags.html | 5 +++-- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/pelican/tests/output/basic/authors.html b/pelican/tests/output/basic/authors.html index 4022cbab..20df01d2 100644 --- a/pelican/tests/output/basic/authors.html +++ b/pelican/tests/output/basic/authors.html @@ -26,7 +26,10 @@
        -

        Authors on A Pelican Blog

      1. Alexis Métaireau (2)
      2. +

        Authors on A Pelican Blog

        +
        @@ -48,4 +51,4 @@ - \ No newline at end of file + diff --git a/pelican/tests/output/basic/tags.html b/pelican/tests/output/basic/tags.html index 8172f6ae..0eda47d7 100644 --- a/pelican/tests/output/basic/tags.html +++ b/pelican/tests/output/basic/tags.html @@ -26,12 +26,15 @@
        -

        Tags for A Pelican Blog

      3. bar (3)
      4. +

        Tags for A Pelican Blog

        +
        @@ -53,4 +56,4 @@ - \ No newline at end of file + diff --git a/pelican/tests/output/custom/authors.html b/pelican/tests/output/custom/authors.html index eb2becfd..d9aaef34 100644 --- a/pelican/tests/output/custom/authors.html +++ b/pelican/tests/output/custom/authors.html @@ -30,7 +30,10 @@
        -

        Authors on Alexis' log

      5. Alexis Métaireau (10)
      6. +

        Authors on Alexis' log

        +
        @@ -76,4 +79,4 @@ }()); - \ No newline at end of file + diff --git a/pelican/tests/output/custom/tags.html b/pelican/tests/output/custom/tags.html index 2e70c9e8..ba8d53a4 100644 --- a/pelican/tests/output/custom/tags.html +++ b/pelican/tests/output/custom/tags.html @@ -30,12 +30,15 @@
        -

        Tags for Alexis' log

      7. bar (3)
      8. +

        Tags for Alexis' log

        +
        @@ -81,4 +84,4 @@ }()); - \ No newline at end of file + diff --git a/pelican/themes/notmyidea/templates/authors.html b/pelican/themes/notmyidea/templates/authors.html index b145902e..e61a332f 100644 --- a/pelican/themes/notmyidea/templates/authors.html +++ b/pelican/themes/notmyidea/templates/authors.html @@ -6,9 +6,11 @@

        Authors on {{ SITENAME }}

        - {%- for author, articles in authors|sort %} +
          + {% for author, articles in authors|sort %}
        • {{ author }} ({{ articles|count }})
        • {% endfor %} +
        {% endblock %} diff --git a/pelican/themes/notmyidea/templates/tags.html b/pelican/themes/notmyidea/templates/tags.html index 76955f27..fb099557 100644 --- a/pelican/themes/notmyidea/templates/tags.html +++ b/pelican/themes/notmyidea/templates/tags.html @@ -6,10 +6,11 @@

        Tags for {{ SITENAME }}

        - - {%- for tag, articles in tags|sort %} +
          + {% for tag, articles in tags|sort %}
        • {{ tag }} ({{ articles|count }})
        • {% endfor %} +
        {% endblock %} From cff9d0aa5832e2d4c296a8c9b34ac5f88c9b0d3d Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Wed, 12 Feb 2014 12:42:27 +0100 Subject: [PATCH 2/3] Fix stray
      and
  • if only one article is displayed. We already check if loop.length > 1 before outputting
    and
      tags, but we neglected to do the same check when outputting the corresponding end tags. Also, since I had to read the code when I touched it, simplified a conditional: if (a) if (a and (b or not b and c)) can be simplified to if (a) if (b or c) Note the "b or not b", it was just too ugly to not fix. --- pelican/tests/output/basic/category/bar.html | 4 +--- pelican/tests/output/basic/category/yeah.html | 4 +--- pelican/tests/output/basic/tag/foobar.html | 4 +--- pelican/tests/output/basic/tag/yeah.html | 4 +--- pelican/tests/output/custom/category/bar.html | 4 +--- pelican/tests/output/custom/category/yeah.html | 4 +--- pelican/tests/output/custom/tag/foobar.html | 4 +--- pelican/tests/output/custom/tag/yeah.html | 4 +--- pelican/themes/notmyidea/templates/index.html | 11 +++++++---- 9 files changed, 15 insertions(+), 28 deletions(-) diff --git a/pelican/tests/output/basic/category/bar.html b/pelican/tests/output/basic/category/bar.html index 54b1db3e..763cfe77 100644 --- a/pelican/tests/output/basic/category/bar.html +++ b/pelican/tests/output/basic/category/bar.html @@ -46,8 +46,6 @@ YEAH !

      -
    -
    - -
    - -
    - -

    blogroll

    @@ -100,4 +98,4 @@ YEAH !

    }()); - \ No newline at end of file + diff --git a/pelican/tests/output/custom/category/yeah.html b/pelican/tests/output/custom/category/yeah.html index c8e066c8..11fd181d 100644 --- a/pelican/tests/output/custom/category/yeah.html +++ b/pelican/tests/output/custom/category/yeah.html @@ -63,8 +63,6 @@ Page 1 / 1

    - -

    blogroll

    @@ -108,4 +106,4 @@ }()); - \ No newline at end of file + diff --git a/pelican/tests/output/custom/tag/foobar.html b/pelican/tests/output/custom/tag/foobar.html index c62d3418..c224992e 100644 --- a/pelican/tests/output/custom/tag/foobar.html +++ b/pelican/tests/output/custom/tag/foobar.html @@ -63,8 +63,6 @@ Page 1 / 1

    - -

    blogroll

    @@ -108,4 +106,4 @@ }()); - \ No newline at end of file + diff --git a/pelican/tests/output/custom/tag/yeah.html b/pelican/tests/output/custom/tag/yeah.html index 288f4ec7..49c78359 100644 --- a/pelican/tests/output/custom/tag/yeah.html +++ b/pelican/tests/output/custom/tag/yeah.html @@ -55,8 +55,6 @@ YEAH !

    Page 1 / 1

    - -

    blogroll

    @@ -100,4 +98,4 @@ YEAH !

    }()); - \ No newline at end of file + diff --git a/pelican/themes/notmyidea/templates/index.html b/pelican/themes/notmyidea/templates/index.html index 2d45bb2a..c8982476 100644 --- a/pelican/themes/notmyidea/templates/index.html +++ b/pelican/themes/notmyidea/templates/index.html @@ -42,12 +42,15 @@
  • {% endif %} {% if loop.last %} - - {% if loop.last and (articles_page.has_previous() - or not articles_page.has_previous() and loop.length > 1) %} + {% if loop.length > 1 %} + + {% endif %} + {% if articles_page.has_previous() or loop.length > 1 %} {% include 'pagination.html' %} {% endif %} - + {% if loop.length > 1 %} + + {% endif %} {% endif %} {% endfor %} {% else %} From e500e64ebd888d61c555e0eefba8b3ae529b5e63 Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Sun, 9 Feb 2014 15:17:23 +0100 Subject: [PATCH 3/3] Some browsers like Lynx render adjacent links without implicit spaces. Put an extra space at the end of each link to a tag so that Lynx doesnt render the tags as a single word. --- pelican/themes/notmyidea/templates/taglist.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/themes/notmyidea/templates/taglist.html b/pelican/themes/notmyidea/templates/taglist.html index c792fd7d..b8f4ba95 100644 --- a/pelican/themes/notmyidea/templates/taglist.html +++ b/pelican/themes/notmyidea/templates/taglist.html @@ -1,2 +1,2 @@ -{% if article.tags %}

    tags: {% for tag in article.tags %}{{ tag }}{% endfor %}

    {% endif %} +{% if article.tags %}

    tags: {% for tag in article.tags %}{{ tag }} {% endfor %}

    {% endif %} {% if PDF_PROCESSOR %}

    get the pdf

    {% endif %}