Skip to content

Commit

Permalink
Merge pull request #133 from daviddarnes/update-nav-formats
Browse files Browse the repository at this point in the history
Update nav formats
  • Loading branch information
daviddarnes authored Jun 11, 2019
2 parents ad7ee95 + 68f8571 commit 13409e8
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 50 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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._
Expand Down
31 changes: 16 additions & 15 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
10 changes: 5 additions & 5 deletions _includes/nav-footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<ul class="list list--nav">
{% for item in site.navigation_footer %}

{% if item[1] contains '://' %}
{% assign url = item[1] %}
{% if item.url contains '://' %}
{% assign url = item.url %}
{% else %}
{% assign url = item[1] | relative_url %}
{% assign url = item.url | relative_url %}
{% endif %}

<li class="item item--nav{% if item[1] == page.url %} item--current{% endif %}">
<a href="{{ url }}">{{ item[0] }}</a>
<li class="item item--nav{% if item.url == page.url %} item--current{% endif %}">
<a href="{{ url }}">{{ item.title }}</a>
</li>
{% endfor %}
</ul>
Expand Down
10 changes: 5 additions & 5 deletions _includes/nav-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<ul class="list list--nav">
{% for item in site.navigation_header %}

{% if item[1] contains '://' %}
{% assign url = item[1] %}
{% if item.url contains '://' %}
{% assign url = item.url %}
{% else %}
{% assign url = item[1] | relative_url %}
{% assign url = item.url | relative_url %}
{% endif %}

<li class="item item--nav{% if item[1] == page.url %} item--current{% endif %}">
<a href="{{ url }}">{{ item[0] }}</a>
<li class="item item--nav{% if item.url == page.url %} item--current{% endif %}">
<a href="{{ url }}">{{ item.title }}</a>
</li>
{% endfor %}
</ul>
Expand Down
34 changes: 18 additions & 16 deletions _includes/nav-share.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<div class="share">
{% 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 %}
</div>
10 changes: 6 additions & 4 deletions _includes/nav-social.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<nav class="nav nav--social">
{% for link in site.social_links %}
{% assign id = link[0] | downcase %}
<a href="{{ link[1] }}">
{% include icon.html id=id title=id %}
</a>
{% if link[1] != blank %}
{% assign id = link[0] | downcase %}
<a href="{{ link[1] }}">
{% include icon.html id=id title=id %}
</a>
{% endif %}
{% endfor %}
</nav>
2 changes: 0 additions & 2 deletions alembic-jekyll-theme.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 13409e8

Please sign in to comment.