Browse Source

Updated to version 0.0.3 of the-flux-of-thought.

dev
Franco Masotti 4 years ago
parent
commit
d304655ebf
  1. 1
      _assets/core.scss
  2. 40
      _config.yml
  3. 86
      _includes/anchor_headings.html
  4. 9
      _includes/footer.html
  5. 6
      _layouts/default.html
  6. 1
      _layouts/page.html
  7. 6
      _layouts/post.html
  8. 26
      _pages/index.md
  9. 20
      _pages/sitemap.md
  10. 63
      _sass/main.scss

1
_assets/core.scss

@ -10,7 +10,6 @@
#};
---
@charset "utf-8";
@import 'main';
@import 'syntax';

40
_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: "<!--more-->"
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: "&#182;"
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
-

86
_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: '<h' %}
{% capture edited_headings %}{% endcapture %}
{% for node in nodes %}
{% if node == "" %}
{% continue %}
{% endif %}
{% assign headerLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}
<!-- If the node doesn't have a header, then it's content before the first heading; don't discard it -->
{% if headerLevel < 1 or headerLevel > 6 %}
{% capture edited_headings %}{{ edited_headings }}{{ node }}{% endcapture %}
{% continue %}
{% endif %}
{% assign _workspace = node | split: '</h' %}
{% assign _idWorkspace = _workspace[0] | split: 'id="' %}
{% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
{% assign html_id = _idWorkspace[0] %}
{% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
<!-- Build the anchor to inject for our heading -->
{% 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 %}<a {{ anchor }}>{{ include.anchorBody | replace: '%heading%', header | default: '' | raw }}</a>{% endcapture %}
{% if beforeHeading %}
{% capture anchor %}{{ anchor }} {% endcapture %}
{% else %}
{% capture anchor %} {{ anchor }}{% endcapture %}
{% endif %}
{% endif %}
<!-- The placement of our anchor, before the heading content or after -->
{% if beforeHeading %}
{% capture _current %}<h{{ _hAttrToStrip | raw }}{{ anchor }}{% endcapture %}
{% capture edited_headings %}{{ edited_headings }}{{ node | replace: _hAttrToStrip, _current | raw }}{% endcapture %}
{% else %}
{% capture _current %}<h{{ _workspace | first }}{{ anchor }}</h{{ _workspace | last }}{% endcapture %}
{% capture edited_headings %}{{ edited_headings }}{{ _current }}{% endcapture %}
{% endif %}
{% endfor %}
{% endcapture %}{% assign headingsWorkspace = '' %}{{ edited_headings | strip }}

9
_includes/footer.html

@ -1,12 +1,13 @@
<div class="footer">
<div class="jekyll-theme-note">
Made using <a href="http://jekyllrb.com/">Jekyll</a> &amp;
<a href="https://github.com/frnmst/the-flux-of-thought" title="The Flux Of Thought theme by Franco Masotti">The Flux Of Thought</a>
Made using <a href="http://jekyllrb.com/">Jekyll</a> and
<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>
</div>
<div class="license">
Website content is released under the
<a href="{{ site.website_source }}">Website content</a> is released under the
<a href="https://creativecommons.org/licenses/by-sa/4.0/"><img src="{{ site.baseurl }}/assets/by-sa.svg" alt="CC-BY-SA"></a>
license
4.0 license
</div>
<div class="copyright">
&copy; {{ site.time | date: '%Y' }} {{ site.author_name }}

6
_layouts/default.html

@ -18,7 +18,11 @@ layout: compress
<div id="main"></div>
{% endif %}
{{ content | replace: '&#8617;', '&#8617;&#xfe0e;' }}
{% 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 %}
{% comment %}Can't use == false since page.is_home might be undefined{% endcomment %}
{% if page.is_home != true and page.is_404 != true and page.is_tags != true and page.is_sitemap != true %}

1
_layouts/page.html

@ -7,4 +7,3 @@ layout: default
</div>
{{ content }}

6
_layouts/post.html

@ -21,11 +21,13 @@ layout: default
<div class="written-on">First written on {{ page.date | date: '%B %-d, %Y' }}</div>
{% assign page_date = page.date | date: '%F' %}
{% assign page_updated = page.updated | date: '%F' %}
{% if page_date != page_updated %}
{% if page_updated < page_date %}
<div class="updated-on">WARNING: 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 %}
</div>
<div class="post" id="main">
{{ content }}
{% include anchor_headings.html html=content %}
</div>

26
_pages/index.html → _pages/index.md

@ -3,32 +3,34 @@ layout: default
permalink: index.html
---
<div class="index">
<div class="index" markdown="1">
{% for post in site.posts %}
{% unless post.next %}
<h3>Year {{ post.date | date: '%Y' }}</h3>
### Year {{ post.date | date: '%Y' }}
{% else %}
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
{% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
{% if year != nyear %}
<h3>Year {{ post.date | date: '%Y' }}</h3>
### Year {{ post.date | date: '%Y' }}
{% endif %}
{% endunless %}
<a href="{{ post.url | prepend: site.baseurl }}.html">
<div class="post-list-metadata">
<span class="post-list-title">{{ post.title }}</span>
<span class="post-list-date">{{ post.date | date: "%b %d" }}</span>
<div class="post-list-div"></div>
<div markdown="0">
<a href="{{ post.url | prepend: site.baseurl }}.html">
<div class="post-list-metadata">
<span class="post-list-title">{{ post.title }}</span>
<span class="post-list-date">{{ post.date | date: "%b %d" }}</span>
<div class="post-list-div"></div>
{% if site.excerpt_enabled %}
<div class="post-list-excerpt">
<div 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 %}
</div>
</div>
{% endif %}
</div>
</a>
</div>
</a>
</div>
{% endfor %}
</div>

20
_pages/sitemap.html → _pages/sitemap.md

@ -5,25 +5,25 @@ permalink: /sitemap/
---
{% assign site_pages = site.pages | sort %}
<h3>Pages</h3>
### Pages
<ul>
{% for page in site_pages %}
{% if page.title != 404 %}
<li>
<a href="{{ page.url | prepend: site.baseurl }}">{{ page.title }}</a>
</li>
<li>
<a href="{{ page.url | prepend: site.baseurl }}">{{ page.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% if site.posts %}
{% assign site_posts = site.posts | sort %}
<h3>Posts</h3>
<ul>
### Posts
<ul>
{% for post in site_posts %}
<li>
<a href="{{ post.url | prepend: site.baseurl }}.html">{{ post.title }}</a>
</li>
<li>
<a href="{{ post.url | prepend: site.baseurl }}.html">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
</ul>
{% endif %}

63
_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 */
}

Loading…
Cancel
Save