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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4614cd8057ff8c6482fefa922372cda4e4bfc3ff0cabf607aa09452d11bd893
4
- data.tar.gz: 060c3e221272fcc0d196db0892c696ee3aec22cf8d3fc52c0804fd1be5e94694
3
+ metadata.gz: 16662b0b5b8ec9310e57c63c336fe13bdde1612a4b1dc0a8ffdaab0a2982db1f
4
+ data.tar.gz: 93aeb315ce95b26a4aee96350fb20abf081b95af69873e57ed1e1310f8a4416b
5
5
  SHA512:
6
- metadata.gz: d686398ca6cfa3f27c24956cd28a51bdb6ce719c5ddd84a9ccb01ffa836f5ab8bc729e476b0822347aed57c2e05728defb5981b3c7b5085957465f4e93328336
7
- data.tar.gz: 12164e9cc1b8202dcb3591b0a02f4cbd12ebb7b5510e775c1070bb94caa868ce9b21fe10dbf760f6ff644bf4f82003f40e7bac0cc86ad30ee185fe08e3d4cd2b
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
- <!-- Editing this file is not recommended. -->
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
- <a href="javascript:history.go(-1)">[Back]</a>
32
+ <hr>
33
+ .post_trailer
33
34
  </body>
34
35
  </html>
@@ -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...
@@ -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
@@ -2,7 +2,7 @@
2
2
  if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
3
3
 
4
4
  class RuneBlog
5
- VERSION = "0.2.42"
5
+ VERSION = "0.2.43"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runeblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.42
4
+ version: 0.2.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton