serif 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
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 any file outside of `_posts` can override this by setting a `Layout: foo` header, which will use `_layouts/foo.html` instead.
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
@@ -230,7 +230,7 @@ class Site
230
230
  end
231
231
 
232
232
  def to_liquid
233
- @liquid_cache_store ||= TimeoutCache.new
233
+ @liquid_cache_store ||= TimeoutCache.new(1)
234
234
 
235
235
  cached_value = @liquid_cache_store[:liquid]
236
236
  return cached_value if cached_value
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.1"
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 = "Simple file-based blogging system."
8
- s.description = "Serif is a simple file-based blogging system which generates static content and allows dynamic editing through an interface."
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>
@@ -5,10 +5,16 @@
5
5
 
6
6
  <h2>Posts</h2>
7
7
 
8
- <p>There are 3 posts:</p>
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,14 @@
1
+ <!doctype html>
2
+ <meta charset="UTF-8">
3
+ <title>My site: </title>
4
+ <h1>mysite.com</h1>
5
+
6
+ <h1>Mar 2013 (1)</h1>
7
+
8
+ <ul>
9
+
10
+ <li>
11
+ <a href="/test-blog/post-with-custom-layout">Custom layout</a>
12
+ </li>
13
+
14
+ </ul>
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <meta charset="UTF-8">
3
+ <title>My site: </title>
4
+ <h1>mysite.com</h1>
5
+
6
+ <h1>Jan 2399 (1)</h1>
7
+
8
+ <ul>
9
+
10
+ <li>
11
+ <a href="/test-blog/penultimate-post">Penultimate post</a>
12
+ </li>
13
+
14
+ </ul>
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <meta charset="UTF-8">
3
+ <title>My site: </title>
4
+ <h1>mysite.com</h1>
5
+
6
+ <h1>Jan 2400 (1)</h1>
7
+
8
+ <ul>
9
+
10
+ <li>
11
+ <a href="/test-blog/final-post">Final post</a>
12
+ </li>
13
+
14
+ </ul>
@@ -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&amp;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&amp;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&amp;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
@@ -11,3 +11,4 @@
11
11
  <p><a href="http://twitter.com/share?text=Second+post&amp;url=http%3A%2F%2Fwww.mysite.com%2Ftest-blog%2Fsecond-post">Submit this to Twitter.</p>
12
12
 
13
13
  Previous post: Some draft title
14
+ Next post: Custom layout
@@ -0,0 +1,5 @@
1
+ title: Some draft title
2
+ Updated: 2013-03-09T14:57:09+00:00
3
+ Created: 2013-03-09T14:57:09+00:00
4
+
5
+ some content
@@ -1,4 +1,4 @@
1
1
  title: Some draft title
2
- Updated: 2013-03-03T03:19:04+00:00
2
+ Updated: 2013-03-09T14:57:09+00:00
3
3
 
4
4
  some content
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.1
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 simple file-based blogging system which generates static content
223
- and allows dynamic editing through an interface.
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/drafts/another-sample-draft/5d169443ff5dbaf4a7514382e2c71464053230c7c42b96abbe2005e8a731.html
281
- - test/site_dir/_site/drafts/sample-draft/8877b6abe287fd4492604cc67c6d138f02edb0e05f32b0c95c0521055dc2.html
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/1362280744-autopublish-draft
293
- - test/site_dir/_trash/1362280744-test-draft
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: Simple file-based blogging system.
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
@@ -1,5 +0,0 @@
1
- title: Some draft title
2
- Updated: 2013-03-03T03:19:04+00:00
3
- Created: 2013-03-03T03:19:04+00:00
4
-
5
- some content