Skip to content

Commit

Permalink
add: Jekyll-github-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskyfung committed Sep 29, 2020
1 parent 60d3d1e commit c780369
Show file tree
Hide file tree
Showing 11 changed files with 207 additions and 160 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ _site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata
.env
.env*
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ group :jekyll_plugins do
gem 'jekyll-gzip'
gem 'jekyll-redirect-from'
gem 'jekyll-extlinks'
gem "jekyll-github-metadata"
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ GEM
jekyll (>= 3.7, < 5.0)
jekyll-gist (1.5.0)
octokit (~> 4.2)
jekyll-github-metadata (2.13.0)
jekyll (>= 3.4, < 5.0)
octokit (~> 4.0, != 4.4.0)
jekyll-gzip (2.4.2)
jekyll (>= 3.0, < 5.0)
jekyll-loading-lazy (0.1.1)
Expand Down Expand Up @@ -112,6 +115,7 @@ DEPENDENCIES
jekyll-extlinks
jekyll-feed
jekyll-gist
jekyll-github-metadata
jekyll-gzip
jekyll-loading-lazy
jekyll-paginate
Expand Down
24 changes: 18 additions & 6 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,35 @@ paginate: 12
paginate_path: "/blog/page:num/"
permalink: /blog/:year/:month/:day/:title
timezone: 'Asia/Hong_Kong'
isSubdirectory:
baseurl: ''
email: ''
google_analytics: ''
gtm: '' # Google Tag Manager ID
adsense: '' # Google Adsense ID
disqus: ''
disqus-amp-baseurl: 'https://' #baseurl of your AMP disqus iframe element
disqus_amp_baseurl: 'https://' #baseurl of your AMP disqus iframe element
addthis:
cse_id: # Google Custom Search Engine ID
buyme:
sidebar:
featured: true
recent_posts: true
repository: chriskyfung/amp-affiliately-jekyll-theme #<USERNAME>/<PROJECT>

# Authors
authors:
chris:
name: Chris
display_name: Chris
gravatar: abd876486b2caa54b43bf64a5a86f620
John:
name: John Washer
display_name: John
gravatar:
email:
web:
facebook: https://www.facebook.com/
description:
Peter:
name: Peter Mu
display_name: Peter
gravatar:
email:
web:
facebook: https://www.facebook.com/
Expand All @@ -45,6 +56,7 @@ plugins:
- jekyll-gzip
- jekyll-redirect-from
- jekyll-extlinks
- jekyll-github-metadata

# Archives
jekyll-archives:
Expand Down
2 changes: 1 addition & 1 deletion _includes/disqus.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<amp-iframe width=600 height=140 layout="responsive"
sandbox="allow-scripts allow-same-origin allow-modals allow-popups allow-forms"
resizable
src="https://{{ site.disqus-amp-baseurl }}/disqus-amp/q.html?url={{ site.url }}{{ page.url }}&title='{{ page.title }}'"
src="https://{{ site.disqus_amp_baseurl }}/disqus-amp/q.html?url={{ site.url }}{{ page.url }}&title='{{ page.title }}'"
>
<div overflow
tabindex=0
Expand Down
202 changes: 108 additions & 94 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,114 +1,128 @@
<!--
Template Name:Affiliates
Copyright:WowThemes.net,https://www.wowthemes.net
Version:1.0.2
License: https://www.wowthemes.net/freebies-license/
-->

<aside class="sidebar">

{% if page.download %}
<div aria-label="download links" class="sidebar-section">
<h5><span>Resources</span></h5>
{% if site.github.repository_url %}
<a class="btn btn-primary btn-lg col-12 mb-3" href="{{ site.github.repository_url }}" rel="noopener noreferrer">View on GitHub <i class='fab fa-github'></i></a>
{% endif %}
{% if page.download.url %}
<a class="btn btn-primary btn-lg col-12 mb-3" href="{{ page.download.url }}" rel="noopener noreferrer">Download <i class='fas fa-cloud-download-alt'></i></a>
{% elsif site.github.latest_release %}
<a class="btn btn-primary btn-lg col-12 mb-3" href="{{ site.github.latest_release.html_url }}" rel="noopener noreferrer">Latest Release</a>
<div style="display:flex;flex-wrap: wrap;justify-content: space-between;">
<div><i class='fas fa-tag'></i> {{ site.github.latest_release.tag_name }}</div>
<div><i class='fas fa-clock'></i> <time datetime="{{ site.github.latest_release.published_at }}">{{ site.github.latest_release.published_at | date: "%b %d, %Y" }}</time></div>
{% endif %}
{% if site.github.license %}
<div><i class='fas fa-balance-scale'></i> {{ site.github.license.name }}</div>
{% endif %}
</div>
</div>
{% endif %}

{% unless page.url == "/blog/" or page.url contains "/blog/page" or site.isSubdirectory %}
<!-- Featured -->
<div aria-label="featured posts" class="sidebar-section">
<h5><span>Featured</span></h5>
<section class="featured-posts">
{% unless site.sidebar.recent_posts == false or page.url == "/blog/" or page.url contains "/blog/page" %}
<!-- Featured -->
<div aria-label="featured posts" class="sidebar-section">
<h5><span>Featured</span></h5>

<section class="featured-posts">

<div class="row listfeaturedtag">
<div class="row listfeaturedtag">

{% for post in site.posts %}
{% for post in site.posts %}

{% if post.featured == true %}
{% if post.featured == true %}

{% include featuredlist.html %}
{% include featuredlist.html %}

{% endif %}
{% endif %}

{% endfor %}
{% endfor %}

</div>
</div>

</section>
</div>
{% endunless %}
</section>
</div>
{% endunless %}

{% unless page.url == "/" or page.url == "/blog/" or page.url contains "/blog/page"%}
<!-- Recent Posts -->
<div aria-label="recent posts" class="sidebar-section">
<h5><span>Recent Posts</span></h5>
<section class="recent-posts">
{% unless page.url == "/" or page.url == "/blog/" or page.url contains "/blog/page"%}
<!-- Recent Posts -->
<div aria-label="recent posts" class="sidebar-section">
<h5><span>Recent Posts</span></h5>

<section class="recent-posts">

<div class="row listfeaturedtag">
<div class="row listfeaturedtag">

{% for post in site.posts limit:4 %}
{% for post in site.posts limit:4 %}

{% include featuredlist.html %}
{% include featuredlist.html %}

{% endfor %}
{% endfor %}

</div>
</div>

</section>
</div>
{% endunless %}

<div aria-label="useful links" class="sidebar-section">
<h5><span>Useful</span></h5>
<ul style="list-style:list-none">
<li><a href="{{ site.baseurl }}/tag/qwiklabs">Qwiklabs Logbooks & Tools</a></li>
<li><a href="{{ site.baseurl }}/tag/tumblr">For Tumblr Developer</a></li>
<li><a href="{{ site.baseurl }}/tag/matlab">MATLAB Tips</a></li>
<li><a href="{{ site.baseurl }}/tag/evernote/">Evernote Tips</a></li>
<li><a href="{{ site.baseurl }}/contact">Partner with Me</a></li>
<li><a href="https://invitation.codes/@chriskyfung" data-type="badge1" target="_blank" rel="noopener noreferrer">Use my referral codes</a></li>
</ul>
</div>

<!-- {% unless page.url == "/" or page.url == "/blog/" or page.url contains "/blog/page"%}
<div class="sidebar-section">
<h5><span>Recommended for You</span></h5>
<div class="addthis_relatedposts_inline"></div>
</div>
{% endunless %} -->

<div aria-label="youtube" class="sidebar-section">
<h5><span><i class='fab fa-youtube' style="color:red"></i> YouTube</span></h5>
<h6><span>Featured Video 📹</span></h6>
<ul style="list-style:list-none">
<li>{% include youtube-thumb.html id="5UrQ9D-epG8" title='GSP315 Perform Foundational Infrastructure Tasks in Google Cloud: Challenge Lab' %}</li>
</ul>
<amp-iframe
width="240"
height="100"
sandbox="allow-scripts allow-same-origin"
layout="intrinsic"
frameborder="0"
src="https://chriskyfung.gitlab.io/youtube_subscribe_button/youtube_subscribe_button.html"
>
<div fallback>Fail to load script</div>
</amp-iframe>
</div>

<div aria-label="sidbar-ads" class="sidebar-section">
<h5><span>Ads</span></h5>
{% include sidebar-adsense.html %}
</div>

<div aria-label="craftweeks" class="sidebar-section">
<h5><span>Related Sites</span></h5>
<a href="https://craftweeks.com/en/" target="_blank">
{% include picture.html img="craftweeks-logo-with-black-title-transparent-bg-200x67.png" width="200" height="67" alt="Craftweeks logo" source="assets" lightbox=false %}
</a>
<h6><span>Recommended 📬</span></h6>
<ul style="list-style:list-none">
<li>
<a href="https://craftweeks.com/en/tag/postman/" target="_blank">
{% include picture.html img="postman-tutorials-disqus-rest-api.thumb.jpg" width="267" height="150" alt="Postman Tutorials: Case Study of Disqus REST API" source="assets" %}
<b>Postman Tutorials: Case Study of Disqus API</b>
</a>
</li>
</ul>
</section>
</div>
{% endunless %}

<div aria-label="useful links" class="sidebar-section">
<h5><span>Useful</span></h5>
<ul style="list-style:list-none">
<li><a href="{{ site.baseurl }}/tag/qwiklabs">Qwiklabs Logbooks & Tools</a></li>
<li><a href="{{ site.baseurl }}/tag/tumblr">For Tumblr Developer</a></li>
<li><a href="{{ site.baseurl }}/tag/matlab">MATLAB Tips</a></li>
<li><a href="{{ site.baseurl }}/tag/evernote/">Evernote Tips</a></li>
<li><a href="{{ site.baseurl }}/contact">Partner with Me</a></li>
<li><a href="https://invitation.codes/@chriskyfung" data-type="badge1" target="_blank" rel="noopener noreferrer">Use my referral codes</a></li>
</ul>
</div>

<!-- {% unless page.url == "/" or page.url == "/blog/" or page.url contains "/blog/page"%}
<div class="sidebar-section">
<h5><span>Recommended for You</span></h5>
<div class="addthis_relatedposts_inline"></div>
</div>
{% endunless %} -->

<div aria-label="youtube" class="sidebar-section">
<h5><span><i class='fab fa-youtube' style="color:red"></i> YouTube</span></h5>
<h6><span>Featured Video 📹</span></h6>
<ul style="list-style:list-none">
<li>{% include youtube-thumb.html id="5UrQ9D-epG8" title='GSP315 Perform Foundational Infrastructure Tasks in Google Cloud: Challenge Lab' %}</li>
</ul>
<amp-iframe
width="240"
height="100"
sandbox="allow-scripts allow-same-origin"
layout="intrinsic"
frameborder="0"
src="https://chriskyfung.gitlab.io/youtube_subscribe_button/youtube_subscribe_button.html"
>
<div fallback>Fail to load script</div>
</amp-iframe>
</div>

<div aria-label="sidbar-ads" class="sidebar-section">
<h5><span>Ads</span></h5>
{% include sidebar-adsense.html %}
</div>

<div aria-label="craftweeks" class="sidebar-section">
<h5><span>Related Sites</span></h5>
<a href="https://craftweeks.com/en/" target="_blank">
{% include picture.html img="craftweeks-logo-with-black-title-transparent-bg-200x67.png" width="200" height="67" alt="Craftweeks logo" source="assets" lightbox=false %}
</a>
<h6><span>Recommended 📬</span></h6>
<ul style="list-style:list-none">
<li>
<a href="https://craftweeks.com/en/tag/postman/" target="_blank">
{% include picture.html img="postman-tutorials-disqus-rest-api.thumb.jpg" width="267" height="150" alt="Postman Tutorials: Case Study of Disqus REST API" source="assets" %}
<b>Postman Tutorials: Case Study of Disqus API</b>
</a>
</li>
</ul>
</div>

</aside>
4 changes: 3 additions & 1 deletion _posts/2017-11-27-media.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
layout: post
title: Media
date: 2017-11-27 04:00:00
tags: media test
author: Peter
category: test
tags: media
amp:
youtube: true
meta: >-
Expand Down
3 changes: 3 additions & 0 deletions _posts/2017-11-28-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
layout: post
title: Code
date: 2017-11-28 04:00:00
author: John
category: test
tags: code
css:
syntax: true
meta: >-
<meta name="robots" content="noindex">
download: true
---

<p>Code can be presented inline, like <code>&lt;?php bloginfo('stylesheet_url'); ?&gt;</code>, or within a <code>``` ```</code> block.</p>
Expand Down
3 changes: 2 additions & 1 deletion _posts/2017-11-29-sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ image:
path: /assets/images/tree.jpg
title: Sample
date: 2017-11-29 04:00:00
tags: test
author: Peter
category: test
meta: >-
<meta name="robots" content="noindex">
---
Expand Down
6 changes: 4 additions & 2 deletions _posts/2017-11-30-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ image:
path: /assets/images/shiva.jpg
title: Style Guide
date: 2017-11-30 04:00:00
tags: guide
author: Peter
category: guide
featured: true
css:
syntax: true
meta: >-
<meta name="robots" content="noindex">
<meta name="robots" content="noindex">
---

<p>This shows how you can use html styling to achieve your hopes.</p>
Expand Down
Loading

1 comment on commit c780369

@chriskyfung
Copy link
Owner Author

@chriskyfung chriskyfung commented on c780369 Jan 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥 Breaking change

  • (_config.yml): renamed the site-level variable from disqus-amp-baseurl to disqus_amp_baseurl

✨ New Features

  • (sidebar): introduced sidebar.featured and sidebar.recent_posts variables to enable/disable displaying "Featured" and "Recent Posts" widgets in the sidebar, respectively
  • (sidebar): support displaying "Resources" widget (View on GitHub, Latest Release, etc.) to the sidebar by listing download variable in front matter
  • (sidebar): support switching "Latest Release" to "Download" button by specifying download.url with an URL value in front matter
  • (index.html): added feature boxes and pagination to the landing page

🔥 Removed

  • Dropped the site-level variable isSubdirectory

📦 Packages

  • (Gemfile): added the jekyll-github-metadata plugin

🔧 Chore

  • (.gitignore): updated to omit .env files
  • (_config.yml): removed chris's author data

📝 Documentation

  • (sample posts): added tags to front matters

Please sign in to comment.