steve-for-jekyll 1.0.3 → 1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30db961533c03e5fc57450d2c60ed9bfb0eb0fb2db2458fe18d1feb6bfd6c7d9
4
- data.tar.gz: 8a5ca288b685b1615a4a81533d3133529053230375d423df62c5c39465b3f4ea
3
+ metadata.gz: 152b1f4da7c646e3a5ec195552e4ee3b457176f99aea8973fd0a6731422e855c
4
+ data.tar.gz: 9543f23377037cc62607445bddc653fd7b564d5e291559fa62c796ffef61b8db
5
5
  SHA512:
6
- metadata.gz: 8eb77604f98315bccef6cc7a5ed5ebcceebfdcb247d95ff252dabc317a6cbcd11b79b3715de976ac728962835360a34eef889a57d0706a42219eec80152bf2b5
7
- data.tar.gz: 9e72a82ba9e616b20310c69748bf61b173caeed4fa856fb87a2bae4c39ee8f4bef6f46c27744a472242676ded7205352561bea9fe8117d0b557a37217b4e46b2
6
+ metadata.gz: 7174cd599953b1b1548d081424a0d0ecb762492ace0965fdac70bdf2fd7ffb7dcdb93f8c505f496bfc2674227b2b704a62b7977e7665c9d78680b6de652ecdc0
7
+ data.tar.gz: d0c57c5aad331d14865b2bd9d87dc79586c18fc5d8a2444d9b419dbd0b6abc115c87b6274766c788bf2edba5d4dd9739b553ecf7062b98fd8c2d045627ffdfbf
data/README.md CHANGED
@@ -180,6 +180,46 @@ Steve uses the following Jekyll plugins to create sitemaps, RSS feeds, archives
180
180
 
181
181
  While Steve sets initial configurations for these plugins, you may want to change them in your `_config.yml`. Please refer to these plugins documentations for further reading about how to change their config options.
182
182
 
183
+ ### Comments
184
+
185
+ Steve supports [Staticman](https://staticman.net)-powered comments, and provides initial settings from our own `staticman.yml` config file. You can create your own settings at any time, but keep in mind that Steve looks for the following fields when submitting comments:
186
+
187
+ - `name`
188
+ - `email`
189
+ - `website`
190
+ - `message`
191
+
192
+ [Follow these instructions](https://staticman.net/docs/getting-started.html) to set up your Staticman instance.
193
+
194
+ You can also customize your comments' section and submit form adding the `site.comments` object in your `_config.yml`:
195
+
196
+ ```yaml
197
+ comments:
198
+ title: Comments
199
+ form_title: New Comment
200
+ date_format: "%b %e, %Y @ %l:%M %P"
201
+ staticman_endpoint: # Get yours on <https://staticman.net>
202
+ notice: |+ # Accepts Markdown
203
+ Please be nice in the comments.
204
+
205
+ Comments are moderated, so it can take a while for your's to show up.
206
+
207
+ Also, you can use [Markdown](https://daringfireball.net/projects/markdown).
208
+ fields:
209
+ name:
210
+ label: Name
211
+ placeholder: "John Appleseed"
212
+ email:
213
+ label: Email address
214
+ placeholder: "your@email.net"
215
+ website:
216
+ label: Website
217
+ placeholder: "https://john.blog/"
218
+ message:
219
+ label: Message
220
+ placeholder: Your comment message
221
+ submit: Submit Comment
222
+ ```
183
223
  ## Contributing
184
224
 
185
225
  Bug reports and pull requests are welcome on GitHub at <https://github.com/esporo/steve>. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
data/_config.yml CHANGED
@@ -12,7 +12,6 @@ baseurl: "/steve/"
12
12
 
13
13
  # Theme settings
14
14
  steve:
15
- intensedebate_account: # get one at <https://intensedebate.com/install>
16
15
  archives: # Prefixes used with archive titles
17
16
  date: Posts from
18
17
  tag: More about…
@@ -40,6 +39,33 @@ steve:
40
39
  placeholder: What you're looking for?
41
40
  submit: Go!
42
41
 
42
+ # Comments Settings
43
+ comments:
44
+ title: Comments
45
+ form_title: New Comment
46
+ date_format: "%b %e, %Y @ %l:%M %P"
47
+ staticman_endpoint: # Get yours on <https://staticman.net>
48
+ notice: |+
49
+ Please be nice in the comments.
50
+
51
+ Comments are moderated, so it can take a while for your's to show up.
52
+
53
+ Also, you can use [Markdown](https://daringfireball.net/projects/markdown).
54
+ fields:
55
+ name:
56
+ label: Name
57
+ placeholder: "John Appleseed"
58
+ email:
59
+ label: Email address
60
+ placeholder: "your@email.net"
61
+ website:
62
+ label: Website
63
+ placeholder: "https://john.blog/"
64
+ message:
65
+ label: Message
66
+ placeholder: Your comment message
67
+ submit: Submit Comment
68
+
43
69
 
44
70
  # Build settings
45
71
  markdown: kramdown
@@ -1,5 +1,19 @@
1
1
  <article class="content post">
2
2
  <header class="content-header">
3
+ {% if post.category %}
4
+ <div class="content-meta">
5
+ {%- assign category_slug = post.category | slugify -%}
6
+ {%- assign category_url = site.jekyll-archives.permalinks.category -%}
7
+
8
+ <a
9
+ href="{{ category_url | replace: ':name', category_slug | relative_url }}"
10
+ rel="tag"
11
+ >
12
+ {{- post.category -}}
13
+ </a>
14
+ </div>
15
+ {% endif %}
16
+
3
17
  {% if post.title != "" %}
4
18
  <h2 class="content-title">
5
19
  <a href="{{ post.url | relative_url }}" rel="bookmark">{{ post.title }}</a>
@@ -0,0 +1,69 @@
1
+ <form action="{{ site.comments.staticman_endpoint }}" method="post">
2
+ <h3 class="form-title">{{ site.comments.form_title }}</h3>
3
+
4
+ <div class="comments-notice">
5
+ {{ site.comments.notice | markdownify }}
6
+ </div>
7
+
8
+ <div class="comment-message-area">
9
+ <label for="comment_message" class="visually-hidden">
10
+ {{ site.comments.fields.message.label }}
11
+ </label>
12
+
13
+ <textarea
14
+ id="comment_message"
15
+ class="message-area"
16
+ name="fields[message]"
17
+ placeholder="{{ site.comments.fields.message.placeholder }}"
18
+ required
19
+ ></textarea>
20
+ </div>
21
+
22
+ <div class="comment-fields">
23
+ <label for="comment_name" class="visually-hidden">
24
+ {{ site.comments.fields.name.label }}
25
+ </label>
26
+
27
+ <input
28
+ type="text"
29
+ id="comment_name"
30
+ class="comment-field"
31
+ name="fields[name]"
32
+ placeholder="{{ site.comments.fields.name.placeholder }}"
33
+ required
34
+ />
35
+
36
+ <label for="comment_email" class="visually-hidden">
37
+ {{ site.comments.fields.email.label }}
38
+ </label>
39
+ <input
40
+ type="email"
41
+ id="comment_email"
42
+ class="comment-field"
43
+ name="fields[email]"
44
+ placeholder="{{ site.comments.fields.email.placeholder }}"
45
+ required
46
+ />
47
+
48
+ <label for="comment_website" class="visually-hidden">
49
+ {{ site.comments.fields.website.label }}
50
+ </label>
51
+ <input
52
+ type="url"
53
+ id="comment_website"
54
+ class="comment-field"
55
+ name="fields[website]"
56
+ placeholder="{{ site.comments.fields.website.placeholder }}"
57
+ />
58
+ </div>
59
+
60
+ <div class="comment-actions">
61
+ <button class="form-submit" type="submit">
62
+ Submit Comment
63
+ </button>
64
+ </div>
65
+
66
+ <input type="hidden" name="options[redirect]" value="{{ page.url |
67
+ absolute_url }}#comments" />
68
+ <input type="hidden" name="options[slug]" value="{{ page.slug }}" />
69
+ </form>
@@ -0,0 +1,43 @@
1
+ {% if site.data.comments[page.slug] or page.comments != false %}
2
+ <section id="comments" class="content">
3
+ <h2 class="comments-title">
4
+ {{ site.comments.title }}
5
+ </h2>
6
+
7
+ {% if site.data.comments[page.slug] %}
8
+ <ol class="comments-list">
9
+
10
+ {% for comment in site.data.comments[page.slug] %}
11
+ {% assign comment_body = comment | last %}
12
+ <li class="comment-item">
13
+ <section class="comment">
14
+ <header class="comment-meta">
15
+ <img class="author-avatar" src="//www.gravatar.com/avatar/{{ comment_body.email }}?d=monsterid&s=64" alt="" />
16
+ <h5 class="author">
17
+ {% if comment_body.website %}
18
+ <a href="{{ comment_body.website }}" rel="author">
19
+ {{ comment_body.name }}
20
+ </a>
21
+ {% else %}
22
+ {{ comment_body.name }}
23
+ {% endif %}
24
+ </h5>
25
+
26
+ <time class="comment-date">
27
+ {{ comment_body.date | date: site.comments.date_format }}
28
+ </time>
29
+ </header>
30
+
31
+ <div class="comment-body">
32
+ {{ comment_body.message | markdownify }}
33
+ </div>
34
+ </section>
35
+ </li>
36
+ {% endfor %}
37
+
38
+ </ol>
39
+ {% endif %}
40
+
41
+ {% include post/comment-form.html %}
42
+ </section>
43
+ {% endif %}
data/_layouts/post.html CHANGED
@@ -4,10 +4,22 @@ layout: blog
4
4
 
5
5
  <article class="content post">
6
6
  <header class="content-header">
7
+ {% if page.category %}
8
+ <div class="content-meta">
9
+ {%- assign category_slug = page.category | slugify -%}
10
+ {%- assign category_url = site.jekyll-archives.permalinks.category -%}
11
+
12
+ <a
13
+ href="{{ category_url | replace: ':name', category_slug | relative_url }}"
14
+ rel="tag"
15
+ >
16
+ {{- page.category -}}
17
+ </a>
18
+ </div>
19
+ {% endif %}
20
+
7
21
  {% if page.title != "" %}
8
- <h1 class="content-title">
9
- {{ page.title }}
10
- </h1>
22
+ <h1 class="content-title">{{ page.title }}</h1>
11
23
  {% endif %}
12
24
 
13
25
  <div class="content-meta">
@@ -25,7 +37,11 @@ layout: blog
25
37
  {{ author.name }}
26
38
  </a>
27
39
  {% else %}
28
- <a class="content-author" href="{{ page.author | prepend: 'https://twitter.com/' }}" rel="author">
40
+ <a
41
+ class="content-author"
42
+ href="{{ page.author | prepend: 'https://twitter.com/' }}"
43
+ rel="author"
44
+ >
29
45
  {{ page.author }}
30
46
  </a>
31
47
  {% endif %}
@@ -34,9 +50,12 @@ layout: blog
34
50
  </header>
35
51
 
36
52
  {% if page.image %}
37
- <fig[ure class="content-cover">
38
- <img src="{{ page.image.url | default: page.image }}" alt="{{ page.image.alt | default: '' }}" />
39
- </fi]gure>
53
+ <figure class="content-cover">
54
+ <img
55
+ src="{{ page.image.url | default: page.image }}"
56
+ alt="{{ page.image.alt | default: '' }}"
57
+ />
58
+ </figure>
40
59
  {% endif %}
41
60
 
42
61
  <div class="content-body">
@@ -49,44 +68,48 @@ layout: blog
49
68
 
50
69
  <ul class="content-tags">
51
70
  {% for tag in page.tags %}
52
- <li>
53
- {%- assign tag_slug = tag | slugify -%}
71
+ <li>
72
+ {%- assign tag_slug = tag | slugify -%}
73
+ {%- assign tag_url = site.jekyll-archives.permalinks.tag -%}
54
74
 
55
- <a href="{{ site.jekyll-archives.permalinks.tag | replace: ':name', tag_slug | relative_url }}" rel="tag">
56
- {{ tag }}
57
- </a>
58
- </li>
75
+ <a
76
+ href="{{ tag_url | replace: ':name', tag_slug | relative_url }}"
77
+ rel="tag"
78
+ >
79
+ {{- tag -}}
80
+ </a>
81
+ </li>
59
82
  {% endfor %}
60
83
  </ul>
61
84
  </footer>
62
85
  {% endif %}
63
86
  </article>
64
87
 
65
- {% if site.steve.intensedebate_account and page.comments != false %}
66
- <section id="comments" class="content comments">
67
- <script>
68
- var idcomments_acct = "{{ site.steve.intensedebate_account }}";
69
- var idcomments_post_id = "{{ post.date | date: "%s" }}";
70
- var idcomments_post_url = "{{ post.url | absolute_url }}";
71
- </script>
72
- <span id="IDCommentsPostTitle" style="display:none"></span>
73
- <script type='text/javascript' src='https://www.intensedebate.com/js/genericCommentWrapperV2.js'></script>
74
- </section>
75
- {% endif %}
88
+ {% include post/comments.html %}
76
89
 
77
90
  {% if page.previous or page.next %}
78
91
  <nav class="content-navigation">
79
92
  {% if page.previous %}
80
- <a class="nav-link prev-link" href="{{ page.previous.url | relative_url }}" rel="prev">
81
- {{ site.steve.pagination.prev_post }} <strong>{{ page.previous.title }}</strong>
93
+ <a
94
+ class="nav-link prev-link"
95
+ href="{{ page.previous.url | relative_url }}"
96
+ rel="prev"
97
+ >
98
+ {{ site.steve.pagination.prev_post }}
99
+
100
+ <strong>{{ page.previous.title }}</strong>
82
101
  </a>
83
102
  {% endif %}
84
-
85
103
  {% if page.next %}
86
- <a class="nav-link next-link" href="{{ page.next.url | relative_url }}" rel="next">
87
- {{ site.steve.pagination.next_post }} <strong>{{ page.next.title }}</strong>
104
+ <a
105
+ class="nav-link next-link"
106
+ href="{{ page.next.url | relative_url }}"
107
+ rel="next"
108
+ >
109
+ {{ site.steve.pagination.next_post }}
110
+
111
+ <strong>{{ page.next.title }}</strong>
88
112
  </a>
89
113
  {% endif %}
90
114
  </nav>
91
115
  {% endif %}
92
-
@@ -24,6 +24,19 @@ body {
24
24
  line-height: 1.5;
25
25
  }
26
26
 
27
+ /*
28
+ Accessibility helpers
29
+ */
30
+ .visually-hidden {
31
+ position: absolute !important;
32
+ height: 1px;
33
+ width: 1px;
34
+ overflow: hidden;
35
+ clip: rect(1px 1px 1px 1px);
36
+ clip: rect(1px, 1px, 1px, 1px);
37
+ white-space: nowrap;
38
+ }
39
+
27
40
  /*
28
41
  Text Elements
29
42
  */
@@ -161,6 +174,7 @@ input[type="search"],
161
174
  input[type="tel"],
162
175
  input[type="number"],
163
176
  input[type="color"],
177
+ input[type="url"],
164
178
  input[type="button"],
165
179
  input[type="reset"],
166
180
  input[type="submit"],
@@ -184,6 +198,7 @@ input[type="search"],
184
198
  input[type="tel"],
185
199
  input[type="number"],
186
200
  input[type="color"],
201
+ input[type="url"],
187
202
  textarea {
188
203
  border-bottom: 3px dashed var(--color-details-lighter);
189
204
  transition: border-bottom-color 250ms ease;
@@ -352,6 +352,81 @@ label[for="search_terms"] {
352
352
  }
353
353
  }
354
354
 
355
+ // Comments
356
+
357
+ .comments-title {
358
+ margin-bottom: var(--gap);
359
+ }
360
+
361
+ .comments-notice {
362
+ margin-top: calc(var(--gap) / 2);
363
+ margin-bottom: calc(var(--gap) / 2);
364
+ color: var(--color-details-darker);
365
+ }
366
+
367
+ .comments-list {
368
+ list-style: none;
369
+ margin-left: 0;
370
+ margin-bottom: var(--gap);
371
+
372
+ .comment-item {
373
+ margin-bottom: var(--gap);
374
+ padding-bottom: var(--gap);
375
+ border-bottom: 3px dotted var(--color-details-lighter);
376
+ }
377
+ }
378
+
379
+ .comment {
380
+ font-size: 95%;
381
+
382
+ .comment-meta {
383
+ margin-bottom: 1rem;
384
+ }
385
+
386
+ .author-avatar {
387
+ width: 2.5rem;
388
+ border-radius: 5px;
389
+ box-shadow: 0 0 2px var(--color-details);
390
+ float: left;
391
+ margin-right: 1rem;
392
+ }
393
+
394
+ .comment-body > *:not(:last-child) {
395
+ margin-bottom: 0.5rem;
396
+ }
397
+ }
398
+
399
+ .comment-message-area {
400
+ margin-bottom: calc(var(--gap) / 2);
401
+ }
402
+
403
+ .message-area {
404
+ width: 100%;
405
+ resize: vertical;
406
+ }
407
+
408
+ .comment-fields {
409
+ display: grid;
410
+ grid-template-columns: 1fr 1fr 1fr;
411
+ gap: calc(var(--gap) / 2);
412
+ margin-bottom: calc(var(--gap) / 2);
413
+
414
+ @media screen and (max-width: 800px) {
415
+ grid-template-columns: 1fr;
416
+ flex-flow: column nowrap;
417
+ }
418
+
419
+ input {
420
+ min-width: 0;
421
+ width: auto;
422
+ }
423
+ }
424
+
425
+ .comment-actions {
426
+ display: flex;
427
+ justify-content: flex-end;
428
+ }
429
+
355
430
  /*
356
431
  Site Footer
357
432
  */
data/staticman.yml ADDED
@@ -0,0 +1,33 @@
1
+ comments:
2
+ name: steve-for-jekyll
3
+ branch: feat-staticman-support
4
+ comment: "adds staticman data"
5
+ path: "_data/comments/{options.slug}"
6
+ filename: "comment-{@timestamp}"
7
+ format: yaml
8
+ allowedFields:
9
+ - name
10
+ - email
11
+ - website
12
+ - message
13
+ generatedFields:
14
+ date:
15
+ type: date
16
+ options:
17
+ format: timestamp-seconds
18
+ requiredFields:
19
+ - name
20
+ - email
21
+ - message
22
+ transforms:
23
+ email: md5
24
+ allowedOrigins:
25
+ - "esporo.github.io"
26
+ - "localhost"
27
+ akismet:
28
+ enabled: true
29
+ author: name
30
+ authorEmail: email
31
+ authorUrl: website
32
+ content: message
33
+ type: comment
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steve-for-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arthur Freitas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-10 00:00:00.000000000 Z
11
+ date: 2021-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -142,6 +142,8 @@ files:
142
142
  - _includes/head.html
143
143
  - _includes/header.html
144
144
  - _includes/header/menu.html
145
+ - _includes/post/comment-form.html
146
+ - _includes/post/comments.html
145
147
  - _includes/search-form.html
146
148
  - _layouts/archive.html
147
149
  - _layouts/blog.html
@@ -155,6 +157,7 @@ files:
155
157
  - _sass/steve/_syntax.scss
156
158
  - assets/css/screen.scss
157
159
  - assets/js/responsive-videos.js
160
+ - staticman.yml
158
161
  homepage: https://github.com/esporo/steve
159
162
  licenses:
160
163
  - MIT