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.
- checksums.yaml +4 -4
- data/LICENSE.txt +23 -21
- data/README.md +20 -9
- data/_includes/analytics.html +9 -9
- data/_includes/categories.html +10 -13
- data/_includes/comments.html +10 -0
- data/_includes/footer.html +3 -3
- data/_includes/gif.html +4 -0
- data/_includes/head.html +37 -37
- data/_includes/header.html +24 -24
- data/_includes/pages.html +2 -2
- data/_includes/reading_time.html +20 -20
- data/_includes/related-posts.html +35 -35
- data/_includes/social.html +7 -7
- data/_layouts/archive.html +15 -15
- data/_layouts/categories.html +21 -0
- data/_layouts/contact.html +16 -16
- data/_layouts/default.html +18 -18
- data/_layouts/home.html +52 -45
- data/_layouts/page.html +5 -5
- data/_layouts/post.html +45 -45
- data/_sass/base.scss +112 -127
- data/_sass/contact.scss +38 -49
- data/_sass/footer.scss +23 -23
- data/_sass/header.scss +102 -103
- data/_sass/home.scss +35 -36
- data/_sass/mobile.scss +51 -51
- data/_sass/paginator.scss +35 -35
- data/_sass/post.scss +78 -78
- data/_sass/related-posts.scss +22 -22
- data/_sass/scrollbar.scss +16 -16
- data/_sass/typography-old.scss +47 -0
- data/_sass/typography.scss +38 -41
- data/assets/css/main.scss +4 -4
- data/assets/css/syntax.scss +262 -258
- data/assets/img/logo.jpg +0 -0
- data/assets/img/screenshots/Screenshot.png +0 -0
- data/assets/img/screenshots/Screenshot_code_highlight.png +0 -0
- data/assets/img/screenshots/Screenshot_minimal.png +0 -0
- data/assets/img/screenshots/Screenshot_mobile.png +0 -0
- metadata +13 -13
- data/_includes/disqus.html +0 -19
- data/_sass/archive.scss +0 -10
- data/assets/css/main.css +0 -1
- data/assets/css/syntax.css +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4bfab715804649224b1a0bb91d4e646e6b0039bbaefdd76e30519d4ca3270d7
|
4
|
+
data.tar.gz: eac939f819d4463249643ffaaca57398b4974398ae5e01e29249958c7ed201c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f398be5a49c0deb3babce761cfe05d29c950f50b79a72a942e73180d4036ec09c8bfee6eb687902e0ccb9d660beeab07f41f19f33ef081842fbb7e786e454618
|
7
|
+
data.tar.gz: 8beb0498d9da2d6b7a6fd84aa96e0a787ce4948c6af9b4e95d0a12d1c0ae3a58ab4227ef5cb64f5fd32d615f87dd9f7a0794aa6a664b29e726ddb7bf88b40e5b
|
data/LICENSE.txt
CHANGED
@@ -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
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
[](https://yamt.netlify.app/)
|
3
|
-

|
4
4
|
[](https://github.com/PandaSekh/Jekyll-YAMT/issues)
|
5
5
|

|
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://
|
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).
|
data/_includes/analytics.html
CHANGED
@@ -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>
|
data/_includes/categories.html
CHANGED
@@ -1,13 +1,10 @@
|
|
1
|
-
<div class="categories">
|
2
|
-
<span><p>Categories:</p>
|
3
|
-
{%
|
4
|
-
|
5
|
-
|
6
|
-
{
|
7
|
-
|
8
|
-
{%
|
9
|
-
|
10
|
-
|
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 %} {% endunless %}
|
8
|
+
{% endfor %}
|
9
|
+
</span>
|
10
|
+
</div>
|
data/_includes/footer.html
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
<footer class= "footer">
|
2
|
-
<p>Copyright© {{site.author.name}}
|
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>
|
data/_includes/gif.html
ADDED
data/_includes/head.html
CHANGED
@@ -1,37 +1,37 @@
|
|
1
|
-
<
|
2
|
-
<meta
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
{%
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
<link rel="
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
<link rel="
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
<link rel="stylesheet" href="
|
26
|
-
|
27
|
-
<!--
|
28
|
-
<link href="https://
|
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 -->
|
data/_includes/header.html
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
<header id="header">
|
2
|
-
<div id = site_title>
|
3
|
-
<a href="{{
|
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>
|
data/_includes/pages.html
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
{% for item in site.data.pages.pages %}
|
2
|
-
<a href="{{
|
1
|
+
{% for item in site.data.pages.pages %}
|
2
|
+
<a href="{{ item.url | relative_url}}">{{ item.name }}</a>
|
3
3
|
{% endfor %}
|
data/_includes/reading_time.html
CHANGED
@@ -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="{{
|
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>
|