-
Notifications
You must be signed in to change notification settings - Fork 393
Expand file tree
/
Copy pathSiteleaf.rb
More file actions
387 lines (380 loc) · 10.1 KB
/
Copy pathSiteleaf.rb
File metadata and controls
387 lines (380 loc) · 10.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
cheatsheet do
title 'Siteleaf'
docset_file_name 'Siteleaf'
keyword 'siteleaf'
source_url 'http://cheat.kapeli.com'
introduction 'A Dash cheat sheet for [Siteleaf](http://www.siteleaf.com). Manage your content online with Siteleaf, then publish static files to host anywhere you want. It\'s like having a web-based backend for Jekyll that your clients can actually use.'
category do
id 'Site Variables'
entry do
name 'Site title'
notes 'The title of your website.'
command 'site.title'
end
entry do
name 'Site domain'
command 'site.domain'
notes 'Your website’s domain name (ie. barlawrence.com).'
end
entry do
name 'Site permalink'
command 'site.permalink'
notes 'Your website’s full address (ie. http://barlawrence.com).'
end
entry do
name 'Site pages'
command 'site.pages'
notes 'A nested array of pages.'
end
entry do
name 'Site posts'
command 'site.posts'
notes 'Array of all posts in all pages.'
end
entry do
name 'Site RSS feed'
command 'site.feed_url'
notes 'URL to your website’s RSS feed (ie. http://barlawrence.com/feed.xml).'
end
entry do
name 'Site sitemap URL'
command 'site.sitemap_url'
notes 'URL to your website’s Sitemap file (ie. http://barlawrence.com/sitemap.xml).'
end
entry do
name 'Site publish date'
command 'site.date'
notes 'Date of most recent publish.'
end
end
category do
id 'Content Variables'
entry do
name 'Type'
command 'type'
notes 'Can be `page`, `post`, `archive`, `taxonomy`, or `tag`.'
end
entry do
name 'Title'
command 'title'
notes 'Title of content'
end
entry do
name 'URL'
command 'url'
notes 'URL to object without domain (e.g. `/blog/my-post`)'
end
entry do
name 'Permalink'
command 'permalink'
notes 'Full URL to object with domain (e.g. `http://mysite.com/blog/my-post`).'
end
entry do
name 'Body'
command 'body'
notes 'Body in HTML (rendered form Markdown), available in `page` and `post` types).'
end
entry do
name 'Raw body'
command 'body_raw'
notes 'Body in raw Markdown, available in `page` and `post` types.'
end
entry do
name 'Excerpt'
command 'excerpt'
notes 'Shorened version of the body (use 2 empty lines to break), available in `page` and `post` types.'
end
entry do
name 'Raw excerpt'
command 'excerpt_raw'
notes 'Excerpt in raw Markdwown, available in `page` and `post` types.'
end
entry do
name 'Assets'
command 'assets'
notes 'Array of assets, available on `page` and `post` types.'
end
entry do
name 'Meta'
command 'meta'
notes 'Array of metadata, available on `page` and `post` types.'
end
entry do
name 'Taxonomy'
command 'taxonomy'
notes 'Array of taxonomy, available on `post` type only'
end
entry do
name 'Tags'
command 'tags'
notes 'Array of tags available on `taxonomy` type only.'
end
entry do
name 'Pages'
command 'pages'
notes 'Array of child-pages, available on `page` type only.'
end
entry do
name 'Posts'
command 'posts'
notes 'Array of posts, available in `page`, `archive`, and `tag` types.'
end
entry do
name 'Previous'
command 'previous'
notes 'The previous `page` or `post`, available in `page` or `post` types.'
end
entry do
name 'Next'
command 'next'
notes 'The next `page` or `post` available in `page` or `post` types.'
end
entry do
name 'Current'
command 'current'
notes 'Alias of the current `page` or `post`, available in `page` or `post` types.'
end
entry do
name 'Parent'
command 'parent'
notes 'Parent page object (if exists)'
end
entry do
name 'URL archive'
command 'archive_url'
notes 'URL to archive page, available in `page` type only.'
end
entry do
name 'Date'
command 'date'
notes 'Date of publish, available in `page` and `post` types.'
end
entry do
name 'Last updated'
command 'updated_at'
notes 'Date of last update.'
end
entry do
name 'Author full name'
command 'author.fullname'
notes 'Full name of author, available in `page` or `post` types.'
end
entry do
name 'Author first name'
command 'author.firstname'
notes 'First name of the author, available in `page` or `post` types.'
end
entry do
name 'Author last name'
command 'author.lastname'
notes 'Last name of author, available in `page` or `post` types.'
end
entry do
name 'Author\'s email'
command 'author.email'
notes 'Author\'s email, available in `page` and `post` types.'
end
entry do
name 'Author\'s avatar'
command 'author.avatar'
notes 'Author\'s Gravatar URL, available in `page` and `post` types.'
end
entry do
name 'Home'
command 'home?'
notes 'Boolean if page is homepage, available in `page` type only.'
end
end
category do
id 'Asset Variables'
entry do
name 'Type'
command 'type'
notes 'Can be `image`, `audio`, `video`, or `other`.'
end
entry do
name 'Filename'
command 'filename'
notes 'Name of file (e.g. `photo.jpg`).'
end
entry do
name 'URL'
command 'url'
notes 'URL to object without domain (e.g. `/assets/photo.jpg`).'
end
entry do
name 'Permalink'
command 'permalink'
notes 'FUll URL to object with domain (e.g. `http://mysite.com/assets/photo.jpg`).'
end
entry do
name 'Content type'
command 'content_type'
notes 'MIME type of asset (e.g. `image/jpeg`).'
end
entry do
name 'File size'
command 'filesize'
notes 'Size of file in bytes (e.g. `1024`)'
end
entry do
name 'Date'
command 'date'
notes 'Date asset was created'
end
entry do
name 'Meta'
command 'meta'
notes 'Array of all metadata key/value'
end
entry do
name 'Meta by key'
command 'meta.KEY'
notes 'Get single metadata by key (e.g. `Color`).'
end
entry do
name 'Key'
command 'key'
notes 'Name of metadata key (e.g. `Color`).'
end
entry do
name 'Value'
command 'value'
notes 'Value of metadata (e.g. `Red`).'
end
end
category do
id 'Taxonomy'
entry do
name 'Taxonomy'
command 'taxonomy'
notes 'Array of all taxonomy sets.'
end
entry do
name 'Taxonomy key'
command 'taxonomy.KEY'
notes 'Get tags by set name (e.g. `Tags`).'
end
entry do
name 'Key'
command 'key'
notes 'Name of taxonomy set (e.g. `Tags`).'
end
entry do
name 'Slug'
command 'slug'
notes 'URI slug for set (e.g. `tags`).'
end
entry do
name 'URL'
command 'url'
notes 'URL for set page without domain (e.g. `/blog/tags`).'
end
entry do
name 'Permalink'
command 'permalink'
notes 'URL for set page with domain (e.g. `http://mysite.com/blog/tags`).'
end
entry do
name 'Tags'
command 'tags'
notes 'Array of tags in set.'
end
entry do
name 'Tags key'
command 'tags.Key'
notes 'Get a single tag by name (e.g. `Design`).'
end
end
category do
id 'Tags'
entry do
name 'Value'
command 'value'
notes 'Name of tag'
end
entry do
name 'Slug'
command 'slug'
notes 'URI slug for tag set (e.g. `design`).'
end
entry do
name 'URL'
command 'url'
notes 'URL for tag page without domain (e.g. `/blog/tags/design`).'
end
entry do
name 'Permalink'
command 'permalink'
notes 'URL for tag page with domain (e.g. `http://mysite.com/blog/tags/design`).'
end
entry do
name 'Posts'
command 'posts'
notes 'Array of posts with this tag.'
end
end
category do
id 'Code Samples'
entry do
name 'Basic output'
notes <<-'END'
```html
<h2>{{title}}</h2>
{{body}}
```
Get the title and body for the current page.
END
end
entry do
name 'Loop'
notes <<-'END'
```html
{% for post in posts limit:20 %}
<article>
<header><a href="{{post.url}}">{{post.title}}</a></header>
{{post.body}}
<footer>Posted on {{post.date | date: "%b %d, %Y"}} by {{post.author.fullname}}</footer>
</article>
{% endfor %}
```
Loop through the first 20 posts on the current page.
END
end
entry do
name 'Asset loop'
notes <<-'END'
```html
{% for asset in assets %}
{% if asset.type == 'image' %}
<img src="{{asset.url}}">
{% elsif asset.type == 'audio' %}
<audio><source src="{{asset.url}}" type="{{asset.content_type}}"></audio>
{% elsif asset.type == 'video' %}
<video><source src="{{asset.url}}" type="{{asset.content_type}}"></video>
{% elsif asset.type == 'other' %}
<a href="{{asset.url}}">Download {{asset.filename}}</a></li>
{% endif %}
{% endfor %}
```
Loop through assets.
END
end
entry do
name 'Navigation menu'
notes <<-'END'
```html
<nav>
<ul>
{% for page in site.pages %}
<li><a href="{{page.url}}"{% if page.url == url %} class="selected"{% endif %}>{{page.title}}</a></li>
{% endfor %}
</ul>
</nav>
```
Loop through site.pages to build a navigation menu
END
end
end
notes '* Full Siteleaf theme documentation can be found [here](http://www.siteleaf.com/help/themes/).'
end