postwave 0.1.3 → 0.1.4
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 +4 -4
- data/README.md +8 -0
- data/lib/postwave/rss_helper.rb +4 -3
- data/lib/postwave/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0eb03ce8fdc3e97f2f54515cbfaa7d527e2f0df541ffd4d993966535b7a8483
|
4
|
+
data.tar.gz: c4b81108e5facc67d6e1799c8907f9d220f34ab9779e270b18bf9787408ca571
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84e334c164a2b1d02ff90b03657493bfd693985f52ef171311dd0319b915439ee04fa315982ab4b6052a295ea229ac0443421e9bbe08fe8ff9050023c4f26be9
|
7
|
+
data.tar.gz: 4f98af33627b143439e7aa75827705c5a74162791e2d066ba3024f99afa5de0df0b13437801da31f40ac00051bea9cca26f96b57c15484f83cab26a9594329ac
|
data/README.md
CHANGED
@@ -4,12 +4,16 @@
|
|
4
4
|
|
5
5
|
Write your posts statically. Interact with them dynamically.
|
6
6
|
|
7
|
+
[postwave.blog](https://postwave.blog/)
|
8
|
+
|
7
9
|
## What is Postwave?
|
8
10
|
|
9
11
|
Postwave is an opinionated flat-file based based blog engine.
|
10
12
|
|
11
13
|
It lets you write posts in Markdown and then display them on a dynamic site using the client functionality.
|
12
14
|
|
15
|
+
Read more about the philosophy behind [what Postwave is for](https://postwave.blog/posts/what-is-postwave-for).
|
16
|
+
|
13
17
|
## Installation
|
14
18
|
|
15
19
|
```
|
@@ -229,6 +233,10 @@ archive = postwave_client.archive(by: "month")
|
|
229
233
|
# }
|
230
234
|
```
|
231
235
|
|
236
|
+
## Example Site
|
237
|
+
|
238
|
+
The code for [postwave.blog](https://postwave.blog/) is available at [github.com/dorkrawk/postwave-site](https://github.com/dorkrawk/postwave-site) and serves as a good example of how to use Postwave in a real world project.
|
239
|
+
|
232
240
|
## Run Tests
|
233
241
|
|
234
242
|
```
|
data/lib/postwave/rss_helper.rb
CHANGED
@@ -15,16 +15,17 @@ module Postwave
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def feed_content(posts)
|
18
|
-
link = config_values[:url]
|
18
|
+
link = config_values[:url].chomp("/")
|
19
19
|
updated = Time.now.iso8601.to_s
|
20
20
|
title = config_values[:name]
|
21
21
|
description = config_values[:description]
|
22
22
|
|
23
23
|
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, fenced_code_blocks: true)
|
24
24
|
feed_posts = posts.map do |post|
|
25
|
-
post_link = "#{
|
25
|
+
post_link = "#{link}/#{config_values[:posts_path]}/#{post.slug}"
|
26
26
|
html_body = CGI.unescapeHTML(markdown.render(post.body))
|
27
|
-
|
27
|
+
post_title = CGI.escapeHTML(post.title)
|
28
|
+
FeedPost.new(post_title, post_link, html_body, post.date.iso8601, post.tags)
|
28
29
|
end
|
29
30
|
|
30
31
|
path = File.join(__dir__, "templates/feed.erb")
|
data/lib/postwave/version.rb
CHANGED