From d787d1b364d123fcac4c8c0f6f43ea799f128f72 Mon Sep 17 00:00:00 2001 From: David Darnes Date: Tue, 11 Jun 2019 11:04:58 +0100 Subject: [PATCH 1/3] Change format of all navigation types, remove commented items for cleaner presentation, ensure items have values before showing them --- _config.yml | 31 ++++++++++++++++--------------- _includes/nav-footer.html | 10 +++++----- _includes/nav-header.html | 10 +++++----- _includes/nav-share.html | 34 ++++++++++++++++++---------------- _includes/nav-social.html | 10 ++++++---- 5 files changed, 50 insertions(+), 45 deletions(-) diff --git a/_config.yml b/_config.yml index e72643fa7..6a015e450 100644 --- a/_config.yml +++ b/_config.yml @@ -108,15 +108,22 @@ favicons: # Favicons are also used in the manifest file. Syntax is 'size: path' # 9. Site navigation navigation_header: - Home: / - Elements: /elements/ - Blog: /blog/ - Categories: /categories/ - Search: /search/ - Fork Alembic: https://github.com/daviddarnes/alembic +- title: Home + url: / +- title: Elements + url: /elements/ +- title: Blog + url: /blog/ +- title: Categories + url: /categories/ +- title: Search + url: /search/ +- title: Fork Alembic + url: https://github.com/daviddarnes/alembic navigation_footer: - Created by David Darnes: https://darn.es +- title: Created by David Darnes + url: https://darn.es social_links: # Appears in sidebar. Set the urls then uncomment and comment out as desired Twitter: https://twitter.com/DavidDarnes @@ -125,13 +132,7 @@ social_links: # Appears in sidebar. Set the urls then uncomment and comment out link: https://darn.es RSS: /feed.xml -sharing_links: # Appear at the bottom of single blog posts, uncomment and comment out as desired. Colours set the button colour +sharing_links: # Appear at the bottom of single blog posts, add as desired. The value can be 'true' or the desired button colour Twitter: "#0d94e7" facebook: "#3B5998" - # Pinterest: "#BD081C" - # LinkedIn: "#0077B5" - # tumblr: "#36465D" - # Reddit: "#FF4500" - # Hacker News: "#ff6600" - # Designer News: "#2D72D9" - # Email: "" + Email: true diff --git a/_includes/nav-footer.html b/_includes/nav-footer.html index 1c718b9c7..73b892b4a 100644 --- a/_includes/nav-footer.html +++ b/_includes/nav-footer.html @@ -3,14 +3,14 @@ diff --git a/_includes/nav-header.html b/_includes/nav-header.html index 2a43cc47f..23cdb9b0b 100644 --- a/_includes/nav-header.html +++ b/_includes/nav-header.html @@ -3,14 +3,14 @@ diff --git a/_includes/nav-share.html b/_includes/nav-share.html index 468735ff0..f6d2f3853 100644 --- a/_includes/nav-share.html +++ b/_includes/nav-share.html @@ -1,22 +1,24 @@
{% for network in site.sharing_links %} - {% assign name = network[0] %} - {% assign id = network[0] | downcase | remove: " " %} - {% assign url = site.url | append: site.baseurl | append: page.url %} - {% assign color = network[1] %} + {% if network[1] != blank %} + {% assign name = network[0] %} + {% assign id = network[0] | downcase | remove: " " %} + {% assign url = site.url | append: site.baseurl | append: page.url %} + {% assign color = network[1] %} - {% capture share_link %} - {%- if id contains "twitter" %}https://twitter.com/intent/tweet/?url={{ url }}&text={{ page.title | uri_escape }}{% if site.twitter.username %}&via={{ site.twitter.username }}{% endif %}{% endif -%} - {%- if id contains "facebook" %}https://facebook.com/sharer/sharer.php?u={{ url }}{% endif -%} - {%- if id contains "pinterest" %}https://pinterest.com/pin/create/button/?url={{ url }}&description={{ page.title }}&media={{ page.image }}{% endif -%} - {%- if id contains "linkedin" %}https://www.linkedin.com/shareArticle?url={{ url }}&title={{ page.title }}&source={{ site.title }}&mini=true{% endif -%} - {%- if id contains "tumblr" %}https://tumblr.com/widgets/share/tool?canonicalUrl={{ url }}&tags={{ page.category }}&caption={{ page.title }}{% endif -%} - {%- if id contains "reddit" %}https://reddit.com/submit?url={{ url }}&title={{ page.title }}&resubmit=true{% endif -%} - {%- if id contains "hackernews" %}https://news.ycombinator.com/submitlink?u={{ url }}&t={{ page.title }}{% endif -%} - {%- if id contains "designernews" %}https://www.designernews.co/submit?url={{ url }}&title={{ page.title }}{% endif -%} - {%- if id contains "email" %}mailto:?subject={{ page.title }}&body={{ url | prepend: "Hey, check out this: "}}{% endif -%} - {% endcapture %} + {% capture share_link %} + {%- if id contains "twitter" %}https://twitter.com/intent/tweet/?url={{ url }}&text={{ page.title | uri_escape }}{% if site.twitter.username %}&via={{ site.twitter.username }}{% endif %}{% endif -%} + {%- if id contains "facebook" %}https://facebook.com/sharer/sharer.php?u={{ url }}{% endif -%} + {%- if id contains "pinterest" %}https://pinterest.com/pin/create/button/?url={{ url }}&description={{ page.title }}&media={{ page.image }}{% endif -%} + {%- if id contains "linkedin" %}https://www.linkedin.com/shareArticle?url={{ url }}&title={{ page.title }}&source={{ site.title }}&mini=true{% endif -%} + {%- if id contains "tumblr" %}https://tumblr.com/widgets/share/tool?canonicalUrl={{ url }}&tags={{ page.category }}&caption={{ page.title }}{% endif -%} + {%- if id contains "reddit" %}https://reddit.com/submit?url={{ url }}&title={{ page.title }}&resubmit=true{% endif -%} + {%- if id contains "hackernews" %}https://news.ycombinator.com/submitlink?u={{ url }}&t={{ page.title }}{% endif -%} + {%- if id contains "designernews" %}https://www.designernews.co/submit?url={{ url }}&title={{ page.title }}{% endif -%} + {%- if id contains "email" %}mailto:?subject={{ page.title }}&body={{ url | prepend: "Hey, check out this: "}}{% endif -%} + {% endcapture %} - {% include button.html text=name icon=id link=share_link color=color %} + {% include button.html text=name icon=id link=share_link color=color %} + {% endif %} {% endfor %}
diff --git a/_includes/nav-social.html b/_includes/nav-social.html index 1794f9d60..5abedd328 100644 --- a/_includes/nav-social.html +++ b/_includes/nav-social.html @@ -1,8 +1,10 @@ From f8f9ddc0c0b3ed9cdb97eb09dc0eda516c695f10 Mon Sep 17 00:00:00 2001 From: David Darnes Date: Tue, 11 Jun 2019 11:05:36 +0100 Subject: [PATCH 2/3] Update readme to ensure sharing nav has been documented correctly --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ff2ffb50b..3ad3b2dec 100644 --- a/README.md +++ b/README.md @@ -201,9 +201,9 @@ Pinterest: "#BD081C" LinkedIn: "#0077B5" tumblr: "#36465D" Reddit: "#FF4500" -Hacker News: "#ff6600" -Designer News: "#2D72D9" -Email: "" +HackerNews: "#ff6600" +DesignerNews: "#2D72D9" +Email: true ``` _The first item is the name of the network (must be one of the ones stated above) and the second is the colour of the button. To remove a button just remove the line of the same name._ From 68f8571952e3d9c8a86dbf899420004b6afcdc16 Mon Sep 17 00:00:00 2001 From: David Darnes Date: Tue, 11 Jun 2019 11:06:03 +0100 Subject: [PATCH 3/3] Remove bundler from dependencies, the gem doesn't need it --- alembic-jekyll-theme.gemspec | 2 -- 1 file changed, 2 deletions(-) diff --git a/alembic-jekyll-theme.gemspec b/alembic-jekyll-theme.gemspec index d01df1bfb..cf8053861 100644 --- a/alembic-jekyll-theme.gemspec +++ b/alembic-jekyll-theme.gemspec @@ -26,6 +26,4 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "jekyll-commonmark", "~> 1.2" spec.add_runtime_dependency "jekyll-include-cache", "~> 0.1" spec.add_runtime_dependency "jemoji", "~> 0.11" - - spec.add_development_dependency "bundler", "~> 1.14" end