featherweight 0.5.3 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03c3d95079bb8b7b9680475eb861d0fff2edbbe6e7a17d0ae439ceebdb56dce5
4
- data.tar.gz: 342a697a6561651b786735e20385e386e9b7f7a8718b7225c552260e36e54309
3
+ metadata.gz: 1c7a84501abb0700793c092d7c5d00d7d1c3c8fb1d2a1176d87d97e068abc13e
4
+ data.tar.gz: 27589dd3e2807970dc7dffeb5507e8255d1bd1e9b730e77dc89f693f484e3aec
5
5
  SHA512:
6
- metadata.gz: 7216a6585415c21bebe5a40d3858529ac49e6745ff83d938289caa3441c9835dbebe9b7cbbde0e6b92708b1633adff34c43c896b813c66ea49b2b779f5d4a1c8
7
- data.tar.gz: 33391869578680845b6d0ed652580f2c5c972c96b77570f5291d1040918f14db43b06c01b35dbf7a7238a3965bc114b3bcb3934cf4f173be4eb24bb3b9c1911e
6
+ metadata.gz: 7f33c3c20d452b0cc8c387ef6d94e481ae9e2e3b84e504babb6f70931d894352298325e523e77f1d32af3f4348eb6e3f91e5fab6fa2b41ebc181bf082d2db265
7
+ data.tar.gz: 9e4aa2c11cb207346547af0c1b442d3121aae9fff9effe9938866b8bac3cad1bab35ee9c878587ae8fb50023745d2312d5795b29d3c7ae80235370bd39a26526
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  #### Building on GitHub
8
8
 
9
- If you're using this site on GitHub pages, the built-in build action won't run gems outside of the [supported plugins list](https://pages.github.com/versions/), e.g.: the `jekyll-loading-lazy` gem (which adds `loading="lazy"` tags to `iframes` and `img` tags, enabling faster initial page loads).
9
+ If you're using this site on GitHub pages, the built-in build action won't run gems outside of the [supported plugins list](https://pages.github.com/versions/).
10
10
 
11
11
  To enable these gems, use the `build_and_deploy.yml` action under `.github/workflows` to automatically build your site on pushes, which circumvents this restriction while still hosting using GitHub pages (as advised by [Jekyll](https://jekyllrb.com/docs/continuous-integration/github-actions/)).
12
12
 
@@ -19,6 +19,8 @@ Create a blank `.md` file in `_pages/`, and add:
19
19
  ---
20
20
  layout: post
21
21
  title: My blog post.
22
+ description: A description of the post, used for metadata.
23
+ image: (optional) an image to display when linking to the post on e.g.: Twitter or Facebook
22
24
  ---
23
25
  ```
24
26
 
@@ -30,12 +32,32 @@ When naming blog post files, use the `YYYY-MM-DD-title.md` convention, or else y
30
32
 
31
33
  |||
32
34
  |:--:|:--:|
33
- | _Config_ | Update site URL, personal links, CV experience using `_config.yml`. |
34
- | _Extra config_ | Customise your site (add minimal inline styling, homepage link and footer in blogposts, favicon) via the `compression` options in `_config.yml`. These options add additional bytes to your pages, but can improve UX. |
35
- | _About me_ | Customise the About Me section of the homepage by editing `_pages/about.md`. |
36
- | _Change font_ | Customise fonts for text + footer by editing `_layouts/default.html` and `_layouts/post.html` inline CSS. |
35
+ | _Config_ | Update site URL, social links, and CV experience using `_config.yml`. |
36
+ | _About me_ | Customise the About Me section of the homepage by editing `_pages/about.md`. This is rendered as markdown at build time. |
37
37
  | _RSS_ | The RSS feed can be found at <https://yourgithubusername.github.io/feed>. |
38
38
  | _Sitemap_ | The sitemap can be found at <https://yourgithubusername.github.io/sitemap>. |
39
39
  | _Quickstart_ | Test your website locally by following the [Jekyll quickstart guide](https://jekyllrb.com/docs/). |
40
40
  | _gzip compression_ | Files are compressed using [Zopfli](https://github.com/philnash/jekyll-zopfli) compression. GitHub GZip's files automatically before serving, but we can use more aggressive pre-compression to achieve better compression, and avoid server overhead to compress on-the-fly. Support seems to vary between browsers, and some will fallback to `.html`. |
41
- | _Brotli compression_ | We also compress files using Google's [Brotli](https://en.wikipedia.org/wiki/Brotli) algorithm. We serve `.gz` and `.html` as fallback, although `.br` [has good support](https://caniuse.com/brotli) |
41
+ | _Brotli compression_ | We also compress files using Google's [Brotli](https://en.wikipedia.org/wiki/Brotli) algorithm. We serve `.gz` and `.html` as fallback, although `.br` [has good support](https://caniuse.com/brotli). |
42
+ | _Page reflow protection_ | To prevent page-reflow whilst lazy-loading images, we set image height and width using the `_plugins/jekyll-anti-image-reflow.rb` plugin. Note it will not override existing styling to loading, width or height attributes. |
43
+
44
+ #### Cosmetics
45
+ `Featherweight` allows you to enable numerous cosmetic upgrades for your site. Toggle these options in the `compression` settings in `_config.yml`. These cosmetics all add to the total page weight, but can significantly improve the UX.
46
+
47
+ Many of these are entirely optional settings. If you're looking to create a truly minimal webpage, read the comments inside `_config.yml`.
48
+
49
+ |||
50
+ |:--:|:--:|
51
+ | _SEO_ | Enabling search engine optimisations will add metadata for search engines and sharing on social media. |
52
+ | _Reading time_ | To display an estimated reading time for blog posts. |
53
+ | _Change font_ | Customise fonts for text + footer by editing `_layouts/default.html` and `_layouts/post.html` inline CSS. |
54
+ | _Load time_ | Show off your page load times at the foot of the homepage/blog posts. |
55
+ | _Blog post footer_ | Display social media links below blog posts. |
56
+ | _social-urls_, _resume_, _blogs_ | Toggle the display of each of these subsections on your homepage. |
57
+ | _CSS_ | Add some basic styling, based on [58 bytes of CSS to look great nearly everywhere](https://gist.github.com/JoeyBurzynski/617fb6201335779f8424ad9528b72c41). Also add some basic image styling to blog posts, working in combination with `anti-image-reflow` to fit images to the blog width without causing jank. |
58
+ | _favicon_, _icon_ | Both options require image urls. The favicon is the website icon, whilst the icon is used if the site is made into a webapp, or a shortcut on iOS devices, etc. `Favicon` accepts .ico, `icon` accepts .png of size 192x192. |
59
+
60
+ #### Dev
61
+ 1. Clone this repository: `git clone https://github.com/Cutwell/featherweight.git`
62
+ 2. Download the project dependencies: `bundle install`
63
+ 3. Run a local Jekyll server: `bundle exec jekyll serve`
@@ -0,0 +1,39 @@
1
+ <!DOCTYPE html>
2
+
3
+ {% if site.lang %}
4
+ <html lang="{{ site.lang }}">
5
+ {% endif %}
6
+
7
+ <head>
8
+
9
+ <meta name="viewport" content="width=device-width, initial-scale=1">
10
+
11
+ {% if page.title %}
12
+ <title>{{ page.title }}</title>
13
+ {% else if site.name %}
14
+ <title>{{ site.name }}</title>
15
+ {% endif %}
16
+
17
+ {% if site.compression.favicon %}
18
+ <link rel="icon" type="image/png" sizes="32x32" href="{{ site.url }}/{{ site.favicon }}">
19
+ {% else %}
20
+ <link rel="icon" href="data:,">
21
+ {% endif %}
22
+
23
+ {% if site.compression.icon %}
24
+ <link rel="shortcut icon" type="image/png" href="/img/icon-192x192.png">
25
+ <link rel="shortcut icon" sizes="192x192" href="/img/icon-192x192.png">
26
+ <link rel="apple-touch-icon" href="/img/icon-192x192.png">
27
+ {% endif %}
28
+
29
+ <!-- include seo if enabled -->
30
+ {% if site.compression.seo %}
31
+ {% include seo.html %}
32
+ {% endif %}
33
+
34
+ <!-- include image styling if enabled and page is post -->
35
+ {% if site.compression.css and page.layout == "post" %}
36
+ <style>img{width:100%;height:auto}</style>
37
+ {% endif %}
38
+
39
+ </head>
@@ -0,0 +1,6 @@
1
+ {% capture words %}
2
+ {{ content | number_of_words | minus: 180 }}
3
+ {% endcapture %}
4
+ {% unless words contains '-' %}
5
+ {{ words | plus: 150 | divided_by: 150 | append: ' minutes to read.' }}
6
+ {% endunless %}
@@ -0,0 +1,38 @@
1
+ <!-- metadata -->
2
+ <meta charset="utf-8">
3
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
4
+
5
+ <meta name="description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
6
+
7
+ <link rel="alternate" type="application/rss+xml" title="{{ site.name }}" href="{{ "/feed.xml" | prepend: site.url }}">
8
+ <link rel="sitemap" type="application/xml" title="Sitemap" href="{{ "/sitemap.xml" | prepend: site.url }}" />
9
+ <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.url }}">
10
+
11
+ <!-- Google site verification -->
12
+ <meta name="google-site-verification" content="{{ site.google-site-verification }}" />
13
+
14
+ <!-- Facebook integration -->
15
+ <meta property="og:title" content="{{ page.title }}"/>
16
+ {% if page.image %}<meta property="og:image" content="{{ page.image | prepend: site.url }}"/>{% endif %}
17
+ <meta property="og:url" content="{{ page.url | prepend: site.url }}"/>
18
+ <meta property="og:type" content="article">
19
+ <meta property="og:site_name" content="{{ site.name }}"/>
20
+ <meta property="og:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}"/>
21
+
22
+ <!-- Twitter integration -->
23
+ <meta name="twitter:card" content="summary">
24
+ <!-- find twitter url in social-urls list -->
25
+ {% if site.compression.social-urls %}
26
+ {% for link in site.social-urls %}
27
+ <!-- if "twitter.com" in link url -->
28
+ {% if link.url contains "twitter.com" %}
29
+ <meta name="twitter:site" content="{{ site.twitter_url }}">
30
+ <!-- breakout of for loop -->
31
+ {% break %}
32
+ {% endif %}
33
+ {% endfor %}
34
+ {% endif %}
35
+ <meta name="twitter:title" content="{{ page.title }}" />
36
+ {% if page.image %}<meta name="twitter:image" content="{{ site.url }}{{ page.image }}" />{% endif %}
37
+ <meta name="twitter:url" content="{{ site.url }}{{ page.url }}" />
38
+ <meta name="twitter:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}" />
@@ -1,23 +1,17 @@
1
1
  ---
2
2
  layout: compress
3
3
  ---
4
- <!DOCTYPE html>
4
+ <!-- include header.html -->
5
+ {% include header.html %}
5
6
 
6
- <title>{% if page.title %}{{ page.title }}{% else %}{{ site.name }}{% endif %}</title>
7
-
8
- <meta name="viewport" content="width=device-width,initial-scale=1.0">
9
- <link rel="alternate" type="application/rss+xml" title="{{ site.name }}" href="{{ site.url }}/feed.xml" />
10
-
11
- {% if site.compression.favicon %}
12
- <link rel="icon" type="image/png" sizes="32x32" href="{{ site.url }}/{{ site.favicon }}">
13
- {% else %}
14
- <link rel="icon" href="data:,">
15
- {% endif %}
16
-
17
- {% if site.compression.styling %}
18
- <body style="max-width:80ch;padding:3em 1em;margin:auto;line-height:1.6;font-size:1.25em;font-family:sans-serif;">
7
+ <!-- include page css if enabled -->
8
+ {% if site.compression.css %}
9
+ <body style="max-width:80ch;padding:3em 1em;margin:auto;line-height:1.6;font-size:1.25em;font-family:sans-serif">
19
10
  {% endif %}
20
11
 
21
12
  {{ content }}
22
13
 
23
- </body>
14
+ <!-- add page load time if enabled -->
15
+ {% if site.compression.load-time %}
16
+ <br><i>Page loaded in: <script>window.onload = function () {document.getElementById("loadTime").innerHTML = window.performance.timing.domContentLoadedEventEnd-window.performance.timing.navigationStart;}</script><span id="loadTime"></span>ms</i>
17
+ {% endif %}
data/_layouts/post.html CHANGED
@@ -1,15 +1,17 @@
1
1
  ---
2
2
  layout: default
3
3
  ---
4
- {% if site.compression.menu %}
5
- <a href="{{ site.url }}" style="position:absolute;top:0;left:0;margin:1em;color:inherit;font-size:1em;">Return home</a>
4
+ {% if site.compression.home-link %}
5
+ <a style="position:absolute;top:0;left:0;margin:1em;color:inherit;font-size:1em;" href="{{ site.url }}">{% if site.home-link-text %}{{ site.home-link-text }}{% else %}Return Home{% endif %}</a>
6
6
  {% endif %}
7
7
 
8
- <b>{{ page.title }}</b><br><i> Written on {{ page.date | date: "%B %e, %Y" }} </i>
8
+ <h1>{{ page.title }}</h1>
9
+ <i>Written on {{ page.date | date: "%B %e, %Y" }}</i>
10
+ <br><i>{% include reading-time.html %}</i>
9
11
 
10
12
  {{ content }}
11
13
 
12
14
  {% if site.compression.footer %}
13
- <hr>
14
- <p style="font-family:monospace;">{% for link in site.personals %}{{ link.name }}: <a href="{{ link.url }}">{{ link.url }}</a><br>{% endfor %}</p>
15
- {% endif %}
15
+ <br><hr>
16
+ <p>{% for link in site.social-urls %}{{ link.name }}: <a href="{{ link.url }}">{{ link.url}}</a><br>{% endfor %}</p>
17
+ {% endif %}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: featherweight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-27 00:00:00.000000000 Z
11
+ date: 2022-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -86,20 +86,6 @@ dependencies:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '4.0'
89
- - !ruby/object:Gem::Dependency
90
- name: jekyll-loading-lazy
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: 0.1.1
96
- type: :runtime
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: 0.1.1
103
89
  - !ruby/object:Gem::Dependency
104
90
  name: jekyll-zopfli
105
91
  requirement: !ruby/object:Gem::Requirement
@@ -137,6 +123,9 @@ extra_rdoc_files: []
137
123
  files:
138
124
  - LICENSE
139
125
  - README.md
126
+ - _includes/header.html
127
+ - _includes/reading-time.html
128
+ - _includes/seo.html
140
129
  - _layouts/compress.html
141
130
  - _layouts/default.html
142
131
  - _layouts/post.html
@@ -159,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
148
  - !ruby/object:Gem::Version
160
149
  version: '0'
161
150
  requirements: []
162
- rubygems_version: 3.3.7
151
+ rubygems_version: 3.3.24
163
152
  signing_key:
164
153
  specification_version: 4
165
154
  summary: "`Featherweight` is an ultra-lightweight Jekyll theme, aiming to minimise