Skip to content

Commit

Permalink
Add YouTube channel to social (jekyll#292)
Browse files Browse the repository at this point in the history
* Add YouTube channel to social

Support channels, by adding youtube_channel, and youtube_channel_name,
since most names are randomly generated IDs, e.g. UCvmINlrza7JHB1zkIOuXEbw).

For example,

    youtube_channel: UCvmINlrza7JHB1zkIOuXEbw
    youtube_channel_name: jekyll

This preserves the existing youtube_username setting, since it should
will support the other URL systems on YouTube, legacy usernames and
new custom URLs, see:

https://support.google.com/youtube/answer/6180214
  • Loading branch information
ashawley authored and DirtyF committed Oct 29, 2018
1 parent 08d8283 commit 3e78c58
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ mastodon:
instance: example.com
- username: jekyll2
instance: example.com

youtube_channel: UC8CXR0-3I70i1tfPg1PAE1g
youtube_channel_name: CloudCannon
```
--
Expand Down
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ rss: rss
# linkedin_username: jekyll
# pinterest_username: jekyll
# youtube_username: jekyll
# youtube_channel: UC8CXR0-3I70i1tfPg1PAE1g
# youtube_channel_name: CloudCannon
# googleplus_username: +jekyll
# microdotblog_username: jekyll

Expand Down
1 change: 1 addition & 0 deletions _includes/social.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{%- for mst in site.mastodon -%}{%- if mst.username and mst.instance -%}<li><a href="https://{{ mst.instance| cgi_escape | escape}}/@{{mst.username}}"><svg class="svg-icon"><use xlink:href="{{ '/assets/minima-social-icons.svg#mastodon' | relative_url }}"></use></svg> <span class="username">{{ mst.username|escape }}</span></a></li>{%- endif -%}{%- endfor -%}
{%- if site.twitter_username -%}<li><a href="https://twitter.com/{{ site.twitter_username| cgi_escape | escape }}"><svg class="svg-icon"><use xlink:href="{{ '/assets/minima-social-icons.svg#twitter' | relative_url }}"></use></svg> <span class="username">{{ site.twitter_username| escape }}</span></a></li>{%- endif -%}
{%- if site.youtube_username -%}<li><a href="https://www.youtube.com/{{ site.youtube_username| cgi_escape | escape }}"><svg class="svg-icon"><use xlink:href="{{ '/assets/minima-social-icons.svg#youtube' | relative_url }}"></use></svg> <span class="username">{{ site.youtube_username| escape }}</span></a></li>{%- endif -%}
{%- if site.youtube_channel -%}<li><a href="https://www.youtube.com/channel/{{ site.youtube_channel| cgi_escape | escape }}"><svg class="svg-icon"><use xlink:href="{{ '/assets/minima-social-icons.svg#youtube' | relative_url }}"></use></svg><span class="username">{%- if site.youtube_channel_name -%}{{ site.youtube_channel_name | escape }}{%- else -%}YouTube{%- endif -%}</span></a></li>{%- endif -%}
{%- if site.microdotblog_username -%}<li><a href="https://micro.blog/{{ site.microdotblog_username| cgi_escape | escape }}"><svg class="svg-icon"><use xlink:href="{{ '/assets/minima-social-icons.svg#microdotblog' | relative_url }}"></use></svg> <span class="username">{{ site.microdotblog_username| escape }}</span></a></li>{%- endif -%}
{%- if site.googleplus_username -%}<li><a href="https://plus.google.com/{{ site.googleplus_username| escape }}"><svg class="svg-icon"><use xlink:href="{{ '/assets/minima-social-icons.svg#googleplus' | relative_url }}"></use></svg> <span class="username">{{ site.googleplus_username| escape }}</span></a></li>{%- endif -%}
{%- if site.rss -%}<li><a href="{{ 'feed.xml' | relative_url }}"><svg class="svg-icon"><use xlink:href="{{ '/assets/minima-social-icons.svg#rss' | relative_url }}"></use></svg> <span>{{ site.rss | escape }}</span></a></li>{%- endif -%}
Expand Down

0 comments on commit 3e78c58

Please sign in to comment.