jekyll-yamt 1.0.0 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +23 -21
  3. data/README.md +20 -9
  4. data/_includes/analytics.html +9 -9
  5. data/_includes/categories.html +10 -13
  6. data/_includes/comments.html +10 -0
  7. data/_includes/footer.html +3 -3
  8. data/_includes/gif.html +4 -0
  9. data/_includes/head.html +37 -37
  10. data/_includes/header.html +24 -24
  11. data/_includes/pages.html +2 -2
  12. data/_includes/reading_time.html +20 -20
  13. data/_includes/related-posts.html +35 -35
  14. data/_includes/social.html +7 -7
  15. data/_layouts/archive.html +15 -15
  16. data/_layouts/categories.html +21 -0
  17. data/_layouts/contact.html +16 -16
  18. data/_layouts/default.html +18 -18
  19. data/_layouts/home.html +52 -45
  20. data/_layouts/page.html +5 -5
  21. data/_layouts/post.html +45 -45
  22. data/_sass/base.scss +112 -127
  23. data/_sass/contact.scss +38 -49
  24. data/_sass/footer.scss +23 -23
  25. data/_sass/header.scss +102 -103
  26. data/_sass/home.scss +35 -36
  27. data/_sass/mobile.scss +51 -51
  28. data/_sass/paginator.scss +35 -35
  29. data/_sass/post.scss +78 -78
  30. data/_sass/related-posts.scss +22 -22
  31. data/_sass/scrollbar.scss +16 -16
  32. data/_sass/typography-old.scss +47 -0
  33. data/_sass/typography.scss +38 -41
  34. data/assets/css/main.scss +4 -4
  35. data/assets/css/syntax.scss +262 -258
  36. data/assets/img/logo.jpg +0 -0
  37. data/assets/img/screenshots/Screenshot.png +0 -0
  38. data/assets/img/screenshots/Screenshot_code_highlight.png +0 -0
  39. data/assets/img/screenshots/Screenshot_minimal.png +0 -0
  40. data/assets/img/screenshots/Screenshot_mobile.png +0 -0
  41. metadata +13 -13
  42. data/_includes/disqus.html +0 -19
  43. data/_sass/archive.scss +0 -10
  44. data/assets/css/main.css +0 -1
  45. data/assets/css/syntax.css +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31c59a08dd085bd5e9daa15fd8ce1b9e2881e30f0e066fb513c2a18d3acbca4e
4
- data.tar.gz: 26c6a6db2abd24c636d9da4028ecde3d89dbb42c6b582135774c6f68443fb019
3
+ metadata.gz: a4bfab715804649224b1a0bb91d4e646e6b0039bbaefdd76e30519d4ca3270d7
4
+ data.tar.gz: eac939f819d4463249643ffaaca57398b4974398ae5e01e29249958c7ed201c4
5
5
  SHA512:
6
- metadata.gz: 94723a3bc47259c4381e86ea6b24eaa1302bdbed008cbf911b126828160b8dc75efb7f2918e33f1af1e513ab1fe3f9140f33fe505cb4723d01ceac989eb44cb5
7
- data.tar.gz: 23fccc79a12f7a0bcde9a9c7bcaca3bbc62e89779ce9dc4f03bc8b55be8e3e45151c03564ce3d762f7cd067e34cefcf86fffccc0d1ec45960b0bee7a08d8679a
6
+ metadata.gz: f398be5a49c0deb3babce761cfe05d29c950f50b79a72a942e73180d4036ec09c8bfee6eb687902e0ccb9d660beeab07f41f19f33ef081842fbb7e786e454618
7
+ data.tar.gz: 8beb0498d9da2d6b7a6fd84aa96e0a787ce4948c6af9b4e95d0a12d1c0ae3a58ab4227ef5cb64f5fd32d615f87dd9f7a0794aa6a664b29e726ddb7bf88b40e5b
@@ -1,21 +1,23 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2020 PandaSekh
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 PandaSekh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ Leave the name of the author of this theme in the footer.
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # [YAMT - Yet Another Minimal Theme](https://yamt.netlify.app/)
2
2
  [![Netlify Status](https://api.netlify.com/api/v1/badges/249c3da6-7b23-4b57-915d-71934329e306/deploy-status)](https://yamt.netlify.app/)
3
- ![supports mathjax](https://img.shields.io/badge/Supports-MathJAX-blue)
3
+ ![](https://badgen.net/rubygems/dt/jekyll-yamt)
4
4
  [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/PandaSekh/Jekyll-YAMT/issues)
5
5
  ![GitHub forks](https://img.shields.io/github/forks/PandaSekh/Jekyll-YAMT?label=Fork%20it%21&style=social)
6
6
  ## [Live Demo](https://yamt.netlify.app/)
@@ -16,6 +16,7 @@ YAMT is a minimal [Jekyll](http://jekyllrb.com) theme focused on simplicity and
16
16
  - [Installation](#installation)
17
17
  - [Customize](#options)
18
18
  - [Basics](#Basics)
19
+ - [Typography](#Typography)
19
20
  - [Header](#header)
20
21
  - [Home](#home)
21
22
  - [Post](#post)
@@ -29,6 +30,7 @@ YAMT is a minimal [Jekyll](http://jekyllrb.com) theme focused on simplicity and
29
30
  - Minimal and clean design.
30
31
  - Fully modular: activate and load only what you really need.
31
32
  - Works great on mobile and smaller screens.
33
+ - Works on Github Pages.
32
34
  - Supports [Disqus](https://disqus.com/) comments activated only on button press, if you activate them.
33
35
  - [Google Analytics](https://www.google.com/analytics/) support.
34
36
  - [Open Graph](https://ogp.me/) and [Twitter Cards](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started) support to better index the website content on search engines and social networks.
@@ -51,6 +53,9 @@ Minimal:
51
53
 
52
54
  There are four way to use YAMT: Netlify (suggested, as this theme has a contact module built-in working only on Netlify), Github Pages, as a gem-based theme, by forking this repo or by copying all the files into your directory.
53
55
 
56
+ ### Download the files
57
+ You can [download the files](https://github.com/PandaSekh/Jekyll-YAMT/releases/latest) and add them in your directory to start working.
58
+
54
59
  ### Netlify
55
60
 
56
61
  1. [Fork this repo](https://github.com/PandaSekh/Jekyll-YAMT/generate). You can copy only master, set it to private or public and name it however you want.
@@ -95,30 +100,35 @@ Github Pages uses the [--safe flag](https://jekyllrb.com/docs/configuration/opti
95
100
  $ gem install jekyll-yamt
96
101
  ```
97
102
 
103
+ #### ERROR: There was an error while loading `jekyll-yamt.gemspec`: No such file or directory - git ls-files -z. Bundler cannot continue.
104
+ If you encounter this error when running `bundle install`, please make sure git is installed.
98
105
 
99
106
  ## Customize
100
107
 
101
- YAMT is easily customizable. If you don't need a functionality, just deactivate it in _data/settings.yml.
102
- Most of the customizable things are self-explanatory and found in the _data folder and in the _config.yml.
108
+ YAMT is easily customizable. If you don't need a functionality, just deactivate it in `_data/settings.yml`.
109
+ Most of the customizable things are self-explanatory and found in the `_data` folder and in the `_config.yml`.
103
110
 
104
111
  ### Basics
105
112
 
106
- Under the _data folder there are three files: pages, settings and social.
113
+ Under the `_data` folder there are three files: pages, settings and social.
107
114
  In pages you can add other pages that will show up in the nav-
108
115
  In social you can add your socials that will show up in the nav. To add a social, find a suitable icon on [FontAwesome](https://fontawesome.com/) and add it's name in the name tag.
109
116
  Brand defines Font Awesome's font type (fas is solid, fab is brand).
110
117
  Out of the box this theme has support colors for a bunch of social. If your social isn't supported, just add the color in the header.css
111
118
 
112
- In settings.yml you can activate or deactivate various functions of the theme, like analytics, disqus comments, related posts and so on.
119
+ In `_data/settings.yml` you can activate or deactivate various functions of the theme, like analytics, disqus comments, related posts and so on.
120
+
121
+ ### Typography
122
+ By default YAMT uses the System Font STack, which greatly reduces load times. If you want to use the old Font Stack, in `assets/main.scss` change `typography` to `typography-old`.
113
123
 
114
124
  ### Header
115
- In _data/settings.yml you can choose to hide or show the subtitle, the page navigation or the social icons.
125
+ In `_data/settings.yml` you can choose to hide or show the subtitle, the page navigation or the social icons.
116
126
 
117
127
  ### Home
118
- In _data/settings.yml you can choose to hide or show the posts infos (date and read-time) and the featured image.
128
+ In `_data/settings.yml` you can choose to hide or show the posts infos (date and read-time) and the featured image.
119
129
 
120
130
  ### Post
121
- In _data/settings.yml you can choose to hide or show the post infos, categories, related posts and comments.
131
+ In `_data/settings.yml` you can choose to hide or show the post infos, categories, related posts and comments.
122
132
  Note that by removing categories the Categories Archives will no longer be reachable.
123
133
 
124
134
  ### Contact Form
@@ -137,9 +147,10 @@ When your theme is released, only the files in `_layouts`, `_includes`, `_sass`
137
147
  To add a custom directory to your theme-gem, please edit the regexp in `yamt.gemspec` accordingly.
138
148
 
139
149
  ## Credits
150
+ Theme designed and created by [Alessio Franceschi](https://github.com/PandaSekh/).
140
151
  Inspired by [Lagrange by LeNPaul](https://lenpaul.github.io/Lagrange/).
141
152
  Also great help from [this blog](https://blog.webjeda.com/), I've used this even before I created this theme.
142
153
  Images from [Unsplash](https://unsplash.com/).
143
154
 
144
155
  ## License
145
- The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
156
+ The theme is available as open source under the terms of the [MIT License](https://github.com/PandaSekh/Jekyll-YAMT/blob/master/LICENSE.txt).
@@ -1,9 +1,9 @@
1
- <!-- Global site tag (gtag.js) - Google Analytics -->
2
- <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.analytics-id }}"></script>
3
- <script>
4
- window.dataLayer = window.dataLayer || [];
5
- function gtag(){dataLayer.push(arguments);}
6
- gtag('js', new Date());
7
-
8
- gtag('config', '{{ site.analytics-id }}');
9
- </script>
1
+ <!-- Global site tag (gtag.js) - Google Analytics -->
2
+ <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.data.settings.analytics-id }}"></script>
3
+ <script>
4
+ window.dataLayer = window.dataLayer || [];
5
+ function gtag(){dataLayer.push(arguments);}
6
+ gtag('js', new Date());
7
+
8
+ gtag('config', '{{ site.data.settings.analytics-id }}');
9
+ </script>
@@ -1,13 +1,10 @@
1
- <div class="categories">
2
- <span><p>Categories:</p>
3
- {% if post %}
4
- {% assign categories = post.categories %}
5
- {% else %}
6
- {% assign categories = page.categories %}
7
- {% endif %}
8
- {% for category in categories %}
9
- <a href="{{site.url}}/categories/#{{category|slugize}}">{{category}}</a>
10
- {% unless forloop.last %}&nbsp;{% endunless %}
11
- {% endfor %}
12
- </span>
13
- </div>
1
+ <div class="categories">
2
+ <span><p>Categories:</p>
3
+ {% assign categories = page.categories %}
4
+ {% for category in categories %}
5
+ <a href="{% capture url %}/categories/#{{ category | slugify }}{% endcapture %}
6
+ {{ url | relative_url }}">{{category}}</a>
7
+ {% unless forloop.last %}&nbsp;{% endunless %}
8
+ {% endfor %}
9
+ </span>
10
+ </div>
@@ -0,0 +1,10 @@
1
+ <section class="comments">
2
+ <script src="https://utteranc.es/client.js"
3
+ repo="#"
4
+ issue-term="pathname"
5
+ label="Comment 💬"
6
+ theme="github-light"
7
+ crossorigin="anonymous"
8
+ async>
9
+ </script>
10
+ </section>
@@ -1,3 +1,3 @@
1
- <footer class= "footer">
2
- <p>Copyright© {{site.author.name}} 2020. All right reserved. Theme designed by <a href="https://alessiofranceschi.me/">Alessio Franceschi</a>.</p>
3
- </footer>
1
+ <footer class= "footer">
2
+ <p>Copyright © {{ 'now' | date: "%Y" }} {{site.author.name}}. All rights reserved. Theme designed by <a href="https://alessiofranceschi.me/">Alessio Franceschi</a>.</p>
3
+ </footer>
@@ -0,0 +1,4 @@
1
+ <video autoplay loop muted playsinline>
2
+ <source src="{{/assets/gif/{{include.file}}.webm | relative_url }}" type="video/webm">
3
+ <source src="{{/assets/gif/{{include.file}}.mp4 | relative_url }}" type="video/mp4">
4
+ </video>
@@ -1,37 +1,37 @@
1
- <html lang="en-US">
2
- <meta charset="UTF-8">
3
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
4
-
5
- <title>
6
- {% if page.title == "Home" %}
7
- {{ site.title }} | {{ site.description }}
8
- {% else %}
9
- {{ page.title }} | {{ site.title }}
10
- {% endif %}
11
- </title>
12
- <meta name="description" content="
13
- {% if page.description %}{{ page.description }}
14
- {% else %}{{ site.description }}
15
- {% endif %}">
16
-
17
- <link rel="icon" href="/assets/favicon.ico" type="image/x-icon">
18
- <link rel="shortcut icon" href="/assets/favicon.ico" type="image/x-icon">
19
-
20
- <!-- CSS -->
21
- <link rel="stylesheet" href="{{ "/assets/css/main.css" | prepend: site.baseurl | replace: '//', '/' }}">
22
- <link rel="stylesheet" href="{{ "/assets/css/syntax.css" | prepend: site.baseurl | replace: '//', '/' }}">
23
-
24
- <!-- Icons -->
25
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css">
26
-
27
- <!-- Fonts -->
28
- <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=PT+Serif&display=swap" rel="stylesheet">
29
-
30
- <!-- SEO Plugin -->
31
- {% seo %}
32
-
33
- <!-- Google Analytics -->
34
- {% if site.data.settings.analytics-id%}
35
- {%- include analytics.html -%}
36
- {% endif %}
37
- <!-- End Google Analytics -->
1
+ <meta charset="UTF-8">
2
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
3
+
4
+ <title>
5
+ {% if page.title == "Home" %}
6
+ {{ site.title }} | {{ site.description }}
7
+ {% else %}
8
+ {{ page.title }} | {{ site.title }}
9
+ {% endif %}
10
+ </title>
11
+ <meta name="description" content="
12
+ {% if page.description %}{{ page.description }}
13
+ {% else %}{{ site.description }}
14
+ {% endif %}">
15
+
16
+ <!-- LINK TO ATOM FEED FOR SEO -->
17
+ <link rel="alternate" type="application/atom+xml" href="{{ site.url }}/feed.xml" />
18
+
19
+ <!-- FAVICON -->
20
+ <link rel="icon" href="{{"assets/favicon.ico" | relative_url }}" type="image/x-icon">
21
+ <link rel="shortcut icon" href="{{"assets/favicon.ico" | relative_url }}" type="image/x-icon">
22
+
23
+ <!-- CSS -->
24
+ <link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}">
25
+ <link rel="stylesheet" href="{{ "/assets/css/syntax.css" | relative_url }}">
26
+
27
+ <!-- Icons -->
28
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css">
29
+
30
+ <!-- SEO Plugin -->
31
+ {% seo %}
32
+
33
+ <!-- Google Analytics -->
34
+ {% if site.data.settings.analytics-id%}
35
+ {%- include analytics.html -%}
36
+ {% endif %}
37
+ <!-- End Google Analytics -->
@@ -1,25 +1,25 @@
1
- <header id="header">
2
- <div id = site_title>
3
- <a href="{{ site.url }}">
4
- <h1>{{site.title}}</h1>
5
- </a>
6
- {% if site.data.settings.subtitle.active %}
7
- <h2>
8
- {{ site.data.settings.subtitle.text }}
9
- </h2>
10
- {% endif %}
11
- </div>
12
-
13
- <div id="subheader">
14
- {% if site.data.settings.nav.pages.active %}
15
- <nav class="pages">
16
- {%- include pages.html -%}
17
- </nav>
18
- {% endif %}
19
- {% if site.data.settings.nav.social.active %}
20
- <nav class="social">
21
- {% include social.html %}
22
- </nav>
23
- {% endif %}
24
- </div>
1
+ <header id="header">
2
+ <div id = site_title>
3
+ <a href="{{ "/" | absolute_url }}">
4
+ <h1>{{site.title}}</h1>
5
+ </a>
6
+ {% if site.data.settings.subtitle.active %}
7
+ <h2>
8
+ {{ site.data.settings.subtitle.text }}
9
+ </h2>
10
+ {% endif %}
11
+ </div>
12
+
13
+ <div id="subheader">
14
+ {% if site.data.settings.nav.pages.active %}
15
+ <nav class="pages">
16
+ {%- include pages.html -%}
17
+ </nav>
18
+ {% endif %}
19
+ {% if site.data.settings.nav.social.active %}
20
+ <nav class="social">
21
+ {% include social.html %}
22
+ </nav>
23
+ {% endif %}
24
+ </div>
25
25
  </header>
@@ -1,3 +1,3 @@
1
- {% for item in site.data.pages.pages %}
2
- <a href="{{ site.url }}/{{ item.url }}">{{ item.name }}</a>
1
+ {% for item in site.data.pages.pages %}
2
+ <a href="{{ item.url | relative_url}}">{{ item.name }}</a>
3
3
  {% endfor %}
@@ -1,21 +1,21 @@
1
- {% if post.layout != post %}
2
- {% assign words = post.content | strip_html | number_of_words %}
3
- {% if words < 180 %}
4
- Less than 1 minute read
5
- {% elsif words < 360 %}
6
- 1 minute read
7
- {% else %}
8
- {{ words | divided_by:180 }} minute read
9
- {% endif %}
10
- {% endif %}
11
-
12
- {% if post.layout == post %}
13
- {% assign words = content | number_of_words %}
14
- {% if words < 180 %}
15
- Less than 1 minute read
16
- {% elsif words < 360 %}
17
- 1 minute read
18
- {% else %}
19
- {{ words | divided_by:180 }} minute read
20
- {% endif %}
1
+ {% if post.layout != post %}
2
+ {% assign words = post.content | strip_html | number_of_words %}
3
+ {% if words < 180 %}
4
+ Less than 1 minute read
5
+ {% elsif words < 360 %}
6
+ 1 minute read
7
+ {% else %}
8
+ {{ words | divided_by:180 }} minute read
9
+ {% endif %}
10
+ {% endif %}
11
+
12
+ {% if post.layout == post %}
13
+ {% assign words = content | strip_html | number_of_words %}
14
+ {% if words < 180 %}
15
+ Less than 1 minute read
16
+ {% elsif words < 360 %}
17
+ 1 minute read
18
+ {% else %}
19
+ {{ words | divided_by:180 }} minute read
20
+ {% endif %}
21
21
  {% endif %}
@@ -1,36 +1,36 @@
1
- <div class="related">
2
-
3
- <h4>{{site.data.settings.related-posts.title}}</h4>
4
-
5
- {% assign maxRelated = 4 %}
6
- {% assign minCommonTags = 1 %}
7
- {% assign maxRelatedCounter = 0 %}
8
-
9
- {% for post in site.posts %}
10
-
11
- {% assign sameTagCount = 0 %}
12
- {% assign commonTags = '' %}
13
-
14
- {% for category in post.categories %}
15
- {% if post.url != page.url %}
16
- {% if page.categories contains category %}
17
- {% assign sameTagCount = sameTagCount | plus: 1 %}
18
- {% capture tagmarkup %} <span class="label label-default">{{ category }}</span> {% endcapture %}
19
- {% assign commonTags = commonTags | append: tagmarkup %}
20
- {% endif %}
21
- {% endif %}
22
- {% endfor %}
23
-
24
- {% if sameTagCount >= minCommonTags %}
25
- <div class = "related-posts">
26
- <h5><a href="{{ site.baseurl }}{{ post.url }}">• {{ post.title }}</a></h5>
27
- </div>
28
- {% assign maxRelatedCounter = maxRelatedCounter | plus: 1 %}
29
- {% if maxRelatedCounter >= maxRelated %}
30
- {% break %}
31
- {% endif %}
32
- {% endif %}
33
-
34
- {% endfor %}
35
-
1
+ <div class="related">
2
+
3
+ <h4>{{site.data.settings.related-posts.title}}</h4>
4
+
5
+ {% assign maxRelated = 4 %}
6
+ {% assign minCommonTags = 1 %}
7
+ {% assign maxRelatedCounter = 0 %}
8
+
9
+ {% for post in site.posts %}
10
+
11
+ {% assign sameTagCount = 0 %}
12
+ {% assign commonTags = '' %}
13
+
14
+ {% for category in post.categories %}
15
+ {% if post.url != page.url %}
16
+ {% if page.categories contains category %}
17
+ {% assign sameTagCount = sameTagCount | plus: 1 %}
18
+ {% capture tagmarkup %} <span class="label label-default">{{ category }}</span> {% endcapture %}
19
+ {% assign commonTags = commonTags | append: tagmarkup %}
20
+ {% endif %}
21
+ {% endif %}
22
+ {% endfor %}
23
+
24
+ {% if sameTagCount >= minCommonTags %}
25
+ <div class = "related-posts">
26
+ <h5><a href="{{ post.url | relative_url}}">• {{ post.title }}</a></h5>
27
+ </div>
28
+ {% assign maxRelatedCounter = maxRelatedCounter | plus: 1 %}
29
+ {% if maxRelatedCounter >= maxRelated %}
30
+ {% break %}
31
+ {% endif %}
32
+ {% endif %}
33
+
34
+ {% endfor %}
35
+
36
36
  </div>