From c921bafd8b8239c9c29136f591a60799b676050d Mon Sep 17 00:00:00 2001 From: Franco Masotti Date: Sun, 26 Jan 2020 16:36:16 +0100 Subject: [PATCH] Imported fixes from theme version 1.0.0. --- Makefile | 8 +- _assets/badge-no_javascript.svg | 1 + _assets/badge-powered_by_jekyll.svg | 1 + _assets/badge-uses_html5.svg | 1 + _assets/by-sa.svg | 128 ---------------------------- _assets/favicon.png | Bin 418 -> 0 bytes _config.yml | 110 ++++++++++++++---------- _includes/comments.html | 2 +- _includes/footer.html | 19 +++-- _includes/head.html | 11 ++- _includes/tag_list.html | 22 +++-- _layouts/compress.html | 4 +- _layouts/default.html | 4 +- _layouts/post.html | 2 +- _pages/feed.xml | 6 +- _pages/index.md | 96 ++++++++++++++------- _sass/main.scss | 34 +++++--- 17 files changed, 204 insertions(+), 245 deletions(-) create mode 100644 _assets/badge-no_javascript.svg create mode 100644 _assets/badge-powered_by_jekyll.svg create mode 100644 _assets/badge-uses_html5.svg delete mode 100644 _assets/by-sa.svg delete mode 100644 _assets/favicon.png diff --git a/Makefile b/Makefile index acb181d..f3eab1b 100644 --- a/Makefile +++ b/Makefile @@ -4,16 +4,16 @@ # See LICENSE file for details. PORT = 3050 -all: build serve +all: clean build serve-global build: - @jekyll build -V --safe -t --future + @jekyll build --trace --strict_front_matter --verbose --safe -t --future serve: - @jekyll serve --future + @jekyll serve --trace --future serve-global: - @jekyll serve --host=0.0.0.0 --port=$(PORT) --future + @jekyll serve --trace --host=0.0.0.0 --port=$(PORT) --future clean: @rm -rf _site diff --git a/_assets/badge-no_javascript.svg b/_assets/badge-no_javascript.svg new file mode 100644 index 0000000..5e7bce5 --- /dev/null +++ b/_assets/badge-no_javascript.svg @@ -0,0 +1 @@ + nonoJavaScriptJavaScript \ No newline at end of file diff --git a/_assets/badge-powered_by_jekyll.svg b/_assets/badge-powered_by_jekyll.svg new file mode 100644 index 0000000..74bac1e --- /dev/null +++ b/_assets/badge-powered_by_jekyll.svg @@ -0,0 +1 @@ + powered bypowered byJekyllJekyll \ No newline at end of file diff --git a/_assets/badge-uses_html5.svg b/_assets/badge-uses_html5.svg new file mode 100644 index 0000000..1dda790 --- /dev/null +++ b/_assets/badge-uses_html5.svg @@ -0,0 +1 @@ + usesusesHTML5HTML5 \ No newline at end of file diff --git a/_assets/by-sa.svg b/_assets/by-sa.svg deleted file mode 100644 index 7eff17b..0000000 --- a/_assets/by-sa.svg +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - diff --git a/_assets/favicon.png b/_assets/favicon.png deleted file mode 100644 index 7ecf718a0f000d7a949314758bcefa9ed653c564..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 418 zcmV;T0bTxyP)Px$TuDShR7ef&l|8OSKorO4zE&dfQ7BX@R$~)3ptS@$QHq`@?L$i;C`g>^FIRGN zo0-A$@{)U!(Kya;&Tl?E7-O`K+vDeU;tTi%-)8>*t2PXSVTi^h9b1;gq9|hXJd1MK zX)wA>)0EY9&AP4=1|ty{$f2=9sVqxs+m>`)m#uLeS`-B#;y9LtB3~YiPV+q9pyN1_ z=Xt*mhSD7ha*`xRpmH65LYHNsAPC5DoNc(SONye1PDD(#X_~aJ>E`(L==+|AVW4T6 zD9bX^H0?StilHcq0|MA*U{aWz#Gc`I41LhJD}`QY-UDlX%W=Yn+T$QpZgW8+jt-6x z0#F<+3BB*ReAVxTaaka+rYE3s9b+AFJ>r@?36%qfVMtX~T>&NGzmuw}%(iXj`#x)$ zX0?AV9_!~@+q^QX+AZY@C<+OKc@vX;FRWU&FfacL<{7%|{hz6R0;M1& diff --git a/_config.yml b/_config.yml index 27926da..4f9c765 100644 --- a/_config.yml +++ b/_config.yml @@ -1,23 +1,35 @@ ## Site Info title: "Franco Masotti's blog" description: "A blog about libre software experiences and everything else" -# This should point to your website source. -website_source: https://gitlab.com/frnmst/frnmst.gitlab.io -# These should point to the-flux-of-thought repository. -software_version: "0.1.0" -# The following is used along the software_version variable to build the -# software version url. -software_release_base_url: https://github.com/frnmst/the-flux-of-thought/releases/tag - -## Author Info -author_name: "Franco Masotti" -author_email: volvopolar731@gmail.com + +website: + # This should point to your website source. + source: https://gitlab.com/frnmst/frnmst.gitlab.io + license: + url: "https://creativecommons.org/licenses/by-sa/4.0/" + name: "CC-BY-SA 4.0" + +software: + # These should point to the-flux-of-thought repository. + home: https://github.com/frnmst/the-flux-of-thought + version: "1.0.0" + # The following is used along the version variable to build the + # software version url. + release_base_url: "https://github.com/frnmst/the-flux-of-thought/releases/tag" + +author: + name: "Franco Masotti" + email: "volvopolar731@gmail.com" ## Site Settings -baseurl: "" # Base URL must end WITHOUT a slash, default: "" -permalink: /notes/:title # Post permalink. If you change this you must - # modify all the occurencies manually. -timezone: Europe/Rome # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones +# Base URL must end WITHOUT a slash, default: "" +baseurl: "" + +# Post permalink. If you change this you must +# modify all the occurencies manually. +permalink: /notes/:title +# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones +timezone: Europe/Rome future: true ## Site Build @@ -28,36 +40,41 @@ kramdown: sass: style: :compressed -## Other Params -include: [ "_pages" ] -exclude: [ "LICENSE", "README.md", "CNAME", "vendor", "Gemfile", "Makefile" ] +compress_html: + clippings: all + comments: [""] + endings: all + ignore: + envs: [] + blanklines: false + profile: false + startings: [] -## Ruby gems -plugins: - - jekyll-sitemap +excerpts: + enabled: true + start: "" + end: "" + words: 20 -## Excerpts -excerpt_enabled: true -excerpt_separator: "" -excerpt_words: 20 - -## Tags -min_tag_score: 4 -# Set the following to false to avoid limiting the tag links. -limit_tag_links: 16 - -## Meta tag options -meta_description_words: 140 -meta_excerpt_words: 140 -meta_site_description_words: 140 - -## Anchor headings -anchor_headings_enabled: true -anchor_headings_character: "¶" -anchor_headings_min: 1 -anchor_headings_max: 6 -# Puts the anchor heading before the title if set to true. -anchor_headings_before: false +tag_list: + score: + min: 4 + # Set the following to false to avoid limiting the tag links. + link_limit: 16 + +meta: + description_words: 140 + excerpt_words: 140 + site_description_words: 140 + +anchor_headings: + enabled: true + character: "¶" + min: 1 + max: 6 + + # Puts the anchor heading before the title if set to true. + before: false # Keep comments hidden collections: @@ -116,3 +133,10 @@ defaults: layout: comment is_comment: true +## Other Params +include: [ "_pages" ] +exclude: [ "LICENSE", "README.md", "CNAME", "vendor", "Gemfile", "Makefile" ] + +## Ruby gems +plugins: + - jekyll-sitemap diff --git a/_includes/comments.html b/_includes/comments.html index 5d79f19..af5075f 100644 --- a/_includes/comments.html +++ b/_includes/comments.html @@ -1,5 +1,5 @@
- {% capture mail %}{{ site.author_email }}{% endcapture %} + {% capture mail %}{{ site.author.email }}{% endcapture %} {% assign mail_substring = mail | split: '@' %} {% assign mail_username = mail_substring[0] %} {% assign mail_domain = mail_substring[1] %} diff --git a/_includes/footer.html b/_includes/footer.html index 6413802..73e5d4b 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,15 +1,20 @@ diff --git a/_includes/head.html b/_includes/head.html index ecc01db..3f5ceea 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -9,7 +9,16 @@ {{ site.title }} {% endif %} - +{% capture meta_description %} + {% if page.description %} + {{ page.description | truncate: site.meta.description_words }} + {% else if page.excerpt %} + {{ page.excerpt | strip_html | strip_newlines | truncate: site.meta.excerpt_words }} + {% else %} + {{ site.description | truncate: site.meta.description_words }} + {% endif %} +{% endcapture %} + diff --git a/_includes/tag_list.html b/_includes/tag_list.html index 06a8a08..e5c05af 100644 --- a/_includes/tag_list.html +++ b/_includes/tag_list.html @@ -1,7 +1,5 @@ -{% comment %}The following structure is - the one used in the sorting: - sort by tag frequency and by name after building a - data structure, like this: +{% comment %}Sort decreasingly, alphabetically by tag frequency and by name. + After building a data structure like this: frequency|tag name ================== @@ -9,13 +7,19 @@ 010000|anothertag 000010|three 000010|four + 000010|six + 000010|five + + it becomes: frequency|tag_name ================== - becomes: 000008|mytag - 000010|four - 000010|three 010000|anothertag + 000010|six + 000010|three + 000010|four + 000010|five + 000008|mytag where the number of leading zeros for each frequency is computed with: base_ten_power = len(str(max(number_of_posts_per_tag))) + 1 @@ -59,7 +63,7 @@ {% assign sorted_tags = sorted_tags | slice: 0, s %} {% endif %} -
+
    {% for tag_elements in sorted_tags %} {% assign tag = tag_elements | split: '|' %} @@ -67,7 +71,7 @@ {% assign tagg = tag_name | slugify %} {% assign freq = tag[0] | plus: 0 %} {% if page.is_home %} - {% if freq >= site.min_tag_score %} + {% if freq >= site.tag_list.score.min %} {% capture link %}{{ site.baseurl }}/tags/#{{ tagg }}{% endcapture %}
  • {{ tag_name }} [{{ freq }}] diff --git a/_layouts/compress.html b/_layouts/compress.html index 8248010..bb34487 100644 --- a/_layouts/compress.html +++ b/_layouts/compress.html @@ -1,10 +1,10 @@ --- # Jekyll layout that compresses HTML -# v3.0.2 +# v3.1.0 # http://jch.penibelst.de/ # © 2014–2015 Anatol Broder # MIT License --- {% capture _LINE_FEED %} -{% endcapture %}{% if site.compress_html.ignore.envs contains jekyll.environment %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% assign _profile = site.compress_html.profile %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd p rt rp optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% for _element in site.compress_html.startings %}{% capture _start %}<{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _start %}{% endfor %}{% if _profile and site.compress_html.startings %}{% assign _profile_startings = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.comments == "all" %}{% assign _comments = "" | split: " " %}{% else %}{% assign _comments = site.compress_html.comments %}{% endif %}{% if _comments.size == 2 %}{% capture _comment_befores %}.{{ _content }}{% endcapture %}{% assign _comment_befores = _comment_befores | split: _comments.first %}{% for _comment_before in _comment_befores %}{% if forloop.first %}{% continue %}{% endif %}{% capture _comment_outside %}{% if _carry %}{{ _comments.first }}{% endif %}{{ _comment_before }}{% endcapture %}{% capture _comment %}{% unless _carry %}{{ _comments.first }}{% endunless %}{{ _comment_outside | split: _comments.last | first }}{% if _comment_outside contains _comments.last %}{{ _comments.last }}{% assign _carry = false %}{% else %}{% assign _carry = true %}{% endif %}{% endcapture %}{% assign _content = _content | remove_first: _comment %}{% endfor %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% assign _pre_befores = _content | split: "" %}{% assign _pres_after = "" %}{% if _pres.size != 0 %}{% if site.compress_html.blanklines %}{% assign _lines = _pres.last | split: _LINE_FEED %}{% capture _pres_after %}{% for _line in _lines %}{% assign _trimmed = _line | split: " " | join: " " %}{% if _trimmed != empty or forloop.last %}{% unless forloop.first %}{{ _LINE_FEED }}{% endunless %}{{ _line }}{% endif %}{% endfor %}{% endcapture %}{% else %}{% assign _pres_after = _pres.last | split: " " | join: " " %}{% endif %}{% endif %}{% capture _content %}{{ _content }}{% if _pre_before contains "" %}{% endif %}{% unless _pre_before contains "" and _pres.size == 1 %}{{ _pres_after }}{% endunless %}{% endcapture %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " ;; ;" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{% if _profile and _clippings %}{% assign _profile_clippings = _content | size | plus: 1 %}{% endif %}{{ _content }}{% if _profile %}
    Step Bytes
    raw {{ content | size }}{% if _profile_endings %}
    endings {{ _profile_endings }}{% endif %}{% if _profile_startings %}
    startings {{ _profile_startings }}{% endif %}{% if _profile_comments %}
    comments {{ _profile_comments }}{% endif %}{% if _profile_collapse %}
    collapse {{ _profile_collapse }}{% endif %}{% if _profile_clippings %}
    clippings {{ _profile_clippings }}{% endif %}
    {% endif %}{% endif %} +{% endcapture %}{% if site.compress_html.ignore.envs contains jekyll.environment or site.compress_html.ignore.envs == "all" %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% assign _profile = site.compress_html.profile %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% for _element in site.compress_html.startings %}{% capture _start %}<{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _start %}{% endfor %}{% if _profile and site.compress_html.startings %}{% assign _profile_startings = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.comments == "all" %}{% assign _comments = "" | split: " " %}{% else %}{% assign _comments = site.compress_html.comments %}{% endif %}{% if _comments.size == 2 %}{% capture _comment_befores %}.{{ _content }}{% endcapture %}{% assign _comment_befores = _comment_befores | split: _comments.first %}{% for _comment_before in _comment_befores %}{% if forloop.first %}{% continue %}{% endif %}{% capture _comment_outside %}{% if _carry %}{{ _comments.first }}{% endif %}{{ _comment_before }}{% endcapture %}{% capture _comment %}{% unless _carry %}{{ _comments.first }}{% endunless %}{{ _comment_outside | split: _comments.last | first }}{% if _comment_outside contains _comments.last %}{{ _comments.last }}{% assign _carry = false %}{% else %}{% assign _carry = true %}{% endif %}{% endcapture %}{% assign _content = _content | remove_first: _comment %}{% endfor %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% assign _pre_befores = _content | split: "" %}{% assign _pres_after = "" %}{% if _pres.size != 0 %}{% if site.compress_html.blanklines %}{% assign _lines = _pres.last | split: _LINE_FEED %}{% capture _pres_after %}{% for _line in _lines %}{% assign _trimmed = _line | split: " " | join: " " %}{% if _trimmed != empty or forloop.last %}{% unless forloop.first %}{{ _LINE_FEED }}{% endunless %}{{ _line }}{% endif %}{% endfor %}{% endcapture %}{% else %}{% assign _pres_after = _pres.last | split: " " | join: " " %}{% endif %}{% endif %}{% capture _content %}{{ _content }}{% if _pre_before contains "" %}{% endif %}{% unless _pre_before contains "" and _pres.size == 1 %}{{ _pres_after }}{% endunless %}{% endcapture %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " ;; ;" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{% if _profile and _clippings %}{% assign _profile_clippings = _content | size | plus: 1 %}{% endif %}{{ _content }}{% if _profile %}
    Step Bytes
    raw {{ content | size }}{% if _profile_endings %}
    endings {{ _profile_endings }}{% endif %}{% if _profile_startings %}
    startings {{ _profile_startings }}{% endif %}{% if _profile_comments %}
    comments {{ _profile_comments }}{% endif %}{% if _profile_collapse %}
    collapse {{ _profile_collapse }}{% endif %}{% if _profile_clippings %}
    clippings {{ _profile_clippings }}{% endif %}
    {% endif %}{% endif %} diff --git a/_layouts/default.html b/_layouts/default.html index dbdad29..9479d40 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -15,8 +15,8 @@ layout: compress
    {% endif %} - {% if site.anchor_headings_enabled %} - {% include anchor_headings.html html=content anchorBody=site.anchor_headings_character anchorClass="hAnchor" h_min=site.anchor_headings_min h_max=site.anchor_headings_max beforeHeading=site.anchor_headings_before %} + {% if site.anchor_headings.enabled %} + {% include anchor_headings.html html=content anchorBody=site.anchor_headings.character anchorClass="hAnchor" h_min=site.anchor_headings.min h_max=site.anchor_headings.max beforeHeading=site.anchor_headings.before %} {% else %} {{ content }} {% endif %} diff --git a/_layouts/post.html b/_layouts/post.html index 6a1a535..7c3c4a5 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -8,7 +8,7 @@ layout: default {% assign page_date = page.date | date: '%F' %} {% assign page_updated = page.updated | date: '%F' %} {% if page_updated < page_date %} -
    WARNING: check front matter updated variable
    +
    *** ERROR: check front matter updated variable ***
    {% elsif page_date != page_updated %}
    Last updated on {{ page.updated | date: '%B %-d, %Y' }}
    {% endif %} diff --git a/_pages/feed.xml b/_pages/feed.xml index ddadfdd..aa20e3c 100644 --- a/_pages/feed.xml +++ b/_pages/feed.xml @@ -11,13 +11,13 @@ permalink: feed.xml Copyright @ {{ site.time | date: '%Y' }}, - {{ site.author_name | xml_escape }} + {{ site.author.name | xml_escape }} {{ site.baseurl }}/assets/favicon.png - {{ site.author_name | xml_escape }} + {{ site.author.name | xml_escape }} {{ site.baseurl }} - {{ site.author_email | xml_escape }} + {{ site.author.email | xml_escape }} {{ site.time | date_to_xmlschema }} diff --git a/_pages/index.md b/_pages/index.md index 37aa54c..0debc99 100644 --- a/_pages/index.md +++ b/_pages/index.md @@ -5,40 +5,72 @@ excerpt: none --- {% include tag_list.html %} + +
    +{% assign i=0 | plus: 0 %} -
    {% for post in site.posts %} - {% unless post.next %} -### Year {{ post.date | date: '%Y' }} - {% else %} - {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %} - {% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %} - {% if year != nyear %} -### Year {{ post.date | date: '%Y' }} - {% endif %} - {% endunless %} -
  • -
+ {% endif %} + {% endif %} + +
+ {% if i == 0 %} +### Year {{ current_year }} + {% assign open_list = true %} + {% elsif post.next %} + {% if current_year != next_year %} +### Year {{ current_year }} + {% assign open_list = true %} + {% endif %} + {% endif %}
+ + {% if open_list %} +
    + {% endif %} + +
  • + +{% comment %}See http://frontendcollisionblog.com/jekyll/snippet/2015/03/23/how-to-show-a-summary-of-your-post-with-jekyll.html + which is released under the MIT license, Copyright (c) 2015 Joshua Beam +{% endcomment %} +{% capture post_excerpt %} + +{% if post.content contains site.excerpts.start and post.content contains site.excerpts.end %} + {% assign start=post.content | split: site.excerpts.start | last %} + {% assign end=start | split: site.excerpts.end | first %} + {{ end | strip_html }} +{% else %} + {{ post.content | strip_html | truncatewords: site.excerpts.words }} +{% endif %} + +{% endcapture %} + + + + +
  • + + {% if post.next == false %} +
+ {% endif %} + + {% assign i=i | plus: 1 %} {% endfor %} -
diff --git a/_sass/main.scss b/_sass/main.scss index cf59e78..a9ca873 100644 --- a/_sass/main.scss +++ b/_sass/main.scss @@ -203,6 +203,28 @@ ul { } } +.badges { + ul { + margin-top: 0.203125em; + margin-bottom: 0.203125em; + margin-left: 0em; + padding: 0; + overflow: hidden; + display: flex; + } + + li { + display: block; + float: left; + margin-left: 0.203125em; + } + + img { + padding: 0; + margin: 0; + } +} + .top, .page-navigation { ul { font-size: 0.8125em; @@ -342,18 +364,6 @@ ul { } .footer { - .license { - font-weight: bold; - img { - /* Align the CC BY SA image with the text. */ - max-width: 100%; - height: auto; - display: inline; - margin-right: none; - margin-left: none; - margin-bottom: -0.203125em; - } - } font-size: 0.8125em; }