structrdfal 0.1.5 → 0.2.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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -6
  3. data/_data/lang.yml +126 -0
  4. data/_data/site-nav.yml +15 -0
  5. data/_includes/blogList.html +7 -1
  6. data/_includes/book.html +89 -0
  7. data/_includes/catag.html +1 -0
  8. data/_includes/comment-form.html +43 -0
  9. data/_includes/comment-holiday-message.html +1 -0
  10. data/_includes/comment-section.html +7 -0
  11. data/_includes/comment.html +34 -0
  12. data/{_layouts → _includes}/event.html +39 -34
  13. data/_includes/footer.html +15 -6
  14. data/_includes/google-analytics.html +11 -0
  15. data/_includes/header.html +9 -0
  16. data/_includes/keywords.html +18 -0
  17. data/_includes/mailto-explainer.html +4 -0
  18. data/_includes/nav.html +3 -1
  19. data/_includes/page-nav.html +6 -0
  20. data/_includes/page-title.html +3 -0
  21. data/_includes/search.html +16 -0
  22. data/_includes/styleScriptPath.html +10 -0
  23. data/_layouts/autopage_category.html +2 -2
  24. data/_layouts/autopage_tags.html +1 -1
  25. data/_layouts/bloghome.html +3 -1
  26. data/_layouts/default.html +25 -19
  27. data/_layouts/eformContactPage.html +24 -0
  28. data/_layouts/eventFormPage.html +126 -0
  29. data/_layouts/eventpost.html +2 -135
  30. data/_layouts/post.html +42 -9
  31. data/_layouts/refresh.html +8 -0
  32. data/_layouts/review.html +314 -0
  33. data/_layouts/sitehome.html +20 -10
  34. data/_plugins/asset_filter.rb +9 -0
  35. data/_plugins/comments.rb +133 -0
  36. data/_plugins/hex_filter.rb +12 -0
  37. data/_sass/structrdfal.scss +445 -0
  38. data/assets/{styles → css}/form.css +15 -8
  39. data/assets/css/style.scss +6 -0
  40. data/lib/structrdfal-jekyll-plugins +1 -0
  41. data/lib/structrdfal-jekyll-plugins.rb +2 -0
  42. metadata +41 -47
  43. data/assets/styles/structRDFaL.css +0 -177
  44. /data/assets/{styles → css}/HTML5BP-main.css +0 -0
  45. /data/assets/{styles → css}/normalize.css +0 -0
@@ -0,0 +1,314 @@
1
+ ---
2
+ layout: default
3
+ mntype: Review
4
+ ---
5
+ {% comment -%}
6
+ itemReviewed
7
+ negativeNotes ItemList or ListItem or Text or WebContent
8
+ positiveNotes ItemList or ListItem or Text or WebContent
9
+ reviewRating
10
+ reviewAspect Text This Review or Rating is relevant to this part or facet of the itemReviewed.
11
+ reviewBody Text The actual body of the review.
12
+ ----------------------------------------------------------------------
13
+ typeof="Review"
14
+ property="itemReviewed" typeof="thing"
15
+
16
+ reviewed thing: Book, Movie, Event, LocalBusiness, Organization, Product, HowTo, MusicRecording, Sculpture, ShortStory, Episode(TVEpisode, PodcastEpisode, RadioEpisode), TVSeries, TVSeason, WebContent/WebSite"
17
+
18
+ <span property="reviewRating" typeof="Rating">
19
+ <span property="ratingValue">4</span>
20
+ </span> stars -
21
+
22
+ <div property="reviewRating" typeof="Rating">
23
+ <meta property="worstRating" content = "1"/>
24
+ <span property="ratingValue">4</span>/
25
+ <span property="bestRating">5</span>stars
26
+ </div>
27
+
28
+ "description" gives a (typically short) description/summary/teaser of the review
29
+ "reviewBody" gives the full review
30
+ for a "Critic review", description is required
31
+
32
+ <span property="author" typeof="Person">
33
+ <span property="name">Bob Smith</span>
34
+ </span>
35
+ <div property="publisher" typeof="Organization">
36
+ <meta property="name" content="Washington Times">
37
+ </div>
38
+ {%- endcomment -%}
39
+ <!--
40
+ typeof="Review"
41
+ property="itemReviewed" typeof="thing"
42
+
43
+ reviewed thing: Book, Movie, Event, LocalBusiness, Organization, Product, HowTo, MusicRecording, Sculpture, ShortStory, Episode(TVEpisode, PodcastEpisode, RadioEpisode), TVSeries, TVSeason, WebContent/WebSite"
44
+
45
+ <span property="reviewRating" typeof="Rating">
46
+ <span property="ratingValue">4</span>
47
+ </span> stars -
48
+
49
+ <div property="reviewRating" typeof="Rating">
50
+ <meta property="worstRating" content = "1"/>
51
+ <span property="ratingValue">4</span>/
52
+ <span property="bestRating">5</span>stars
53
+ </div>
54
+
55
+ "description" gives a (typically short) description/summary/teaser of the review
56
+ "reviewBody" gives the full review
57
+ for a "Critic review", description is required
58
+
59
+ <span property="author" typeof="Person">
60
+ <span property="name">Bob Smith</span>
61
+ </span>
62
+ <div property="publisher" typeof="Organization">
63
+ <meta property="name" content="Washington Times">
64
+ </div>
65
+ ------------------------------
66
+ review can also just be property of the thing
67
+
68
+ <div property="review" typeof="Review">
69
+ <span property="reviewRating">4</span> stars -
70
+ <b>"<span property="name">A good read.</span>" </b>
71
+ by <span property="author">Bob Smith</span>,
72
+ Written on <meta property="datePublished" content="2006-06-15">June 15, 2006
73
+ <span property="reviewBody">Catcher in the Rye is a fun book. It's a good book to read.</span>
74
+ </div>
75
+ ----------------------------------------------------------------------
76
+ Book
77
+
78
+ abridged Boolean Indicates whether the book is an abridged edition.
79
+ bookEdition Text The edition of the book.
80
+ bookFormat BookFormatType The format of the book.
81
+ illustrator Person The illustrator of the book.
82
+ isbn Text The ISBN of the book.
83
+ numberOfPages Integer The number of pages in the book.
84
+
85
+ align="right" border="0" src="artocnw.gif"></a>
86
+ <a name="tacwk">The Art of Chinese and Western Knotting</a>
87
+ <dd> ISBN 962-15-0234-9<br>
88
+ Printed and published in Hong Kong, the text is in both English and
89
+ Chinese, although all of the publishing info is in Chinese.
90
+ Another basic book, but with some fairly interesting 3D
91
+ projects including a giraffe. 8)<br>
92
+ Bilingual Chinese and English.<br clear="all">
93
+ <dl typeof="Book" vocab="http://schema.org/">
94
+ <dt property="name">The Art of Chinese and Western Knotting</dt>
95
+ <dd property="description"><p>Printed and published in Hong Kong, the text is in both English and Chinese, although all of the publishing info is in <span property="inLanguage" content="zh">Chinese</span>.
96
+ Another basic book, but with some fairly interesting 3D
97
+ projects including a giraffe. 8)</p>
98
+ <p property="isbn">962-15-0234-9</p>
99
+ </dl>
100
+
101
+ <div vocab="https://schema.org/">
102
+ <div typeof="Book" resource="http://worldcat.org/entity/work/id/2292573321">
103
+ <h1><span property="name">Rouge et le noir</span></h1>
104
+ <div>Author: <span property="author" typeof="Person" resource="http://viaf.org/viaf/17823">Stendhal</span></div>
105
+ <div>Language: <span property="inLanguage" content="fr">French</span></div>
106
+ <div>Has Translation: <span property="workTranslation" typeof="CreativeWork" resource="http://worldcat.org/entity/work/id/460647">Red and Black : A New Translation, Backgrounds and Sources, Criticism</span></div>
107
+ </div>
108
+ <div typeof="Book" resource="http://worldcat.org/entity/work/id/460647">
109
+ <h1><span property="name">Red and Black : A New Translation, Backgrounds and Sources, Criticism</span></h1>
110
+ <div>Author: <span property="author" typeof="Person" resource="http://viaf.org/viaf/17823">Stendhal</span></div>
111
+ <div>Language: <span property="inLanguage" content="en">English</span></div>
112
+ <div>Subject: <span property="about">Psychological fiction, French</span></div>
113
+ <div>Translation of: <span property="translationOfWork" typeof="CreativeWork" resource="http://worldcat.org/entity/work/id/2292573321">Rouge et le noir</span></div>
114
+ <div>Translator: <span property="translator" typeof="Person" resource="http://viaf.org/viaf/8453420">Robert Martin Adams</span></div>
115
+ </div>
116
+ </div>
117
+ ----------------------------------------------------------------------
118
+ review of thing
119
+
120
+ <html>
121
+ <head>
122
+ <title>Legal Seafood</title>
123
+ </head>
124
+ <body>
125
+ <div vocab="https://schema.org/" typeof="Review">
126
+ <div property="itemReviewed" typeof="Restaurant">
127
+ <img property="image" src="https://example.com/photos/1x1/seafood-restaurant.jpg" alt="Legal Seafood"/>
128
+ <span property="name">Legal Seafood</span>
129
+ <span property="servesCuisine">Seafood</span>
130
+ <span property="priceRange">$$$</span>
131
+ <span property="telephone">1234567</span>
132
+ <span property="address">123 William St, New York</span>
133
+ </div>
134
+ <span property="reviewRating" typeof="Rating">
135
+ <span property="ratingValue">4</span>
136
+ </span> stars -
137
+ <b>"<span property="name">A good seafood place.</span>" </b>
138
+ <span property="author" typeof="Person">
139
+ <span property="name">Bob Smith</span>
140
+ </span>
141
+ <div property="publisher" typeof="Organization">
142
+ <meta property="name" content="Washington Times">
143
+ </div>
144
+ </div>
145
+ </body>
146
+ </html>
147
+ ----------------------------------------------------------------------
148
+ book with review
149
+
150
+ <body vocab="https://schema.org/" typeof="WebPage">
151
+ ...
152
+ <div property="breadcrumb">
153
+ <a href="category/books.html">Books</a> >
154
+ <a href="category/books-literature.html">Literature &amp; Fiction</a> >
155
+ <a href="category/books-classics">Classics</a>
156
+ </div>
157
+
158
+ <div property="mainEntity" typeof="Book">
159
+
160
+ <img property="image" src="catcher-in-the-rye-book-cover.jpg"
161
+ alt="cover art: red horse, city in background"/>
162
+ <span property="name">The Catcher in the Rye</span> -
163
+ <link property="bookFormat" href="https://schema.org/Paperback">Mass Market Paperback
164
+ by <a property="author" href="/author/jd_salinger.html">J.D. Salinger</a>
165
+
166
+ <div property="aggregateRating" typeof="AggregateRating">
167
+ <span property="ratingValue">4</span> stars -
168
+ <span property="reviewCount">3077</span> reviews
169
+ </div>
170
+
171
+ <div property="offers" typeof="Offer">
172
+ Price: $<span property="price">6.99</span>
173
+ <meta property="priceCurrency" content="USD" />
174
+ <link property="availability" href="https://schema.org/InStock">In Stock
175
+ </div>
176
+
177
+ Product details
178
+ <span property="numberOfPages">224</span> pages
179
+ Publisher: <span property="publisher">Little, Brown, and Company</span> -
180
+ <meta property="datePublished" content="1991-05-01">May 1, 1991
181
+ Language: <span property="inLanguage">English</span>
182
+ ISBN-10: <span property="isbn">0316769487</span>
183
+
184
+ Reviews:
185
+
186
+ <div property="review" typeof="Review">
187
+ <span property="reviewRating">5</span> stars -
188
+ <b>"<span property="name">A masterpiece of literature</span>"</b>
189
+ by <span property="author">John Doe</span>,
190
+ Written on <meta property="datePublished" content="2006-05-04">May 4, 2006
191
+ <span property="reviewBody">I really enjoyed this book. It captures the essential
192
+ challenge people face as they try make sense of their lives and grow to adulthood.</span>
193
+ </div>
194
+
195
+ <div property="review" typeof="Review">
196
+ <span property="reviewRating">4</span> stars -
197
+ <b>"<span property="name">A good read.</span>" </b>
198
+ by <span property="author">Bob Smith</span>,
199
+ Written on <meta property="datePublished" content="2006-06-15">June 15, 2006
200
+ <span property="reviewBody">Catcher in the Rye is a fun book. It's a good book to read.</span>
201
+ </div>
202
+
203
+ </div>
204
+ ...
205
+ </body>
206
+ ----------------------------------------------------------------------
207
+ A trilogy of books with numbered volumes.
208
+ <div vocab="https://schema.org/">
209
+ <p typeof="Book" resource="#trilogy">
210
+ <link property="about" href="http://id.worldcat.org/fast/1020337">
211
+ The <strong property="name">Lord of the Rings</strong> is an
212
+ <span property="inLanguage" content="en">English-language</span>
213
+ <span property="genre">fictional</span> trilogy by
214
+ <span property="author" typeof="Person" resource="#author">
215
+ <link property="sameAs" href="http://viaf.org/viaf/95218067">
216
+ <span property="name" content="Tolkien, J. R. R. (John Ronald Reuel)">J. R. R. Tolkien</span>
217
+ (<span property="birthDate">1892</span>-<span property="deathDate">1973</span>).
218
+ </span>
219
+ <link property="hasPart" href="#book1">
220
+ <link property="hasPart" href="#book2">
221
+ <link property="hasPart" href="#book3">
222
+ </p>
223
+ <p>
224
+ The books in the trilogy are:
225
+ </p>
226
+ <ul>
227
+ <li typeof="Book PublicationVolume" resource="#book1">
228
+ Vol. <span property="volumeNumber">1</span>:
229
+ <link property="about" href="http://id.worldcat.org/fast/1020337">
230
+ <link property="isPartOf" href="#trilogy">
231
+ <link property="author" href="#author">
232
+ <meta property="inLanguage" content="en">
233
+ <span property="name">The Fellowship of the Ring</span>
234
+ </li>
235
+ <li typeof="Book PublicationVolume" resource="#book2">
236
+ Vol. <span property="volumeNumber">2</span>:
237
+ <link property="about" href="http://id.worldcat.org/fast/1020337">
238
+ <link property="isPartOf" href="#trilogy">
239
+ <link property="author" href="#author">
240
+ <meta property="inLanguage" content="en">
241
+ <span property="name">The Two Towers</span>
242
+ </li>
243
+ <li typeof="Book PublicationVolume" resource="#book3">
244
+ Vol. <span property="volumeNumber">3</span>:
245
+ <link property="about" href="http://id.worldcat.org/fast/1020337">
246
+ <link property="isPartOf" href="#trilogy">
247
+ <link property="author" href="#author">
248
+ <meta property="inLanguage" content="en">
249
+ <span property="name">The Return of the King</span>
250
+ </li>
251
+ </ul>
252
+ </div>
253
+ ----------------------------------------------------------------------
254
+ review nested in thing
255
+
256
+ <html>
257
+ <head>
258
+ <title>The Catcher in the Rye</title>
259
+ </head>
260
+ <body>
261
+ <div vocab="https://schema.org/" typeof="Product">
262
+ <div rel="schema:brand">
263
+ <div typeof="schema:Brand">
264
+ <div property="schema:name" content="Penguin"></div>
265
+ </div>
266
+ </div>
267
+ <div property="schema:description" content="The Catcher in the Rye is a classic coming-of-age story: an story of teenage alienation, capturing the human need for connection and the bewildering sense of loss as we leave childhood behind."></div>
268
+ <div property="schema:sku" content="9780241984758"></div>
269
+ <div property="schema:mpn" content="925872"></div>
270
+ <img property="image" src="https://example.com/photos/1x1/catcher-in-the-rye-book-cover.jpg" alt="Catcher in the Rye"/>
271
+ <span property="name">The Catcher in the Rye</span>
272
+ <div property="review" typeof="Review"> Review:
273
+ <span property="reviewRating" typeof="Rating">
274
+ <span property="ratingValue">5</span> -
275
+ </span>
276
+ <b>"<span property="name">A masterpiece of literature</span>" </b> by
277
+ <span property="author" typeof="Person">
278
+ <span property="name">John Doe</span></span>, written on
279
+ <meta property="datePublished" content="2006-05-04">May 4, 2006
280
+ <div property="reviewBody">I really enjoyed this book. It captures the essential challenge people face as they try make sense of their lives and grow to adulthood.</div>
281
+ <span property="publisher" typeof="Organization">
282
+ <meta property="name" content="Washington Times">
283
+ </span>
284
+ <span property="reviewRating" typeof="Rating">
285
+ <span property="ratingValue">1</span> -
286
+ </span>
287
+ <b>"<span property="name">The worst thing I've ever read</span>" </b> by
288
+ <span property="author" typeof="Person">
289
+ <span property="name">Jane Doe</span></span>, written on
290
+ <meta property="datePublished" content="2006-05-04">May 10, 2006
291
+ <span property="publisher" typeof="Organization">
292
+ <meta property="name" content="Washington Times">
293
+ </span>
294
+ </div>
295
+ <div rel="schema:aggregateRating">
296
+ <div typeof="schema:AggregateRating">
297
+ <div property="schema:reviewCount" content="89"></div>
298
+ <div property="schema:ratingValue" content="4.4"></div>
299
+ </div>
300
+ </div>
301
+ <div rel="schema:offers">
302
+ <div typeof="schema:Offer">
303
+ <div property="schema:price" content="4.99"></div>
304
+ <div property="schema:availability" content="https://schema.org/InStock"></div>
305
+ <div property="schema:priceCurrency" content="USD"></div>
306
+ <div property="schema:priceValidUntil" datatype="xsd:date" content="2020-11-21"></div>
307
+ <div rel="schema:url" resource="https://example.com/catcher"></div>
308
+ <div property="schema:itemCondition" content="https://schema.org/UsedCondition"></div>
309
+ </div>
310
+ </div>
311
+ </div>
312
+ </body>
313
+ </html>
314
+ -->
@@ -1,15 +1,18 @@
1
1
  <!doctype html>
2
2
  <html class="no-js" lang="en" prefix="dc: http://purl.org/dc/terms/">
3
3
  <head profile="http://www.w3.org/2005/10/profile">
4
+ {% include google-analytics.html %}
4
5
  <meta charset="utf-8">
5
6
  {% unless site.title == page.title -%}
6
7
  {%- if site.title -%}
7
8
  {%- capture preTitle %}{{ site.title }} - {% endcapture -%}
8
9
  {%- endif -%}
9
10
  {%- endunless %}
11
+ {%- include styleScriptPath.html -%}
10
12
 
11
13
  <title property="dc:title">{{ preTitle }}{{ page.title }}</title>
12
14
  <meta name="description" property="dc:description" content="{{ page.description | default: site.description }}">
15
+ {% include keywords.html -%}
13
16
  <meta name="viewport" content="width=device-width, initial-scale=1">
14
17
 
15
18
  {% if site.author -%}
@@ -26,21 +29,21 @@
26
29
  <meta property="dc:date.lastmodified" content="{{ page.date | date: '%Y-%m-%d' }}" />
27
30
  {% if site.copynotice -%}
28
31
  <meta property="dc:rights" content="{{ site.copynotice }}" />
29
- {%- endif %}
32
+ {%- endif -%}
30
33
 
31
34
  <link rel="manifest" href="site.webmanifest">
32
35
  <link rel="apple-touch-icon" href="icon.png">
33
36
  {%- comment -%}
34
37
  HTML5BP says:
35
38
  <!-- Place favicon.ico in the root directory -->
36
- but the W3C "discourage" this behaviour, so...
39
+ but the W3C "discourage" this behaviour (https://www.w3.org/2005/10/howto-favicon), so...
37
40
  {%- endcomment %}
38
41
  <link rel="icon" href="{{ site.baseurl }}favicon.ico">
39
42
 
40
- <link rel="stylesheet" href="{{ site.stPath }}normalize.css">
41
- <link rel="stylesheet" href="{{ site.stPath }}HTML5BP-main.css">
42
- <link rel="stylesheet" href="{{ site.stPath }}structRDFaL.css">
43
- {% if page.isform -%}<link rel="stylesheet" href="{{ site.stPath }}form.css">{%- endif %}
43
+ <link rel="stylesheet" href="{{ stylePath }}normalize.css">
44
+ <link rel="stylesheet" href="{{ stylePath }}HTML5BP-main.css">
45
+ <link rel="stylesheet" href="{{ stylePath }}style.css">
46
+ {% if page.isform -%}<link rel="stylesheet" href="{{ stylePath }}form.css">{%- endif %}
44
47
 
45
48
  <meta name="theme-color" content="#fafafa">
46
49
  </head>
@@ -48,17 +51,24 @@
48
51
  <body vocab="http://schema.org/" typeof="{{ page.pgtype | default: 'WebPage' }}">
49
52
  <!--[if lte IE 9]>
50
53
  <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
51
- <![endif]-->
52
- {% include header.html -%}
54
+ <![endif]-->
55
+ <nav id="nav-set">
56
+ {% include header.html -%}
57
+ {% include nav.html -%}
58
+ </nav>
59
+ <div id="window">
60
+
53
61
  {%- if page.mntype -%}
54
62
  <main tabindex="-1" id="main-thing" property="mainEntity" typeof="{{ page.mntype }}">
55
63
  {%- else -%}
56
64
  <main tabindex="-1" id="main-thing">
57
- <h1 property="name">{{ page.title }}</h1>
65
+ {% include page-title.html %}
66
+ <!-- <h1 style="font-size: clamp(1rem, calc(140vw/{{ page.title | size }}), 2rem);" -->
67
+ <!-- id="page-title">{{ page.title }}</h1> -->
58
68
  {%- endif %}
59
69
  {{ content }}
60
70
  </main>
61
- {% include nav.html -%}
62
71
  {% include footer.html -%}
72
+ </div> <!-- window -->
63
73
  </body>
64
74
  </html>
@@ -0,0 +1,9 @@
1
+ module Jekyll
2
+ module AssetFilter
3
+ def asset_url(input)
4
+ "http://www.example.com/#{input}?#{Time.now.to_i}"
5
+ end
6
+ end
7
+ end
8
+
9
+ Liquid::Template.register_filter(Jekyll::AssetFilter)
@@ -0,0 +1,133 @@
1
+ # coding: utf-8
2
+
3
+ module Jekyll
4
+ module DirStuff
5
+ ####################################################################
6
+ # strip off the source directory part so that the relative directory
7
+ # names are ready to be combined with the destination directory part
8
+ ####################################################################
9
+ def relDir(srcDir, dirList)
10
+ return nil unless dirList # if list empty stop now
11
+ dirList.each do |directory|
12
+ directory.slice!(srcDir) # remove source dir base
13
+ end
14
+ return dirList
15
+ end # relDir
16
+ end # DirStuff
17
+
18
+ class ComPage < Page
19
+ def initialize(site, path, name)
20
+ @site = site
21
+ @base = site.source
22
+ @dir = path # @path is a thing, don't use!!
23
+ @name = name
24
+
25
+ self.process(@name)
26
+ self.read_yaml(@dir, @name)
27
+ self.data.store("content", self.content)
28
+ end
29
+ end
30
+
31
+ class ComGen < Generator
32
+ safe true
33
+ include DirStuff
34
+
35
+ def generate(site)
36
+ #puts "-------------------------------------\nCommentary output:"
37
+ comstate = site.config['commentary']
38
+ # collect the list of comment files
39
+ if comstate
40
+ puts "Commentary Plug-in: Comments are set to: #{comstate}"
41
+ comment_data = []
42
+ comment_paths = Dir["#{site.source}/**/_comments/"] # find the paths to the comments
43
+ comment_paths.each do |cp| # from each directory of comments
44
+ comment_files = Dir["#{cp}**.md"]
45
+ comment_files += Dir["#{cp}**.html"]
46
+ comment_files.each do |cf| # from each comment file in a particular directory
47
+ #print "cfs: ", cf, "\n"
48
+ cffn = cf.split('/').last # the comment file file name
49
+ cfpn = cf.slice(0, cf.size-cffn.size) # the comment file path name
50
+ newcompage = ComPage.new(site, cfpn, cffn) # get the YAML data
51
+ comment_data.push(newcompage.data)
52
+ end
53
+ end
54
+ # sort by date
55
+ comment_data.sort_by! { |edate| edate["created"] }
56
+ site.posts.docs.each do |page|
57
+ #print page.data["nid"], ", "
58
+ matching_comments = comment_data.select { |post_id| post_id["pid"]==page.data["nid"] }
59
+ unless matching_comments.empty?
60
+ page.data["comments"] = matching_comments
61
+ #matching_comments.each do |cmnt|
62
+ #print "\n - ", cmnt["post_subject"], " (", cmnt["pid"], ") [", cmnt["nid"], "]\n"
63
+ #end
64
+ page.data["has-comments"] = "true"
65
+ #print page.data, "\n"
66
+ end
67
+ if site.config['commentary'] == "on" || page.data['commentary'] == "open"
68
+ page.data['isform'] = true
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+
75
+ ######################################################################
76
+ # add in a startdate field for non-event posts that you want sorted
77
+ # in with event posts. Populate with post.date
78
+ ######################################################################
79
+ class SortField < Jekyll::Generator
80
+ def generate(site)
81
+ # puts " SortField plug-in: ", site.config['pagination'], "\n"
82
+ # puts " SortField plug-in: Paginate is sorting by \"", site.config['pagination']['sort_field'], "\"\n"
83
+ if site.config['pagination']['sort_field'] == "startdate"
84
+ puts " SortField plug-in: Paginate is sorting by \'startdate\', providing \'startdate\' for posts that have mixsort \"on\"."
85
+ site.posts.docs.each do |page|
86
+ if page['mixsort'] == "on"
87
+ unless page['startdate']
88
+ page.data["startdate"] = page.data['date']
89
+ # print "title: \"", page.data["title"], "\" startdate (", page['startdate'], ") set\n"
90
+ end
91
+ end
92
+ end
93
+ else
94
+ puts "Paginate not sorting by startdate."
95
+ end
96
+ end
97
+ end
98
+ end
99
+ ######################################################################
100
+ # data as imported when I converted my Drupal site into Jekyll
101
+ # obviously not all is needed for Jekyll comments
102
+ ######################################################################
103
+ #cfs: /Users/wangc/Sites/jekyll.knottynotions.com/_posts/_comments/comment-11.md
104
+ #data: {
105
+ # "comment_num"=>11
106
+ # "post_num"=>21
107
+ # "title"=>"Globe Knots..."
108
+ # "poster_ip"=>"0.0.0.0"
109
+ # "poster_name"=>"Poster Name"
110
+ # "poster_email"=>"name@example.net"
111
+ # "poster_url"=>"http://example.net"
112
+ # "created"=>1233943168
113
+ # "nid"=>"1lvuZa"
114
+ # "post_subject"=>"Tool and Book Review: Globe Knot Tool and Cookbook"
115
+ # "comment_date"=>"2009.02.06 . 17:59"
116
+ # "pid"=>"1lnihk"}
117
+ # ----------------------------------------------------------------------
118
+ # data: {
119
+ # "draft"=>false,
120
+ # "categories"=>["knot-a-long"]
121
+ # "excss"=>["knotty"]
122
+ # "permalink"=>"/:categories/:title:output_ext"
123
+ # "excerpt_separator"=>"<!--more-->"
124
+ # "tags"=>["test", "instructor", "teacher", "thca", "zgj", "jcka", "translation"]
125
+ # "layout"=>"blog"
126
+ # "title"=>"The THCA instructor test with comparison to the ZGJ tests plus a Japanese preview"
127
+ # "created"=>1519282242
128
+ # "nid"=>"1EOKIi"
129
+ # "date"=>2018-02-22 00:00:00 -0800
130
+ # "slug"=>"the-thca-instructor-test-with-comparison-to-the-zgj-tests-plus-a-japanese-preview"
131
+ # "ext"=>".md"
132
+ # "excerpt"=><Excerpt: /knot-a-long/the-thca-instructor-test-with-comparison-to-the-zgj-tests-plus-a-japanese-preview#excerpt>}
133
+ # ----------------------------------------------------------------------
@@ -0,0 +1,12 @@
1
+ module Jekyll
2
+ module HexFilter
3
+ def dec2base62(input)
4
+ # sprintf("%s", input.to_i.to_s(36))
5
+ chars = [*'A'..'Z', *'a'..'z', *'0'..'9']
6
+ digits = input.to_i.digits(62).reverse
7
+ sprintf("%s", digits.map { |i| chars[i] }.join)
8
+ end
9
+ end
10
+ end
11
+
12
+ Liquid::Template.register_filter(Jekyll::HexFilter)