From 840eab9566ef69245030d1d4b69d796c3f615714 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Mon, 17 Feb 2020 03:01:48 +0800 Subject: [PATCH] Feature: Added post sharing options. Also added a license statement at the bottom of the posts. --- _data/share.yml | 29 +++++++++ _includes/post-nav.html | 28 +++++++++ _includes/post-sharing.html | 28 +++++++++ _includes/related-posts.html | 2 +- _layouts/post.html | 52 +++++++++------- assets/css/_dark/dark-main.scss | 1 + assets/css/main.scss | 6 +- assets/css/post.scss | 77 +++++++++++++++++++++++- assets/js/_src/_commons/copy-link.js | 19 ++++++ assets/js/dist/_commons/copy-link.min.js | 1 + assets/js/dist/commons.js | 3 +- 11 files changed, 219 insertions(+), 27 deletions(-) create mode 100644 _data/share.yml create mode 100644 _includes/post-nav.html create mode 100644 _includes/post-sharing.html create mode 100644 assets/js/_src/_commons/copy-link.js create mode 100644 assets/js/dist/_commons/copy-link.min.js diff --git a/_data/share.yml b/_data/share.yml new file mode 100644 index 0000000..a48b54d --- /dev/null +++ b/_data/share.yml @@ -0,0 +1,29 @@ +# Sharing options at the bottom of the post. +# Icons from +# +# v2.1 +# https://github.com/cotes2020/jekyll-theme-chirpy +# © 2020 Cotes Chung +# MIT Licensed + +label: "Share" + +platforms: + - + type: Twitter + icon: "fab fa-twitter" + link: "https://twitter.com/intent/tweet?text=TITLE&url=URL" + - + type: Facebook + icon: "fab fa-facebook-square" + link: "https://www.facebook.com/sharer/sharer.php?title=TITLE&u=URL" + - + type: Telegram + icon: "fab fa-telegram" + link: "https://telegram.me/share?text=TITLE&url=URL" + + # Uncomment below if you need to. + # - + # type: Weibo + # icon: "fab fa-weibo" + # link: "http://service.weibo.com/share/share.php?title=TITLE&url=URL" diff --git a/_includes/post-nav.html b/_includes/post-nav.html new file mode 100644 index 0000000..a0744b6 --- /dev/null +++ b/_includes/post-nav.html @@ -0,0 +1,28 @@ + + +
+ {% if page.previous.url %} + +

{{ page.previous.title }}

+ {% else %} +
+

-

+ {% endif %} +
+ + {% if page.next.url %} + +

{{ page.next.title }}

+ {% else %} +
+

-

+ {% endif %} +
+
\ No newline at end of file diff --git a/_includes/post-sharing.html b/_includes/post-sharing.html new file mode 100644 index 0000000..808e67d --- /dev/null +++ b/_includes/post-sharing.html @@ -0,0 +1,28 @@ + + +
+ + +
\ No newline at end of file diff --git a/_includes/related-posts.html b/_includes/related-posts.html index 1137122..bb67ded 100644 --- a/_includes/related-posts.html +++ b/_includes/related-posts.html @@ -43,7 +43,7 @@ {% assign score_list = score_list | sort | reverse %} {% assign count = 0 %}