From 8021cea66cbcce59cb6dd49d0a663cd55c8828a2 Mon Sep 17 00:00:00 2001 From: Lynnesbian Date: Mon, 6 Apr 2020 02:20:03 +1000 Subject: [PATCH] minor content fixes, added pagination and sharing --- Gemfile | 32 +++++++ Gemfile.lock | 84 +++++++++++++++++++ _config.yml | 11 +++ _layouts/default.html | 1 - _layouts/post.html | 10 ++- ...ression-in-the-information-age-part-two.md | 6 +- .../2019-05-08-using-an-eeepc-in-2019.md | 2 +- assets/email.svg | 1 + assets/mastodon-share.js | 17 ++++ assets/mastodon.svg | 1 + assets/style.css | 44 +++++++++- index.html | 19 +++-- mastodon-share.html | 15 ++++ 13 files changed, 226 insertions(+), 17 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 assets/email.svg create mode 100644 assets/mastodon-share.js create mode 100644 assets/mastodon.svg create mode 100644 mastodon-share.html diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..e24cfcf --- /dev/null +++ b/Gemfile @@ -0,0 +1,32 @@ +source "https://rubygems.org" +# Hello! This is where you manage which Jekyll version is used to run. +# When you want to use a different version, change it below, save the +# file and run `bundle install`. Run Jekyll with `bundle exec`, like so: +# +# bundle exec jekyll serve +# +# This will help ensure the proper Jekyll version is running. +# Happy Jekylling! +gem "jekyll", "~> 4.0.0" +gem "nokogiri", "~>1.10.9" +# This is the default theme for new Jekyll sites. You may change this to anything you like. +# gem "minima", "~> 2.5" +# If you want to use GitHub Pages, remove the "gem "jekyll"" above and +# uncomment the line below. To upgrade, run `bundle update github-pages`. +# gem "github-pages", group: :jekyll_plugins +# If you have any plugins, put them here! +group :jekyll_plugins do + gem "jekyll-feed", "~> 0.12" + gem "jekyll-paginate-v2", "~> 3.0.0" +end + +# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem +# and associated library. +install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do + gem "tzinfo", "~> 1.2" + gem "tzinfo-data" +end + +# Performance-booster for watching directories on Windows +gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform? + diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..7f57705 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,84 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + colorator (1.1.0) + concurrent-ruby (1.1.6) + em-websocket (0.5.1) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) + eventmachine (1.2.7) + ffi (1.12.2) + forwardable-extended (2.6.0) + http_parser.rb (0.6.0) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + jekyll (4.0.0) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (>= 0.9.5, < 2) + jekyll-sass-converter (~> 2.0) + jekyll-watch (~> 2.0) + kramdown (~> 2.1) + kramdown-parser-gfm (~> 1.0) + liquid (~> 4.0) + mercenary (~> 0.3.3) + pathutil (~> 0.9) + rouge (~> 3.0) + safe_yaml (~> 1.0) + terminal-table (~> 1.8) + jekyll-feed (0.13.0) + jekyll (>= 3.7, < 5.0) + jekyll-paginate-v2 (3.0.0) + jekyll (>= 3.0, < 5.0) + jekyll-sass-converter (2.1.0) + sassc (> 2.0.1, < 3.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + kramdown (2.1.0) + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.3) + listen (3.2.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.3.6) + mini_portile2 (2.4.0) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (4.0.4) + rb-fsevent (0.10.3) + rb-inotify (0.10.1) + ffi (~> 1.0) + rouge (3.17.0) + safe_yaml (1.0.5) + sassc (2.2.1) + ffi (~> 1.9) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + thread_safe (0.3.6) + tzinfo (1.2.7) + thread_safe (~> 0.1) + tzinfo-data (1.2019.3) + tzinfo (>= 1.0.0) + unicode-display_width (1.7.0) + wdm (0.1.1) + +PLATFORMS + ruby + +DEPENDENCIES + jekyll (~> 4.0.0) + jekyll-feed (~> 0.12) + jekyll-paginate-v2 (~> 3.0.0) + nokogiri (~> 1.10.9) + tzinfo (~> 1.2) + tzinfo-data + wdm (~> 0.1.1) + +BUNDLED WITH + 2.1.4 diff --git a/_config.yml b/_config.yml index 491010d..2c9d993 100644 --- a/_config.yml +++ b/_config.yml @@ -2,6 +2,17 @@ url: "" # the base hostname & protocol for your site, e.g. http://example.com baseurl: "" # the subpath of your site, e.g. /blog title: "Bune City Blog" # the name of your site, e.g. ACME Corp. exclude: [old/] +plugins: [jekyll-feed, jekyll-paginate-v2] + +pagination: + enabled: true + per_page: 5 + permalink: '/page/:num/' + title: ':title - page :num' + limit: 0 + sort_field: 'date' + sort_reverse: true + defaults: - scope: path: "" diff --git a/_layouts/default.html b/_layouts/default.html index 5e07b58..80591c3 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -8,7 +8,6 @@ - diff --git a/_layouts/post.html b/_layouts/post.html index 812927c..546a55e 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -6,7 +6,6 @@ layout: default
- person By {{ page.author }}
access_time Published {{ page.date | date_to_long_string: "ordinal" }}
group_work Categories: {{ " " }}{%- for category in page.categories -%} @@ -27,7 +26,7 @@ layout: default
- {% for post in site.related_posts | limit: 3 -%} + {% for post in site.related_posts limit: 3 -%}

@@ -40,7 +39,12 @@ layout: default

Share this post

- coming soon uwu + {%- assign summary = page.summary %} + {%- unless summary %} + {%- assign summary = page.excerpt | summarise | truncate: 150 %} + {%- endunless %} + +

Leave a comment

diff --git a/_posts/fixme/2019-05-05-depression-in-the-information-age-part-two.md b/_posts/fixme/2019-05-05-depression-in-the-information-age-part-two.md index 616d331..006e60b 100644 --- a/_posts/fixme/2019-05-05-depression-in-the-information-age-part-two.md +++ b/_posts/fixme/2019-05-05-depression-in-the-information-age-part-two.md @@ -12,11 +12,11 @@ cw_description: These images mention suicide and depression. Images ------ -![Redeem](https://wasabi.lynnesbian.space/bune-city/2019/05/4-redeem-2-1024x576.png) +![Redeem](https://wasabi.lynnesbian.space/bune-city/2019/05/4-redeem-2.png) -![Gamified](https://wasabi.lynnesbian.space/bune-city/2019/05/5-gamified-1024x811.png) +![Gamified](https://wasabi.lynnesbian.space/bune-city/2019/05/5-gamified.png) -![Empty](https://wasabi.lynnesbian.space/bune-city/2019/05/6-empty-1024x576.jpg) +![Empty](https://wasabi.lynnesbian.space/bune-city/2019/05/6-empty.jpg) Reflection ---------- diff --git a/_posts/fixme/2019-05-08-using-an-eeepc-in-2019.md b/_posts/fixme/2019-05-08-using-an-eeepc-in-2019.md index baa56b5..2be3614 100644 --- a/_posts/fixme/2019-05-08-using-an-eeepc-in-2019.md +++ b/_posts/fixme/2019-05-08-using-an-eeepc-in-2019.md @@ -8,7 +8,7 @@ categories: [Personal, Technology] Introduction ------------ -For the past two weeks, I've been using an [EeePC 1000H](https://en.wikipedia.org/wiki/Asus_Eee_PC#Eee_PC_1000_series), a [netbook](https://en.wikipedia.org/wiki/Netbook) with a 10" screen, an Intel Atom N270 CPU, 2GB of RAM, and an 80GB internal hard drive. Released in 2008, it was designed with portability as its primary goal, with performance taking a back seat. this is especially true of the EeePC 701, a tiny netbook with a 7" scren and a rather restrictive 4GB internal SSD. +For the past two weeks, I've been using an [EeePC 1000H](https://en.wikipedia.org/wiki/Asus_Eee_PC#Eee_PC_1000_series), a [netbook](https://en.wikipedia.org/wiki/Netbook) with a 10" screen, an Intel Atom N270 CPU, 2GB of RAM, and an 80GB internal hard drive. Released in 2008, it was designed with portability as its primary goal, with performance taking a back seat. this is especially true of the EeePC 701, a tiny netbook with a 7" screen and a rather restrictive 4GB internal SSD. diff --git a/assets/email.svg b/assets/email.svg new file mode 100644 index 0000000..fc0d05c --- /dev/null +++ b/assets/email.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/mastodon-share.js b/assets/mastodon-share.js new file mode 100644 index 0000000..a632f02 --- /dev/null +++ b/assets/mastodon-share.js @@ -0,0 +1,17 @@ +document.addEventListener('DOMContentLoaded', (event) => { + if (localStorage['mastodon_share_url']) { + dgel('share-instance').value = localStorage['mastodon_share_url']; + } +}); + +function share_with_mastodon() { + let url = "https://" + dgel('share-instance').value; + url = url.replace(/^https:\/\/(https?:\/\/)/, "$1"); // remove duplicated leading 'https://' if present + url = url.replace(/\/+$/, ''); // remove trailing slashes + + post_content = window.location.hash.substr(1); + + localStorage['mastodon_share_url'] = url; + + window.location = `${url}/share?text=${post_content}`; +} \ No newline at end of file diff --git a/assets/mastodon.svg b/assets/mastodon.svg new file mode 100644 index 0000000..4b72b3a --- /dev/null +++ b/assets/mastodon.svg @@ -0,0 +1 @@ + diff --git a/assets/style.css b/assets/style.css index e458692..eb607cc 100644 --- a/assets/style.css +++ b/assets/style.css @@ -5,16 +5,26 @@ body { } h1 { - font-family: "Playfair Display"; + font-family: serif; text-align: center; font-size: 3em; } +h1#logo { + font-family: "Playfair Display", serif; +} header { font-family: sans-serif; background: #fafafa; padding: 0 20px; } +nav { + display: inline-block; +} +nav a { + padding: 0 10px; + display: inline-block; +} #header-container { width: 90%; margin: 0 auto; @@ -24,9 +34,6 @@ header h1 { text-align: left; font-size: 1.2em; } -nav { - display: inline-block; -} #header-logo { height: 32px; width: 32px; @@ -34,7 +41,13 @@ nav { vertical-align: middle; } +#pagination { + display: flex; + justify-content: space-between; +} + main { + max-width: 800px; width: 90%; margin: 0 auto; } @@ -92,6 +105,14 @@ p, li { } /* the content of the posts */ +#post-body h2 a { + opacity: 0.2; + transition: 0.2s all; +} +#post-body h2:hover a { + opacity: 1; +} + #post-body > p { text-align: justify; } @@ -175,6 +196,21 @@ p, li { font-size: 1.3em; } +/* share post */ +.post-share { + display: inline-block; + height: 32px; + width: 32px; + background: center / contain no-repeat; +} +.post-share.mastodon { + background-image: url('/assets/mastodon.svg'); +} +.post-share.email { + background-image: url('/assets/email.svg'); +} + +/* mastodon share popup */ /* material icons */ .material-icons { diff --git a/index.html b/index.html index a095705..ebfcf00 100644 --- a/index.html +++ b/index.html @@ -1,18 +1,19 @@ --- layout: default title: "bune.city - Home" +pagination: + enabled: true --- {% include header.html %} -

{{ site.title }}

+

{{ site.title }}

- {% for post in site.posts %} + {% for post in paginator.posts %}

{{ post.title }}

- person By {{ post.author }} - access_time Published {{ post.date | date_to_string: "ordinal" }} - group_work Categories: + access_time {{ post.date | date_to_string: "ordinal" }} + group_work {{ " " }}{%- for category in post.categories -%} {{ category }} {%- unless category == post.categories.last %}, {% endunless %} @@ -23,5 +24,13 @@ title: "bune.city - Home"
{% endfor %} + + {%- if paginator.total_pages > 1 %} + + {%- endif %}
\ No newline at end of file diff --git a/mastodon-share.html b/mastodon-share.html new file mode 100644 index 0000000..cb11500 --- /dev/null +++ b/mastodon-share.html @@ -0,0 +1,15 @@ +--- +title: Share Bune City Blog post on Mastodon +layout: default +--- + +
+ +

Share with Mastodon

+ In order to share this post on Mastodon, you'll need to enter your instance URL below. You'll get a chance to preview and edit what gets posted. +
+
+ + +
+
\ No newline at end of file