serif 0.3.1 → 0.3.2
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.
- data/README.md +11 -10
- data/lib/serif/site.rb +1 -1
- data/serif.gemspec +3 -3
- data/test/draft_spec.rb +21 -0
- data/test/site_dir/_site/archive.html +16 -0
- data/test/site_dir/_site/drafts/another-sample-draft/{5d169443ff5dbaf4a7514382e2c71464053230c7c42b96abbe2005e8a731.html → 79d6aaed09deaead24960fd3b070d01802b9e1d2a3711dda9f6dbaab26d3.html} +0 -0
- data/test/site_dir/_site/drafts/sample-draft/{8877b6abe287fd4492604cc67c6d138f02edb0e05f32b0c95c0521055dc2.html → af5fd3ce4acf764fca7fad9bf23b8d83644b2f0b42bd25bcfc1c67213c23.html} +0 -0
- data/test/site_dir/_site/index.html +7 -1
- data/test/site_dir/_site/test-archive/2013/03/index.html +14 -0
- data/test/site_dir/_site/test-archive/2399/01/index.html +14 -0
- data/test/site_dir/_site/test-archive/2400/01/index.html +14 -0
- data/test/site_dir/_site/test-blog/final-post.html +13 -0
- data/test/site_dir/_site/test-blog/penultimate-post.html +14 -0
- data/test/site_dir/_site/test-blog/post-with-custom-layout.html +11 -0
- data/test/site_dir/_site/test-blog/second-post.html +1 -0
- data/test/site_dir/_trash/1362841029-autopublish-draft +5 -0
- data/test/site_dir/_trash/{1362280744-test-draft → 1362841029-test-draft} +1 -1
- metadata +15 -8
- data/test/site_dir/_trash/1362280744-autopublish-draft +0 -5
data/README.md
CHANGED
@@ -6,7 +6,16 @@ Serif is a file-based blogging engine intended for simple sites. It compiles Mar
|
|
6
6
|
|
7
7
|
# Changes and what's new
|
8
8
|
|
9
|
-
## Latest release (v0.3)
|
9
|
+
## Latest release (v0.3.1 and v0.3.2)
|
10
|
+
|
11
|
+
* Be kinder about the space used by the private URL characters. (#32)
|
12
|
+
* The keyup event on any input or textarea now marks the page as having changed. Previously only on blur events. (e0df1375dd)
|
13
|
+
* Order the list of drafts by most-recently-modified first, clarify draft and post ordering above each list. (#33)
|
14
|
+
* Support custom layouts for posts as well as non-post files. (#35)
|
15
|
+
* Drag-and-drop image uploads no longer use exclusively rw------- permissions, now rely on umask. (605487d98)
|
16
|
+
# (v0.3.2) Fix caching problems caused by #30, allowing the most recently published to appear in files that use `site.posts`. (#36)
|
17
|
+
|
18
|
+
## v0.3
|
10
19
|
|
11
20
|
* Add some caching to improve performance of post generation. (#29)
|
12
21
|
* Remove super-linear performance cost of file_digest, reducing site generation time by > 85% for 50+ posts. (#30 -- charts available in the issue)
|
@@ -15,14 +24,6 @@ Serif is a file-based blogging engine intended for simple sites. It compiles Mar
|
|
15
24
|
* Add a `smarty` filter to do smarty processing without full Markdown. (#28)
|
16
25
|
* Fix broken URL renames for drafts in the admin interface. (#31)
|
17
26
|
|
18
|
-
## v0.2.3
|
19
|
-
|
20
|
-
* Support drag-and-drop image uploading in the admin interface, with customisable paths. (#18)
|
21
|
-
* Generate private preview files for drafts, and generate the site on every draft change. (#19, #24)
|
22
|
-
* `serif dev` server serves 404s on missing files instead of 500 exceptions. (#22)
|
23
|
-
* Warn about _config.yml auth details after `serif new` skeleton (#23)
|
24
|
-
* Smarter onbeforeunload warnings that only fire if changes have been made. (#17)
|
25
|
-
|
26
27
|
See `CHANGELOG` for more.
|
27
28
|
|
28
29
|
# Contents of this README
|
@@ -177,7 +178,7 @@ This is where generated content gets saved. You should serve files out of here,
|
|
177
178
|
|
178
179
|
## `_layouts`
|
179
180
|
|
180
|
-
This is where layouts for the site go. The file `default.html` is used by default, and
|
181
|
+
This is where layouts for the site go. The file `default.html` is used by default, and individual files can override this by setting a `Layout: foo` header, which will use `_layouts/foo.html` instead.
|
181
182
|
|
182
183
|
## `_drafts` and `_posts`
|
183
184
|
|
data/lib/serif/site.rb
CHANGED
data/serif.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "serif"
|
3
|
-
s.version = "0.3.
|
3
|
+
s.version = "0.3.2"
|
4
4
|
s.authors = ["Adam Prescott"]
|
5
5
|
s.email = ["adam@aprescott.com"]
|
6
6
|
s.homepage = "https://github.com/aprescott/serif"
|
7
|
-
s.summary = "
|
8
|
-
s.description = "Serif is a
|
7
|
+
s.summary = "Markdown-powered blogging with an optional admin interface with drag-and-drop image uploading."
|
8
|
+
s.description = "Serif is a blogging system powered by markdown files and an optional admin interface complete with drag-and-drop image uploading."
|
9
9
|
s.files = Dir["{lib/**/*,statics/**/*,bin/*,test/**/*}"] + %w[serif.gemspec rakefile LICENSE Gemfile Gemfile.lock README.md]
|
10
10
|
s.require_path = "lib"
|
11
11
|
s.bindir = "bin"
|
data/test/draft_spec.rb
CHANGED
@@ -78,6 +78,27 @@ describe Serif::Draft do
|
|
78
78
|
FileUtils.rm_f(published_path)
|
79
79
|
end
|
80
80
|
|
81
|
+
it "makes the post available in Site#posts and Site#to_liquid even straight after a generate" do
|
82
|
+
draft = D.new(@site)
|
83
|
+
draft.slug = "test-draft-to-go-into-liquid"
|
84
|
+
draft.title = "Some draft title"
|
85
|
+
draft.save("some content")
|
86
|
+
published_path = testing_dir("_posts/#{Date.today.to_s}-#{draft.slug}")
|
87
|
+
|
88
|
+
begin
|
89
|
+
@site.generate
|
90
|
+
@site.posts.first.slug.should_not == draft.slug
|
91
|
+
@site.to_liquid["posts"].first.slug.should_not == draft.slug
|
92
|
+
draft.publish!
|
93
|
+
@site.generate
|
94
|
+
@site.posts.first.slug.should == draft.slug
|
95
|
+
@site.to_liquid["posts"].first.slug.should == draft.slug
|
96
|
+
rescue
|
97
|
+
# clean up
|
98
|
+
FileUtils.rm_f(published_path)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
81
102
|
it "changes the #path to be _posts not _drafts" do
|
82
103
|
draft = D.new(@site)
|
83
104
|
draft.slug = "test-draft"
|
@@ -5,6 +5,22 @@
|
|
5
5
|
|
6
6
|
|
7
7
|
|
8
|
+
<h1>
|
9
|
+
<a href="/test-archive/2400/01">January 2400</a>
|
10
|
+
</h1>
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
<h1>
|
15
|
+
<a href="/test-archive/2399/01">January 2399</a>
|
16
|
+
</h1>
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
<h1>
|
21
|
+
<a href="/test-archive/2013/03">March 2013</a>
|
22
|
+
</h1>
|
23
|
+
|
8
24
|
<h1>
|
9
25
|
<a href="/test-archive/2013/01">January 2013</a>
|
10
26
|
</h1>
|
File without changes
|
File without changes
|
@@ -5,10 +5,16 @@
|
|
5
5
|
|
6
6
|
<h2>Posts</h2>
|
7
7
|
|
8
|
-
<p>There are
|
8
|
+
<p>There are 6 posts:</p>
|
9
9
|
|
10
10
|
<ul>
|
11
11
|
|
12
|
+
<li><a href="/test-blog/final-post">Final post</a> (posted 2400-01-01T00:00:00Z)</li>
|
13
|
+
|
14
|
+
<li><a href="/test-blog/penultimate-post">Penultimate post</a> (posted 2399-01-01T00:00:00Z)</li>
|
15
|
+
|
16
|
+
<li><a href="/test-blog/post-with-custom-layout">Custom layout</a> (posted 2013-03-07T00:00:00Z)</li>
|
17
|
+
|
12
18
|
<li><a href="/test-blog/second-post">Second post</a> (posted 2013-01-01T00:00:00Z)</li>
|
13
19
|
|
14
20
|
<li><a href="/test-blog/post-to-be-published-on-generate">Some draft title</a> (posted 2012-12-21T15:30:00Z)</li>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<meta charset="UTF-8">
|
3
|
+
<title>My site: Posts - Final post</title>
|
4
|
+
<h1>mysite.com</h1>
|
5
|
+
|
6
|
+
|
7
|
+
<h2>Final post</h2>
|
8
|
+
|
9
|
+
<p>The final post in the blog</p>
|
10
|
+
|
11
|
+
<p><a href="http://twitter.com/share?text=Final+post&url=http%3A%2F%2Fwww.mysite.com%2Ftest-blog%2Ffinal-post">Submit this to Twitter.</p>
|
12
|
+
|
13
|
+
Previous post: Penultimate post
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<meta charset="UTF-8">
|
3
|
+
<title>My site: Posts - Penultimate post</title>
|
4
|
+
<h1>mysite.com</h1>
|
5
|
+
|
6
|
+
|
7
|
+
<h2>Penultimate post</h2>
|
8
|
+
|
9
|
+
<p>Penultimate post</p>
|
10
|
+
|
11
|
+
<p><a href="http://twitter.com/share?text=Penultimate+post&url=http%3A%2F%2Fwww.mysite.com%2Ftest-blog%2Fpenultimate-post">Submit this to Twitter.</p>
|
12
|
+
|
13
|
+
Previous post: Custom layout
|
14
|
+
Next post: Final post
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<h1 id="layout" data-name="alternate-layout">Alternate layout</h1>
|
2
|
+
|
3
|
+
|
4
|
+
<h2>Custom layout</h2>
|
5
|
+
|
6
|
+
<p>Second post.</p>
|
7
|
+
|
8
|
+
<p><a href="http://twitter.com/share?text=Custom+layout&url=http%3A%2F%2Fwww.mysite.com%2Ftest-blog%2Fpost-with-custom-layout">Submit this to Twitter.</p>
|
9
|
+
|
10
|
+
Previous post: Second post
|
11
|
+
Next post: Penultimate post
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serif
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -219,8 +219,8 @@ dependencies:
|
|
219
219
|
- - ~>
|
220
220
|
- !ruby/object:Gem::Version
|
221
221
|
version: 0.5.5
|
222
|
-
description: Serif is a
|
223
|
-
|
222
|
+
description: Serif is a blogging system powered by markdown files and an optional
|
223
|
+
admin interface complete with drag-and-drop image uploading.
|
224
224
|
email:
|
225
225
|
- adam@aprescott.com
|
226
226
|
executables:
|
@@ -275,22 +275,28 @@ files:
|
|
275
275
|
- test/site_dir/test-stylesheet.css
|
276
276
|
- test/site_dir/_config.yml
|
277
277
|
- test/site_dir/_site/test-archive/2013/01/index.html
|
278
|
+
- test/site_dir/_site/test-archive/2013/03/index.html
|
278
279
|
- test/site_dir/_site/test-archive/2012/12/index.html
|
279
280
|
- test/site_dir/_site/test-archive/2012/11/index.html
|
280
|
-
- test/site_dir/_site/
|
281
|
-
- test/site_dir/_site/
|
281
|
+
- test/site_dir/_site/test-archive/2400/01/index.html
|
282
|
+
- test/site_dir/_site/test-archive/2399/01/index.html
|
283
|
+
- test/site_dir/_site/drafts/another-sample-draft/79d6aaed09deaead24960fd3b070d01802b9e1d2a3711dda9f6dbaab26d3.html
|
284
|
+
- test/site_dir/_site/drafts/sample-draft/af5fd3ce4acf764fca7fad9bf23b8d83644b2f0b42bd25bcfc1c67213c23.html
|
282
285
|
- test/site_dir/_site/index.html
|
283
286
|
- test/site_dir/_site/file-digest-test.html
|
284
287
|
- test/site_dir/_site/page-alt-layout.html
|
285
288
|
- test/site_dir/_site/page-header-but-no-layout.html
|
286
289
|
- test/site_dir/_site/test-stylesheet.css
|
290
|
+
- test/site_dir/_site/test-blog/final-post.html
|
287
291
|
- test/site_dir/_site/test-blog/post-to-be-published-on-generate.html
|
288
292
|
- test/site_dir/_site/test-blog/second-post.html
|
293
|
+
- test/site_dir/_site/test-blog/post-with-custom-layout.html
|
289
294
|
- test/site_dir/_site/test-blog/sample-post.html
|
295
|
+
- test/site_dir/_site/test-blog/penultimate-post.html
|
290
296
|
- test/site_dir/_site/test-smarty-filter.html
|
291
297
|
- test/site_dir/_site/archive.html
|
292
|
-
- test/site_dir/_trash/
|
293
|
-
- test/site_dir/_trash/
|
298
|
+
- test/site_dir/_trash/1362841029-test-draft
|
299
|
+
- test/site_dir/_trash/1362841029-autopublish-draft
|
294
300
|
- test/site_dir/_posts/2013-03-07-post-with-custom-layout
|
295
301
|
- test/site_dir/_posts/2012-01-05-sample-post
|
296
302
|
- test/site_dir/_posts/2400-01-01-final-post
|
@@ -332,7 +338,8 @@ rubyforge_project:
|
|
332
338
|
rubygems_version: 1.8.24
|
333
339
|
signing_key:
|
334
340
|
specification_version: 3
|
335
|
-
summary:
|
341
|
+
summary: Markdown-powered blogging with an optional admin interface with drag-and-drop
|
342
|
+
image uploading.
|
336
343
|
test_files:
|
337
344
|
- test/test_helper.rb
|
338
345
|
- test/filters_spec.rb
|