blogging-site-theme 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57635fc22e6dc7168cb704a898231096d26ded62c430d2833526911bb33cd763
4
- data.tar.gz: 7ac877317df53648417a843c44150b59820a3492c087a0bed39211d5840bd10c
3
+ metadata.gz: 537c93a1109f86c3ae6952bde8412428b996dc06b4a5dcab17be07a59234f4b7
4
+ data.tar.gz: 5486c60a3d336bedf32e5a2dcfce40a735ac1d92da8ff50c5dd56a163ec3f71a
5
5
  SHA512:
6
- metadata.gz: b90b97f6987142a2931497f18be3b7b0ef685c79f8696cad6138220f6cf65bdd9f004790a0648e688effeca870277068be628f01f7f37c46af85b51176431b49
7
- data.tar.gz: b91738116a67266ec260151ff70a44048e37cf260a57d9bd8ea13ffa69bc7db930576cd39158d729b0f2ab8f24fe837aed892b9c657a75a8707b29f0412d83b1
6
+ metadata.gz: 025c50856980dd1d22f5d8242dadb3891cbee4a233e594e4528ec8a20184ee0b867ac35dc0b2a9cb62f3d0940dcf23af0db22b305cb7a286dae3af2b7387f14f
7
+ data.tar.gz: 5f08a3fc56fa1c5a3e56cd2c03135681fb9e4087ece5e5c1d4af55fdfe1649b00a1ba92b402682904a7d1d826021e4e459bc35d87e4ea6e47f8e57587e0b24ba
@@ -1,42 +1,44 @@
1
1
  <div class="container">
2
- <div class="relatedPosts">
2
+ <div class="recentPosts">
3
+ {%- if site.posts.size>0 -%}
3
4
  <h1 class="related_post_heading">Recent Posts</h1>
5
+ {%- endif -%}
4
6
  <div class="row">
5
- {% for recent in site.posts offset:1 limit:3 %}
6
- {% if recent.url != page.url %}
7
- <div class="col-lg-4 col-md-6 mb-5 card-group">
7
+ {% assign posts = site.posts | where_exp:"post","post.url != page.url" %}
8
+ {% for post in posts limit: 3%}
9
+
10
+ <div class="col-lg-4 col-md-6 mb-4 card-group">
8
11
  <div class="card h-100">
9
- <a href="{{ recent.url }}">
10
- <img src="{{ recent.image }}" class="card-img-top" alt="{{recent.url}}"
11
- style="width:100%; border-radius: 4px; height: 200px;">
12
+ <a href="{{ post.url }}">
13
+ <img src="{{ post.image }}" class="card-img-top" height="215px" width="100%" loading="lazy"
14
+ alt="">
12
15
  </a>
13
16
  <div class="card-body">
14
- <a class="text-decoration-none text-dark" href="{{ recent.url }}" class="anchor_link">
15
- <h4 class="card-title mb-4 text-left">{{ recent.title }}</h4>
17
+ <a class="text-decoration-none text-dark" href="{{ post.url }}" class="anchor_link">
18
+ <h4 class="card-title mb-4 text-left">{{ post.title }}</h4>
16
19
  </a>
17
20
  </div>
18
- {% assign author = site.data.blog.authors[recent.author] %}
19
21
  <div class="card-footer bg-white">
20
22
  <div class="wrapfooter">
21
- {% if recent.author %}
23
+ {% assign author = site.data.blog.authors[post.author] %}
24
+
25
+ {% if post.author %}
22
26
  <span class="meta-footer-thumb">
23
- <img class="author-thumb" src="{{ author.image }}" alt="{{ author.name }}">
27
+ <img class="author-thumb" loading="lazy" src="{{author.image}}" alt="{{ authorName }}">
24
28
  </span>
25
29
  {% endif %}
26
-
27
30
  <span class="author-meta">
28
- <span class="recent-name">
29
- <a target="_blank" href="/blog">{{recent.author}}</a>
31
+ <span class="post-name">
32
+ <a target="_blank" href="/blog"> {{author.name}}</a>
30
33
  </span><br>
31
- <span class="post-date">{{recent.date | date_to_string }}</span>
34
+ <span class="post-date">{{post.date | date_to_string }}</span>
32
35
  </span>
33
- <span class="post-read-more"><a class="text-dark" href="{{ recent.url }}"
36
+ <span class="post-read-more"><a class="text-dark" href="{{ post.url }}"
34
37
  title="Read Story">Read More</a></span>
35
38
  </div>
36
39
  </div>
37
40
  </div>
38
41
  </div>
39
- {% endif %}
40
42
  {% endfor %}
41
43
  </div>
42
44
  </div>
@@ -1,54 +1,156 @@
1
1
  <div class="container">
2
2
  <div class="relatedPosts">
3
- {%- if page.categories -%}
3
+
4
4
  <h2 class="pt-5 pb-0 related_post_heading">You might also like</h2>
5
- {%- endif -%}
5
+
6
+ {% assign maxRelated = 6 %}
7
+ {% assign minCommonTags = 1 %}
8
+ {% assign maxRelatedCounter = 0 %}
6
9
 
7
10
  <div class="row">
8
11
  {% for post in site.posts %}
12
+ {% assign sameTagCount = 0 %}
13
+ {% assign commonTags = '' %}
14
+
9
15
 
16
+ {%- if page.categories-%}
10
17
  {% for category in post.categories %}
11
18
  {% if post.url != page.url %}
12
19
  {% if page.categories contains category %}
20
+ {% assign sameTagCount = sameTagCount | plus: 1 %}
21
+ {% endif %}
22
+ {% endif %}
23
+ {% endfor %}
24
+ {%- endif -%}
25
+
26
+ {%- if page.tags -%}
27
+ {% for tag in post.tags %}
28
+ {% if post.url != page.url %}
29
+ {% if page.tags contains tag %}
30
+ {% assign sameTagCount = sameTagCount | plus: 1 %}
31
+ {% endif %}
32
+ {%- endif -%}
33
+ {% endfor %}
34
+ {%- endif -%}
35
+
36
+
37
+ {% if sameTagCount >= minCommonTags %}
13
38
 
14
- <div class="col-lg-4 col-md-6 mb-5 card-group">
39
+ <div class="col-lg-4 col-md-6 mb-4 card-group">
15
40
  <div class="card h-100">
16
41
  <a href="{{ post.url }}">
17
- <img src="{{ post.image }}" style="width:100%; border-radius: 4px; height: 200px;"
18
- class="card-img-top" alt="{{post.url}}">
42
+ <img src="{{ post.image }}" loading="lazy" class="card-img-top" height="auto" width="100%"
43
+ alt="">
19
44
  </a>
20
45
  <div class="card-body">
21
46
  <a class="text-decoration-none text-dark" href="{{ post.url }}" class="anchor_link">
22
47
  <h4 class="card-title mb-4 text-left">{{ post.title }}</h4>
23
48
  </a>
24
49
  </div>
25
- {% assign author = site.data.blog.authors[post.author] %}
26
50
  <div class="card-footer bg-white">
27
- <div class="wrapfooter" style="justify-content: space-between;
28
- ">
51
+ <div class="wrapfooter">
29
52
  {% if post.author %}
30
53
  <span class="meta-footer-thumb">
31
- <img class="author-thumb" src="{{ author.image }}" alt="{{ author.name }}">
54
+ <img class="author-thumb" loading="lazy" src="{{ image }}" alt="{{ authorName }}">
32
55
  </span>
33
56
  {% endif %}
34
57
 
35
- <!-- <span class="author-meta">
58
+ <span class="author-meta">
36
59
  <span class="post-name">
37
- <a target="_blank" href="/blog">{{post.author}}</a>
60
+ <a target="_blank" href="/blog">{{authorName}}</a>
38
61
  </span><br>
39
62
  <span class="post-date">{{post.date | date_to_string }}</span>
40
- </span> -->
41
- <span class="post-read-more ml-5"><a class="text-dark" href="{{ post.url }}"
42
- title="Read Story">Read More</a></span>
63
+ </span>
64
+ <span class="post-read-more"><a class="text-dark" href="{{ post.url }}"
65
+ title="Read Story">Read
66
+ More</a></span>
43
67
  </div>
44
68
  </div>
45
69
  </div>
46
70
  </div>
71
+ {% assign maxRelatedCounter = maxRelatedCounter | plus: 1 %}
72
+ {% if maxRelatedCounter >= maxRelated %}
73
+ {% break %}
74
+ {% endif %}
75
+ {%- else -%}
76
+ {%- endif -%}
77
+ {% endfor %}
78
+ {%- assign remamingPosts = maxRelated | minus: maxRelatedCounter -%}
79
+
80
+
81
+
47
82
 
83
+ {%- if remamingPosts > 0 -%}
84
+ {% assign posts = site.posts | where_exp:"post","post.url != page.url" %}
85
+ {% for post in posts %}
86
+ {%- if remamingPosts > 0 -%}
87
+ {%- assign tagData = true -%}
88
+ {%- assign catData = true -%}
89
+ {%- if page.tags -%}
90
+ {% for tag in post.tags %}
91
+ {% if post.url != page.url %}
92
+ {% if page.tags contains tag %}
93
+ {%- assign tagData = false -%}
94
+ {%- break -%}
95
+ {% endif %}
96
+ {%- endif -%}
97
+ {% endfor %}
98
+ {%- endif -%}
99
+ {%- if page.categories-%}
100
+ {%- if tagData == false -%}
101
+ {%- continue -%}
102
+ {%- else -%}
103
+ {% for category in post.categories %}
104
+ {% if post.url != page.url %}
105
+ {% if page.categories contains category %}
106
+ {%- assign catData = false -%}
107
+ {%- break -%}
48
108
  {% endif %}
49
109
  {% endif %}
50
110
  {% endfor %}
111
+ {%- endif -%}
112
+ {%- if catData == false -%}
113
+ {%- continue -%}
114
+ {%- endif -%}
115
+ {%- assign remamingPosts = remamingPosts | minus: 1 -%}
116
+
117
+ <div class="col-lg-4 col-md-6 mb-4 card-group">
118
+ <div class="card h-100">
119
+ <a href="{{ post.url }}">
120
+ <img src="{{ post.image }}" class="card-img-top" height="215px" width="100%" loading="lazy"
121
+ alt="">
122
+ </a>
123
+ <div class="card-body">
124
+ <a class="text-decoration-none text-dark" href="{{ post.url }}" class="anchor_link">
125
+ <h4 class="card-title mb-4 text-left">{{ post.title }}</h4>
126
+ </a>
127
+ </div>
128
+ <div class="card-footer bg-white">
129
+ <div class="wrapfooter">
130
+ {% if post.author %}
131
+ <span class="meta-footer-thumb">
132
+ <img class="author-thumb" loading="lazy" src="{{image}}" alt="{{ authorName }}">
133
+ </span>
134
+ {% endif %}
135
+ <span class="author-meta">
136
+ <span class="post-name">
137
+ <a target="_blank" href="/blog">{{authorName}}</a>
138
+ </span><br>
139
+ <span class="post-date">{{post.date | date_to_string }}</span>
140
+ </span>
141
+ <span class="post-read-more"><a class="text-dark" href="{{ post.url }}"
142
+ title="Read Story">Read
143
+ More</a></span>
144
+ </div>
145
+ </div>
146
+ </div>
147
+ </div>
148
+ {%- endif -%}
149
+ {%- endif -%}
150
+
51
151
  {% endfor %}
152
+ {%- endif -%}
153
+
52
154
  </div>
53
155
  </div>
54
156
  </div>
data/_layouts/post.html CHANGED
@@ -6,8 +6,9 @@
6
6
  width: auto;
7
7
  max-width: 100%;
8
8
  }
9
- @media(max-width:768px){
10
- .main_h1{
9
+
10
+ @media(max-width:768px) {
11
+ .main_h1 {
11
12
  font-size: 1rem !important;
12
13
  }
13
14
  }
@@ -58,20 +59,22 @@
58
59
  <div class="post-content fetch-posts-content mt-5">
59
60
  {{ content }}
60
61
  </div>
61
-
62
+
62
63
  {%- include paginationPostPage.html -%}
63
- {%- include section/related_post.html -%}
64
+
64
65
  <div class="commentsection">
65
66
  {%- if site.disqus.shortname -%}
66
67
  {%- include disqus_comments.html -%}
67
68
  {%- endif -%}
68
69
  </div>
70
+
69
71
  </div>
70
72
  </div>
73
+ {%- include section/related_post.html -%}
71
74
  </section>
72
75
  {%- include section/count.html -%}
73
76
  {% include section/alertbar.html %}
74
-
77
+
75
78
  {%- include footer/index.html -%}
76
79
  {% include scripts.html %}
77
80
  </body>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blogging-site-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - manpreet-singh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-27 00:00:00.000000000 Z
11
+ date: 2021-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll