runeblog 0.2.42 → 0.2.43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/empty_view/themes/standard/post/generate.lt3 +5 -4
- data/lib/liveblog.rb +19 -1
- data/lib/runeblog.rb +13 -0
- data/lib/runeblog_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: 16662b0b5b8ec9310e57c63c336fe13bdde1612a4b1dc0a8ffdaab0a2982db1f
|
4
|
+
data.tar.gz: 93aeb315ce95b26a4aee96350fb20abf081b95af69873e57ed1e1310f8a4416b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fb2ef08e58378caa049c6b5a274f3cb6928f9e09dc9a54d5cf5fdd613fed0c473d249dbb2d43b99baf76ae209a343ab70cb89db75e26f082284db1737c967a8
|
7
|
+
data.tar.gz: a35443b76f177cc48457acebdea57fcc9909edd49af992c7eb3ce8d15a7308855c08992385b9dbae0ae9b429646e052210576733e76d835e3717e4214f61e123
|
@@ -5,10 +5,8 @@
|
|
5
5
|
. --------------------------------------------------
|
6
6
|
|
7
7
|
.mixin liveblog
|
8
|
-
|
9
8
|
<html>
|
10
|
-
<!--
|
11
|
-
<!-- It was generated from $File on $$date. -->
|
9
|
+
<!-- Generated from $File on $$date; editing not recommended. -->
|
12
10
|
|
13
11
|
.seek global.lt3
|
14
12
|
.include vars.lt3
|
@@ -18,6 +16,8 @@ og:title $title
|
|
18
16
|
description $teaser
|
19
17
|
.end
|
20
18
|
|
19
|
+
<body>
|
20
|
+
|
21
21
|
<section class="post">
|
22
22
|
<div class="entry-content">
|
23
23
|
<table border=0 width=100%><tr>
|
@@ -29,6 +29,7 @@ description $teaser
|
|
29
29
|
</section>
|
30
30
|
|
31
31
|
<br>
|
32
|
-
<
|
32
|
+
<hr>
|
33
|
+
.post_trailer
|
33
34
|
</body>
|
34
35
|
</html>
|
data/lib/liveblog.rb
CHANGED
@@ -33,6 +33,25 @@ def post
|
|
33
33
|
_out " <!-- Post number #{@meta.num} -->\n "
|
34
34
|
end
|
35
35
|
|
36
|
+
def post_trailer
|
37
|
+
perma = _var("publish.proto") + "://" + _var("publish.server") +
|
38
|
+
"/" + _var("publish.path") + "/permalink/" + _var("post.aslug") +
|
39
|
+
".html"
|
40
|
+
tags = _var("post.tags")
|
41
|
+
if tags.empty?
|
42
|
+
taglist = ""
|
43
|
+
else
|
44
|
+
taglist = "Tags: #{tags}"
|
45
|
+
end
|
46
|
+
_out <<~HTML
|
47
|
+
<table width=100%><tr>
|
48
|
+
<td width=10%><a style="text-decoration: none" href="javascript:history.go(-1)">[Back]</a></td>
|
49
|
+
<td width=10%><a style="text-decoration: none" href="#{perma}"> [permalink] </a></td>
|
50
|
+
<td width=80% align=right><font size=-3>#{taglist}</font></td></tr></table>
|
51
|
+
HTML
|
52
|
+
# damned syntax highlighting
|
53
|
+
end
|
54
|
+
|
36
55
|
def backlink
|
37
56
|
_out %[<br><a href="javascript:history.go(-1)">[Back]</a>]
|
38
57
|
end
|
@@ -286,7 +305,6 @@ def head # Does NOT output tags
|
|
286
305
|
hash = defaults.dup.update(result) # FIXME collisions?
|
287
306
|
|
288
307
|
hash.each_value {|x| _out " " + x }
|
289
|
-
_out "<body>"
|
290
308
|
end
|
291
309
|
|
292
310
|
########## newer stuff...
|
data/lib/runeblog.rb
CHANGED
@@ -436,15 +436,28 @@ class RuneBlog
|
|
436
436
|
|
437
437
|
def _post_metadata(draft, pdraft)
|
438
438
|
log!(enter: __method__, args: [draft, pdraft])
|
439
|
+
# FIXME store this somewhere
|
440
|
+
fname = File.basename(draft) # 0001-this-is-a-post.lt3
|
441
|
+
nslug = fname.sub(/.lt3$/, "") # 0001-this-is-a-post
|
442
|
+
aslug = nslug.sub(/\d\d\d\d-/, "") # this-is-a-post
|
443
|
+
pnum = nslug[0..3] # 0001
|
439
444
|
Dir.chdir(pdraft) do
|
440
445
|
excerpt = File.read("teaser.txt")
|
441
446
|
date = _retrieve_metadata(:date)
|
442
447
|
longdate = ::Date.parse(date).strftime("%B %e, %Y")
|
443
448
|
title = _retrieve_metadata(:title)
|
449
|
+
tags = _retrieve_metadata(:tags)
|
444
450
|
vars = <<~LIVE
|
451
|
+
.set post.num = #{pnum}
|
452
|
+
.heredoc post.aslug
|
453
|
+
#{aslug}
|
454
|
+
.end
|
445
455
|
.heredoc title
|
446
456
|
#{title.chomp}
|
447
457
|
.end
|
458
|
+
.heredoc post.tags
|
459
|
+
#{tags.join(" ")}
|
460
|
+
.end
|
448
461
|
.heredoc teaser
|
449
462
|
#{excerpt.chomp}
|
450
463
|
.end
|
data/lib/runeblog_version.rb
CHANGED