Skip to content

Commit

Permalink
fix(site): add feed, fix sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
timothystewart6 committed Oct 16, 2021
1 parent 081ab0d commit ef141c2
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 74 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ jekyll-archives:

plugins:
- "jekyll-get-json"

- "jekyll-feed"
jekyll_get_json:
- data: github
json: 'https://api.github.com/repos/techno-tim/techno-tim.github.io'
Expand Down
21 changes: 11 additions & 10 deletions _data/contact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,30 @@
-
type: patreon
icon: 'fab fa-patreon'
# -
# type: github
# icon: 'fab fa-github-alt'
# -

-
# type: instagram
# icon: 'fab fa-instagram'
# -
# type: facebook
# icon: 'fab fa-facebook'
-
type: discord
icon: 'fab fa-discord'
type: discord
icon: 'fab fa-discord'
# -
# type: tiktok
# icon: 'fab fa-tiktok'

# type: email
# icon: 'fas fa-envelope'
# noblank: true # open link in current tab
# -
# type: rss
# icon: 'fas fa-rss'
# noblank: true
-
type: github
icon: 'fab fa-github-alt'
-
type: rss
icon: 'fas fa-rss'
noblank: true

# Uncomment and complete the url below to enable more contact options
# -
Expand Down
2 changes: 1 addition & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@
crossorigin="anonymous"></script>

{% include js-selector.html %}

{% feed_meta %}
</head>
115 changes: 53 additions & 62 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
<div id="avatar">
<a href="{{ '/' | relative_url }}" alt="avatar" class="mx-auto">
{% capture avatar_url %}
{%- if site.avatar contains '://' -%}
{{ site.avatar }}
{%- elsif site.img_cdn != '' and site.img_cdn -%}
{{ site.avatar | prepend: site.img_cdn }}
{%- else -%}
{{ site.avatar | relative_url }}
{%- endif -%}
{%- if site.avatar contains '://' -%}
{{ site.avatar }}
{%- elsif site.img_cdn != '' and site.img_cdn -%}
{{ site.avatar | prepend: site.img_cdn }}
{%- else -%}
{{ site.avatar | relative_url }}
{%- endif -%}
{% endcapture %}
<img src="{{ avatar_url }}" alt="avatar" onerror="this.style.display='none'">
</a>
Expand Down Expand Up @@ -51,68 +51,59 @@
<div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center">

{% for entry in site.data.contact %}
{% capture url %}
{%- if entry.type == 'github' -%}
https://github.com/{{ site.github.username }}
{%- elsif entry.type == 'twitter' -%}
https://twitter.com/{{ site.twitter.username }}
{%- elsif entry.type == 'email' -%}
{% assign email = site.social.email | split: '@' %}
javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
{%- elsif entry.type == 'rss' -%}
{{ "/feed.xml" | relative_url }}
{%- elsif entry.type == 'patreon' -%}
https://patreon.com/{{ site.patreon.username }}
{%- elsif entry.type == 'youtube' -%}
https://www.youtube.com/channel/{{ site.youtube.channelid }}
{%- elsif entry.type == 'twitch' -%}
https://twitch.tv/{{ site.twitch.username }}
{%- elsif entry.type == 'instagram' -%}
https://instagram.com/{{ site.instagram.username }}
{%- elsif entry.type == 'facebook' -%}
https://facebook.com/{{ site.facebook.username }}
{%- elsif entry.type == 'discord' -%}
https://discord.gg/{{ site.discord.invitelink }}
{%- elsif entry.type == 'tiktok' -%}
https://tiktok.com/{{ site.tiktok.username }}
{%- else -%}
{{ entry.url }}
{%- endif -%}
{% endcapture %}
{% capture url %}
{%- if entry.type == 'github' -%}
https://github.com/{{ site.github.username }}
{%- elsif entry.type == 'twitter' -%}
https://twitter.com/{{ site.twitter.username }}
{%- elsif entry.type == 'email' -%}
{% assign email = site.social.email | split: '@' %}
javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
{%- elsif entry.type == 'rss' -%}
{{ "/feed.xml" | relative_url }}
{%- elsif entry.type == 'patreon' -%}
https://patreon.com/{{ site.patreon.username }}
{%- elsif entry.type == 'youtube' -%}
https://www.youtube.com/channel/{{ site.youtube.channelid }}
{%- elsif entry.type == 'twitch' -%}
https://twitch.tv/{{ site.twitch.username }}
{%- elsif entry.type == 'instagram' -%}
https://instagram.com/{{ site.instagram.username }}
{%- elsif entry.type == 'facebook' -%}
https://facebook.com/{{ site.facebook.username }}
{%- elsif entry.type == 'discord' -%}
https://discord.gg/{{ site.discord.invitelink }}
{%- elsif entry.type == 'tiktok' -%}
https://tiktok.com/{{ site.tiktok.username }}
{%- else -%}
{{ entry.url }}
{%- endif -%}
{% endcapture %}

{% if url %}
<a href="{{ url }}" aria-label="{{ entry.type }}"
{% unless site.theme_mode %}class="order-{{ forloop.index | plus: 2 }}"{% endunless %}
{% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
<i class="{{ entry.icon }}"></i>
</a>
{% endif %}
{% if url %}
<a href="{{ url }}" aria-label="{{ entry.type }}" {% unless site.theme_mode
%}class="order-{{ forloop.index | plus: 2 }}" {% endunless %} {% unless entry.noblank %}target="_blank"
rel="noopener" {% endunless %}>
<i class="{{ entry.icon }}"></i>
</a>
{% endif %}

{% endfor %}

{% unless site.theme_mode %}
{% if site.data.contact.size > 0 %}
<span class="icon-border order-2"></span>
{% endif %}
{% if site.data.contact.size > 0 %}
<span class="icon-border order-2"></span>
{% endif %}

<span id="mode-toggle-wrapper" class="order-1">
{% include mode-toggle.html %}
</span>
<span id="mode-toggle-wrapper" class="order-1">
{% include mode-toggle.html %}
</span>
{% endunless %}

<div class="d-flex flex-row justify-content-center align-items-center">
<div class="p-1">
<a href="https://github.com/techno-tim/techno-tim.github.io" target="_blank" rel="noopener">
<i class="fab fa-github fa-2x"></i>
</a>
</div>
<div class="p-1">
<div class="d-flex flex-column align-items-start justify-content-end">
<div class="text-sm-left">{{ site.data.github.stargazers_count}} stars</div>
<div class="p-0">{{ site.data.github.forks_count}} forks</div>
</div>
</div>

<div class="d-flex flex-wrap justify-content-center">
<div class="p-1 text-small-left">{{ site.data.github.stargazers_count}} stars</div>
<div class="p-1">{{ site.data.github.forks_count}} forks </div>
</div>
</div> <!-- .sidebar-bottom -->

</div><!-- #sidebar -->
</div><!-- #sidebar -->

0 comments on commit ef141c2

Please sign in to comment.