Browse Source

Fixed logic, style and updated a library.

gh-pages
Franco Masotti 3 years ago
parent
commit
1bb9f79dc3
Signed by: frnmst
GPG Key ID: 24116ED85666780A
  1. 7
      Makefile
  2. 107
      _config.yml
  3. 2
      _includes/comments.html
  4. 12
      _includes/footer.html
  5. 11
      _includes/head.html
  6. 4
      _includes/tag_list.html
  7. 4
      _layouts/compress.html
  8. 4
      _layouts/default.html
  9. 2
      _layouts/post.html
  10. 6
      _pages/feed.xml
  11. 96
      _pages/index.md
  12. 2
      _sass/main.scss

7
Makefile

@ -3,16 +3,17 @@
# Copyright (c) 2017 Franco Masotti.
# See LICENSE file for details.
PORT = 3050
all: build serve
build:
@jekyll build --future -V --safe -t
@jekyll build --trace --strict_front_matter --verbose --safe -t --future
serve:
@jekyll serve
@jekyll serve --future
serve-global:
@jekyll serve --host=0.0.0.0 --port=3050
@jekyll serve --host=0.0.0.0 --port=$(PORT) --future
clean:
@rm -rf _site

107
_config.yml

@ -1,23 +1,36 @@
## Site Info
title: "Blog testing"
description: "My blog testing"
# This should point to your website source.
website_source: https://github.com/frnmst/the-flux-of-thought
# 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: franco.masotti@live.com
website:
# This should point to your website source.
source: https://github.com/frnmst/the-flux-of-thought
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: "0.1.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: "franco.masotti@live.com"
## Site Settings
baseurl: "/the-flux-of-thought" # 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: "/the-flux-of-thought"
# 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
uture: true
## Site Build
highlighter: rouge
@ -27,36 +40,42 @@ kramdown:
sass:
style: :compressed
## Other Params
include: [ "_pages" ]
exclude: [ "LICENSE", "README.md", "CNAME", "vendor", "Gemfile", "Makefile" ]
## Ruby gems
plugins:
- jekyll-sitemap
compress_html:
clippings: all
comments: ["<!-- ", " -->"]
endings: all
ignore:
envs: []
blanklines: false
profile: false
startings: []
## Excerpts
excerpt_enabled: true
excerpt_separator: "<!--more-->"
excerpt_words: 20
excerpts:
enabled: true
start: "<!--excerpt_start-->"
end: "<!--excerpt_end-->"
words: 20
## Tags
min_tag_score: 2
# Set the following to false to avoid limiting the tag links.
limit_tag_links: 16
tags:
score:
min: 2
# 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
## Meta tag options
meta_description_words: 140
meta_excerpt_words: 140
meta_site_description_words: 140
anchor_headings:
enabled: true
character: "&#182;"
min: 1
max: 6
## Anchor headings
anchor_headings_enabled: true
anchor_headings_character: "&#182;"
anchor_headings_min: 1
anchor_headings_max: 6
# Puts the anchor heading before the title if set to true.
anchor_headings_before: false
# Puts the anchor heading before the title if set to true.
before: false
# Keep comments hidden
collections:
@ -114,3 +133,11 @@ defaults:
values:
layout: comment
is_comment: true
## Other Params
include: [ "_pages" ]
exclude: [ "LICENSE", "README.md", "CNAME", "vendor", "Gemfile", "Makefile" ]
## Ruby gems
plugins:
- jekyll-sitemap

2
_includes/comments.html

@ -1,5 +1,5 @@
<div class="comment">
{% 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] %}

12
_includes/footer.html

@ -1,18 +1,18 @@
<div class="footer">
<div class="jekyll-theme-note">
Made using <a href="https://github.com/frnmst/the-flux-of-thought" title="The Flux Of Thought theme by Franco Masotti">The Flux Of Thought</a>
version <a href="{{ site.software_release_base_url }}/{{ site.software_version }}">{{ site.software_version }}</a>
Made using <a href="{{ site.software.home }}" title="The Flux Of Thought theme by Franco Masotti">The Flux Of Thought</a>
version <a href="{{ site.software.release_base_url }}/{{ site.software.version }}">{{ site.software.version }}</a>
</div>
<div class="license">
<a href="{{ site.website_source }}">Website content</a> is released under the
<a href="https://creativecommons.org/licenses/by-sa/4.0/">{{ site.software_license_name }}</a> license
<a href="{{ site.website.source }}">Website content</a> is released under the
<a href="{{ site.website.license.url }}">{{ site.website.license.name }}</a> license
</div>
<div class="copyright">
&copy; {{ site.time | date: '%Y' }} {{ site.author_name }}
&copy; {{ site.time | date: '%Y' }} {{ site.author.name }}
</div>
<div class="badges">
<ul>
<li><a href="https://creativecommons.org/licenses/by-sa/4.0/"><img src="{{ site.baseurl }}/assets/badge-license_cc_by_sa_4_0.svg" alt="{{ site.software_license_name }}"></a></li>
<li><a href="{{ site.website.license.url }}"><img src="{{ site.baseurl }}/assets/badge-license_cc_by_sa_4_0.svg" alt="{{ site.website.license.name }}"></a></li>
<li><a href="https://jekyllrb.com/"><img src="{{ site.baseurl }}/assets/badge-powered_by_jekyll.svg" alt="powered by Jekyll"></a></li>
<li><a href="https://www.gnu.org/philosophy/javascript-trap.en.html"><img src="{{ site.baseurl }}/assets/badge-no_javascript.svg" alt="no JavaScript"></a></li>
<li><a href="https://html.spec.whatwg.org/"><img src="{{ site.baseurl }}/assets/badge-uses_html5.svg" alt="uses HTML5"></a></li>

11
_includes/head.html

@ -9,7 +9,16 @@
<title>{{ site.title }}</title>
{% endif %}
<meta name="description" content="{% 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 %}">
{% 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 %}
<meta name="description" content="{{ meta_description }}">
<link rel="icon" href="{{ site.baseurl }}/assets/favicon.png">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/core.css">

4
_includes/tag_list.html

@ -63,7 +63,7 @@
{% assign sorted_tags = sorted_tags | slice: 0, s %}
{% endif %}
<div class="tag-list">
<div class="tag-list" markdown="0">
<ul>
{% for tag_elements in sorted_tags %}
{% assign tag = tag_elements | split: '|' %}
@ -71,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 %}
<li>
<a href="{{ link }}">{{ tag_name }} [{{ freq }}]</a>

4
_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 %}</{{ _element }}>{% 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: "<pre" %}{% assign _content = "" %}{% for _pre_before in _pre_befores %}{% assign _pres = _pre_before | split: "</pre>" %}{% 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 "</pre>" %}<pre{{ _pres.first }}</pre>{% endif %}{% unless _pre_before contains "</pre>" 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 = " <e;<e; </e>;</e>;</e> ;</e>" | 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 %} <table id="compress_html_profile_{{ site.time | date: "%Y%m%d" }}" class="compress_html_profile"> <thead> <tr> <td>Step <td>Bytes <tbody> <tr> <td>raw <td>{{ content | size }}{% if _profile_endings %} <tr> <td>endings <td>{{ _profile_endings }}{% endif %}{% if _profile_startings %} <tr> <td>startings <td>{{ _profile_startings }}{% endif %}{% if _profile_comments %} <tr> <td>comments <td>{{ _profile_comments }}{% endif %}{% if _profile_collapse %} <tr> <td>collapse <td>{{ _profile_collapse }}{% endif %}{% if _profile_clippings %} <tr> <td>clippings <td>{{ _profile_clippings }}{% endif %} </table>{% 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 %}</{{ _element }}>{% 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: "<pre" %}{% assign _content = "" %}{% for _pre_before in _pre_befores %}{% assign _pres = _pre_before | split: "</pre>" %}{% 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 "</pre>" %}<pre{{ _pres.first }}</pre>{% endif %}{% unless _pre_before contains "</pre>" 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 = " <e;<e; </e>;</e>;</e> ;</e>" | 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 %} <table id="compress_html_profile_{{ site.time | date: "%Y%m%d" }}" class="compress_html_profile"> <thead> <tr> <td>Step <td>Bytes <tbody> <tr> <td>raw <td>{{ content | size }}{% if _profile_endings %} <tr> <td>endings <td>{{ _profile_endings }}{% endif %}{% if _profile_startings %} <tr> <td>startings <td>{{ _profile_startings }}{% endif %}{% if _profile_comments %} <tr> <td>comments <td>{{ _profile_comments }}{% endif %}{% if _profile_collapse %} <tr> <td>collapse <td>{{ _profile_collapse }}{% endif %}{% if _profile_clippings %} <tr> <td>clippings <td>{{ _profile_clippings }}{% endif %} </table>{% endif %}{% endif %}

4
_layouts/default.html

@ -15,8 +15,8 @@ layout: compress
<div id="main"></div>
{% 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 %}

2
_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 %}
<div class="updated-on">WARNING: check front matter <b>updated</b> variable</div>
<div class="updated-on">*** ERROR: check front matter <b>updated</b> variable ***</div>
{% elsif page_date != page_updated %}
<div class="updated-on">Last updated on {{ page.updated | date: '%B %-d, %Y' }}</div>
{% endif %}

6
_pages/feed.xml

@ -11,13 +11,13 @@ permalink: feed.xml
<link href="{{ site.baseurl | append: feed.xml }}" rel="self"/>
<rights>Copyright @
{{ site.time | date: '%Y' }},
{{ site.author_name | xml_escape }}</rights>
{{ site.author.name | xml_escape }}</rights>
<icon>{{ site.baseurl }}/assets/favicon.png</icon>
<author>
<name>{{ site.author_name | xml_escape }}</name>
<name>{{ site.author.name | xml_escape }}</name>
<uri>{{ site.baseurl }}</uri>
<email>{{ site.author_email | xml_escape }}</email>
<email>{{ site.author.email | xml_escape }}</email>
</author>
<updated>{{ site.time | date_to_xmlschema }}</updated>

96
_pages/index.md

@ -5,40 +5,72 @@ excerpt: none
---
{% include tag_list.html %}
<div class="index" markdown="0">
{% assign i=0 | plus: 0 %}
<div class="index" markdown="1">
{% 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 %}
<div markdown="0">
{% comment %}Start list here instead after "Year" to simplify liquid code. This works nonetheless.{%endcomment %}
<ul class="post-list">
<li>
<a href="{{ post.url | prepend: site.baseurl }}.html">
<span class="post-list-metadata">
<span class="post-list-title">{{ post.title }}</span>
<span class="post-list-date">{{ post.date | date: "%b %d" }}</span>
<span class="post-list-div"></span>
{% if site.excerpt_enabled %}
<span class="post-list-excerpt">
{% if post.content contains site.excerpt_separator %}
{{ post.excerpt | strip_html }}
{% else %}
{{ post.excerpt | strip_html | truncatewords: site.excerpt_words }}
{% endif %}
</span>
{% assign open_list = false %}
{% assign current_year=post.date | date: '%Y' %}
{% if post.next %}
{% assign next_year=post.next.date | date: '%Y' %}
{% endif %}
{% if i != 0 %}
{% if post.next %}
{% if current_year != next_year %}
</ul>
{% endif %}
</span>
</a>
</li>
</ul>
{% endif %}
{% endif %}
<div markdown="1">
{% 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 %}
</div>
{% if open_list %}
<ul class="post-list">
{% endif %}
<li>
{% 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 %}
<span class="post-list-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 %}
</span>
{% endcapture %}
<a href="{{ post.url | prepend: site.baseurl }}.html">
<span class="post-list-metadata">
<span class="post-list-title">{{ post.title }}</span>
<span class="post-list-date">{{ post.date | date: "%b %d" }}</span>
<span class="post-list-div"></span>
{{ post_excerpt }}
</span>
</a>
</li>
{% if post.next == false %}
</ul>
{% endif %}
{% assign i=i | plus: 1 %}
{% endfor %}
</div>

2
_sass/main.scss

@ -209,7 +209,7 @@ ul {
margin-bottom: 0.203125em;
margin-left: 0em;
padding: 0;
overflow: hidden;
overflow: hidden;
}
li {