jekyll-theme-mehdix-rtl 0.1.16 → 0.1.17

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
  SHA1:
3
- metadata.gz: 800d8c54851b2f1b160a860c4bc342b4d8430de9
4
- data.tar.gz: 417f37477e70e1e7a867409071a5a0bbc2620881
3
+ metadata.gz: b21cff9c7cc95a61d98eb7e2b54ebbb5aa9735c3
4
+ data.tar.gz: a2302a07e802a2cacbb7f84f0b77feb9500cd4f2
5
5
  SHA512:
6
- metadata.gz: d91ec71f6d202a6ea3d7ff2a3086b3f636517b2cbea5084958b7f9330028fd771a1099c997daaa834d98d1d2588d4ee67208dfee88b928650d3efb723250ba4a
7
- data.tar.gz: f53eaa4f0e8cef6d9a6ae319b58f22069edc3ff928b04852d90ea9cd00e301b88149be5f7367f624bc8e3270aa99a246a309793a0ecf85dcef971bb6eaa36326
6
+ metadata.gz: 073cb0e4ed62a152bd60efd02076dc2e59480fcb1abab5a658a19d3a0c021ccfda2dbf47874aa061f69484767df13e29c13deade038f7111040ef39134428dbb
7
+ data.tar.gz: 4703727994ea7ecf65d3da3c776c196e0e1c1a7bedb20f1ac73fceddc96309264d191ce94fbcdf8142c8691ccbf7dbdac198e15bc2ae31a5b41b23da6311ac70
data/README.md CHANGED
@@ -51,7 +51,33 @@ The following layouts are available for your homepage:
51
51
  - minimal: only post titles
52
52
 
53
53
  ### Comments
54
- In order to enalbe disqus comments add `disqus_shortname` to your `_config.yml` file and define your disqus username.
54
+ This theme supports three comment systems. First one is disqus.
55
+ In order to enalbe disqus comments add `comment_system:disqus` and `disqus_shortname:DISQUS_USERNAME` to your `_config.yml` file.
56
+
57
+ The second approach is static comments. In order to enable static comments add `comment_system:static` to the config
58
+ file. This will load commends from `_data/comments` folder. There should be one YAML file per post. Name of the file
59
+ should be the `uuid` of the post (each post must have a `uuid` in its front matter). The following sample defines two
60
+ comments for post with `uuid` 0b64d07f-6c08-475b-a509-463df5458039:
61
+
62
+ ```yaml
63
+ - date: 20171220
64
+ name: تقی
65
+ email: john@doe.com
66
+ url: https://johndoe.com
67
+ text: >
68
+ نوکرتم دادا!
69
+ کوجایی تو؟
70
+
71
+ - date: 20171221
72
+ name: تقی ۲
73
+ email: john@doe.com
74
+ url: https://johndoe.com
75
+ text: >
76
+ [۲] دادا خبری نیت ازت
77
+ ```
78
+
79
+ For the time being I am using Netlify to handle custom comment forms on each post page and add them to the
80
+ comments using the [`netlify_comments.py`](./netlify_comments.py) script.
55
81
 
56
82
  ### Forcing RTL code blocks
57
83
  If you put code blocks and they appear incorrectly, you can use _Markright gem. First add it to your Gemfile:
@@ -0,0 +1,42 @@
1
+ <section id="static-comments">
2
+
3
+ {% assign comments = site.data.comments[page.uuid] %}
4
+ {% if comments %}
5
+ <div id="comments">
6
+ <h4>نظرات سایر خوانندگان</h4> {% for comment in comments %}
7
+ <article>
8
+ <div class="comment-image-wrapper"><img class="comment-avatar" src="https://www.gravatar.com/avatar/{{comment.email}}?s=200&d=robohash" /></div>
9
+ <div class="comment-body-wrapper">
10
+ <h5 style="display: inline"><a href={{comment.url}}>{{ comment.name }}</a></h5>
11
+ <p class="post-meta" style="display: inline"> •&nbsp {{ comment.date }}</p>
12
+ <p>{{ comment.text }}</p>
13
+ </div>
14
+ </article>
15
+ {% endfor%}
16
+ </div>
17
+ {% endif %}
18
+
19
+ <form id="comment-form" name="comment" netlify>
20
+ <input name="bot-field" style="display:none">
21
+ <input name="page_id" style="display:none" value="{{page.id}}">
22
+ <input name="page_uuid" style="display:none" value="{{page.uuid}}">
23
+ <input name="page_date" style="display:none" value="{{page.date}}">
24
+ <input name="page_title" style="display:none" value="{{page.title}}">
25
+ <label for="message">دیدگاه
26
+ <textarea id="message" name="message" required alt="no!!"></textarea>
27
+ </label>
28
+ <label for="name">نام
29
+ <input id="name" type="text" name="name" required>
30
+ </label>
31
+ <label for="email">ایمیل
32
+ <input id="email" type="email" name="email" required>
33
+ </label>
34
+ <label for="website">وبسایت
35
+ <input id="website" type="url" name="website">
36
+ </label>
37
+ <div style="text-align:left">
38
+ <button type="submit">برو به سلامت</button>
39
+ </div>
40
+ </form>
41
+
42
+ </section>
data/_layouts/post.html CHANGED
@@ -2,19 +2,16 @@
2
2
  layout: default
3
3
  ---
4
4
  <div class="post">
5
-
6
5
  <header class="post-header">
7
6
  <h1 class="post-title">{{ page.title }}</h1>
8
7
  <p class="post-meta">
9
- <span class="date">{{ page.date | jdate: "%A %d %b %Y" | habify}}</span>
10
- {% if page.meta %} • {{ page.meta }}{% endif %}
8
+ <span class="date">{{ page.date | jdate: "%A %d %b %Y" | habify}}</span> {% if page.meta %} • {{ page.meta }}{% endif %}
11
9
  </p>
12
10
  </header>
13
-
14
11
  <article class="post-content">
15
12
  {{ content }}
16
13
  </article>
17
-
14
+ {% if site.disqus_shortname %} {% include disqus.html %} {% endif %}
18
15
  <small id="post-tags">
19
16
  {% for tag in page.tags %}
20
17
  <i class="icon-tags"></i>
@@ -22,19 +19,24 @@ layout: default
22
19
  {% endfor %}
23
20
  </small>
24
21
 
25
- <div style="border-top:1px dotted;">
26
- <p>
27
- {% if page.next %}
28
- <a href="{{ page.next.url | absolute_url }}" style="float: left"> {{ page.next.title }} >> </a>
29
- {% endif %}
30
- {% if page.previous %}
31
- <a href="{{ page.previous.url | absolute_url }}" style="margin-right:0px;">&#60&#60 {{ page.previous.title }}</a>
32
- {% endif %}
33
- </p>
34
- </div>
22
+ <nav class="pagination">
23
+ {% if page.previous %}
24
+ <a href="{{ page.previous.url | absolute_url }}" class="pagination--pager" title="{{ page.previous.title }}">قبلی </a>
25
+ {% else %}
26
+ <a href="#" class="pagination--pager disabled"">قبلی </a>
27
+ {% endif %}
28
+
29
+ {% if page.next %}
30
+ <a href="{{ page.next.url | absolute_url }}" class="pagination--pager" title="{{ page.next.title }}">بعدی</a>
31
+ {% else %}
32
+ <a href="#" class="pagination--pager disabled"">بعدی</a>
33
+ {% endif %}
34
+ </nav>
35
35
 
36
- {% if site.disqus_shortname %}
37
- {% include disqus.html %}
38
- {% endif %}
36
+ {% if site.comment_system == 'static' %}
37
+ {% include static_comments.html %}
38
+ {% elsif site.coment_system == 'disqus' %}
39
+ {% include disqus.html %}
40
+ {% endif %}
39
41
 
40
- </div>
42
+ </div>
data/_sass/_post.scss CHANGED
@@ -14,9 +14,11 @@
14
14
 
15
15
  #post-list {
16
16
  list-style: none;
17
+
17
18
  a {
18
19
  color: $text-color;
19
20
  }
21
+
20
22
  a:hover {
21
23
  color: $brand-color;
22
24
  }
@@ -24,6 +26,7 @@
24
26
 
25
27
  .post-meta {
26
28
  @extend .center;
29
+
27
30
  font-size: $small-font-size;
28
31
  color: $grey-color;
29
32
  }
@@ -42,7 +45,6 @@
42
45
  letter-spacing: -1px;
43
46
  line-height: 1.25;
44
47
  margin-bottom: 0;
45
-
46
48
  text-align: center;
47
49
  font-weight: bold;
48
50
  font-size: 2em;
@@ -109,3 +111,90 @@
109
111
  }
110
112
  }
111
113
  }
114
+
115
+ #comment-form {
116
+ background: rgba(242, 243, 243, 0.48) none repeat scroll 0% 0%;
117
+ padding: 15px;
118
+
119
+ label {
120
+ display: block;
121
+ margin-bottom: 1em;
122
+ }
123
+
124
+ input, textarea {
125
+ display: block;
126
+ width: 100%;
127
+ box-sizing: border-box;
128
+ font-family: $base-font-family;
129
+ }
130
+
131
+ input:focus, textarea:focus {
132
+ border-color: #f2f3f3;
133
+ }
134
+
135
+ button[type=submit] {
136
+ font-family: $alt-font-family;
137
+ }
138
+
139
+ textarea {
140
+ height: 85px;
141
+ resize: vertical;
142
+ }
143
+ }
144
+
145
+ #comments {
146
+ display: grid;
147
+
148
+ article {
149
+ display: grid;
150
+ grid-template-columns: 1fr 5fr;
151
+ margin-top: 1em;
152
+ width: 100%;
153
+ border-top: 1px solid #f2f3f3;
154
+
155
+ p {
156
+ white-space: pre-wrap;
157
+ }
158
+ }
159
+ }
160
+
161
+ .comment-image-wrapper {
162
+ width: 4em;
163
+ float: right;
164
+ }
165
+
166
+ .comment-body-wrapper {
167
+ float: right;
168
+ }
169
+
170
+ .pagination {
171
+ margin-top: 1em;
172
+ margin-bottom: 1em;
173
+ padding-top: 1em;
174
+ padding-bottom: 1em;
175
+ display: flex;
176
+ border-top: 1px solid #f2f3f3;
177
+ border-bottom: 1px solid #f2f3f3;
178
+ }
179
+
180
+ .pagination--pager.disabled {
181
+ color: rgba(137, 140, 143, 0.5);
182
+ pointer-events: none;
183
+ cursor: not-allowed;
184
+ }
185
+
186
+ .pagination--pager {
187
+ padding: 1em 2em;
188
+ width: 50%;
189
+ font-weight: bold;
190
+ text-align: center;
191
+ border: 1px solid #b6b6b6;
192
+ border-radius: 4px;
193
+ border-top-right-radius: 4px;
194
+ border-bottom-right-radius: 4px;
195
+ }
196
+
197
+ .pagination--pager:first-child {
198
+ border-top-right-radius: 0;
199
+ border-bottom-right-radius: 0;
200
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-mehdix-rtl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehdi Sadeghi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-20 00:00:00.000000000 Z
11
+ date: 2017-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -138,6 +138,7 @@ files:
138
138
  - _includes/head.html
139
139
  - _includes/license.html
140
140
  - _includes/post-image.html
141
+ - _includes/static_comments.html
141
142
  - _layouts/default.html
142
143
  - _layouts/home.html
143
144
  - _layouts/message.html