diff --git a/_assets/core.scss b/_assets/core.scss index b99fe7c..2b7533e 100644 --- a/_assets/core.scss +++ b/_assets/core.scss @@ -10,7 +10,6 @@ #}; --- -@charset "utf-8"; @import 'main'; @import 'syntax'; diff --git a/_config.yml b/_config.yml index 7b26346..ce4777b 100644 --- a/_config.yml +++ b/_config.yml @@ -1,19 +1,26 @@ -# Site Info +## 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.0.3" +# 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 Info author_name: "Franco Masotti" author_email: volvopolar731@gmail.com -# Site Settings +## 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 future: true -# Site Build +## Site Build highlighter: rouge markdown: kramdown kramdown: @@ -21,27 +28,35 @@ kramdown: sass: style: :compressed -# Other Params +## Other Params include: [ "_pages" ] -exclude: [ "LICENSE", "README.md", "CNAME", "vendor", "Gemfile", "Makefile", "_repository_assets" ] +exclude: [ "LICENSE", "README.md", "CNAME", "vendor", "Gemfile", "Makefile" ] -# Ruby gems +## Ruby gems plugins: - jekyll-sitemap -# Excerpts +## Excerpts excerpt_enabled: true excerpt_separator: "" excerpt_words: 20 -# Tags +## Tags min_tag_score: 3 -# Meta tag options +## 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 + # Keep comments hidden collections: comments: @@ -53,6 +68,7 @@ collections: assets: output: true +## Page names defaults: - scope: @@ -72,7 +88,7 @@ defaults: is_post: true - scope: - path: "_pages/index.html" + path: "_pages/index.md" values: is_home: true - @@ -87,7 +103,7 @@ defaults: is_tags: true - scope: - path: "_pages/sitemap.html" + path: "_pages/sitemap.md" values: is_sitemap: true - diff --git a/_includes/anchor_headings.html b/_includes/anchor_headings.html new file mode 100644 index 0000000..e50cbe6 --- /dev/null +++ b/_includes/anchor_headings.html @@ -0,0 +1,86 @@ +{% capture headingsWorkspace %} + {% comment %} + Version 1.0.0 + https://github.com/allejo/jekyll-anchor-headings + + "Be the pull request you wish to see in the world." ~Ben Balter + + Usage: + {% include anchor_headings.html html=content %} + + Parameters: + * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll + + Optional Parameters: + * beforeHeading (bool) : false - Set to true if the anchor should be placed _before_ the heading's content + * anchorBody (string) : '' - The content that will be placed inside the anchor; the `%heading%` placeholder is available + * anchorClass (string) : '' - The class(es) that will be used for each anchor. Separate multiple classes with a space + * anchorTitle (string) : '' - The `title` attribute that will be used for anchors + * h_min (int) : 1 - The minimum header level to build an anchor for; any header lower than this value will be ignored + * h_max (int) : 6 - The maximum header level to build an anchor for; any header greater than this value will be ignored + + Output: + The original HTML with the addition of anchors inside of all of the h1-h6 headings. + {% endcomment %} + + {% assign minHeader = include.h_min | default: 1 %} + {% assign maxHeader = include.h_max | default: 6 %} + {% assign beforeHeading = include.beforeHeading %} + {% assign nodes = include.html | split: ' + {% if headerLevel < 1 or headerLevel > 6 %} + {% capture edited_headings %}{{ edited_headings }}{{ node }}{% endcapture %} + {% continue %} + {% endif %} + + {% assign _workspace = node | split: '' | first }}>{% endcapture %} + {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %} + + + {% capture anchor %}{% endcapture %} + + {% if html_id and headerLevel >= minHeader and headerLevel <= maxHeader %} + {% capture anchor %}href="#{{ html_id}}"{% endcapture %} + + {% if include.anchorClass %} + {% capture anchor %}{{ anchor }} class="{{ include.anchorClass }}"{% endcapture %} + {% endif %} + + {% if include.anchorTitle %} + {% capture anchor %}{{ anchor }} title="{{ include.anchorTitle | replace: '%heading%', header }}"{% endcapture %} + {% endif %} + + {% capture anchor %}{{ include.anchorBody | replace: '%heading%', header | default: '' | raw }}{% endcapture %} + + {% if beforeHeading %} + {% capture anchor %}{{ anchor }} {% endcapture %} + {% else %} + {% capture anchor %} {{ anchor }}{% endcapture %} + {% endif %} + {% endif %} + + + {% if beforeHeading %} + {% capture _current %}
- Made using Jekyll & - The Flux Of Thought + Made using Jekyll and + The Flux Of Thought + version {{ site.software_version }}
- Website content is released under the + Website content is released under the CC-BY-SA - license + 4.0 license
{{ content }} - diff --git a/_layouts/post.html b/_layouts/post.html index e17d8b6..191e13d 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -21,11 +21,13 @@ layout: default
First written on {{ page.date | date: '%B %-d, %Y' }}
{% assign page_date = page.date | date: '%F' %} {% assign page_updated = page.updated | date: '%F' %} - {% if page_date != page_updated %} + {% if page_updated < page_date %} +
WARNING: check front matter updated variable
+ {% elsif page_date != page_updated %}
Last updated on {{ page.updated | date: '%B %-d, %Y' }}
{% endif %}
-{{ content }} +{% include anchor_headings.html html=content %}
diff --git a/_pages/index.html b/_pages/index.md similarity index 57% rename from _pages/index.html rename to _pages/index.md index a225b94..2da7b76 100644 --- a/_pages/index.html +++ b/_pages/index.md @@ -3,32 +3,34 @@ layout: default permalink: index.html --- -
+
{% for post in site.posts %} {% unless post.next %} -

Year {{ post.date | date: '%Y' }}

+### 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' }}

+### Year {{ post.date | date: '%Y' }} {% endif %} {% endunless %} - - {% endfor %}
diff --git a/_pages/sitemap.html b/_pages/sitemap.md similarity index 54% rename from _pages/sitemap.html rename to _pages/sitemap.md index df9a704..750b9dc 100644 --- a/_pages/sitemap.html +++ b/_pages/sitemap.md @@ -5,25 +5,25 @@ permalink: /sitemap/ --- {% assign site_pages = site.pages | sort %} -

Pages

+### Pages {% if site.posts %} {% assign site_posts = site.posts | sort %} -

Posts

- {% endif %} diff --git a/_sass/main.scss b/_sass/main.scss index 6305b2e..9cefdbb 100644 --- a/_sass/main.scss +++ b/_sass/main.scss @@ -14,6 +14,13 @@ padding-right: 0.8125em; } } + p code { + font-size:0.8125em; + line-height: 2em; + + padding-left: 0.40625em; + padding-right: 0.40625em; + } } /* For desktops */ @@ -40,6 +47,13 @@ padding-right: 1.625em; } } + p code { + font-size:1.1375em; + line-height: 2em; + + padding-left: 0.8125em; + padding-right: 0.8125em; + } } body { @@ -52,13 +66,28 @@ body { word-spacing: 0em; } +p { + code { + font-weight: bold; + border: none; + border-radius: 0.8125em; + box-shadow: inset 0 0 0.8125em grey; + background-color: #e6e6e6; + white-space: pre-wrap; + white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + word-wrap: break-word; /* Internet Explorer 5.5+ */ + } +} + a:hover { transition: 0.3s; } /* Use for abbreviations only. */ abbr { - letter-spacing: 0.1em; + letter-spacing: 0.1em; } blockquote { @@ -363,3 +392,35 @@ img { color: #000000; } } + +/* Tables */ +table { + border-collapse: collapse; +} + +table, th, td { + border: 0.1015625em solid black; +} + +th, td { + padding: 0.40625em; + text-align: left; +} + +th { + background-color: #f2f2f2; +} + +tr:nth-child(even) { + background-color: #f2f2f2; +} + +.hAnchor { + opacity: 0.1; + filter: alpha(opacity=50); /* For IE8 and earlier */ +} + +.hAnchor:hover { + opacity: 1; + filter: alpha(opacity=100); /* For IE8 and earlier */ +}