runeblog 0.3.11 → 0.3.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b73212927ead8c75fce2cb37c6aa6cb8494b9c6b72b43bf75536c91c00c0600e
4
- data.tar.gz: f13337605c83dca1916cf942a2d9b572c64fabd8a6ef2a6a06274c793717ed2d
3
+ metadata.gz: '0372218e12e1f9436b17621b6d32a0894daf4e58bbf7f2cd55dd6fc48eca5af5'
4
+ data.tar.gz: 33da1a53944d8db1b681f885446721e626699b8a3b0126bd3b854df1f707a203
5
5
  SHA512:
6
- metadata.gz: 8b3f0b41497bc7046b785f8e96f2ba78c5865e459d762c408145cea38ca014c8671652336ceadc58c6892afdea0b68c933b8c216f0e1375ac103e92fac82510e
7
- data.tar.gz: f5b43e1afef44c9a4e7f61a965ad538ab780de79bc61a3f66f215c7f9f7e26b3842077ca6f4411f1c692029330ecce4f50afc8ead4daea8ec71301cd82b946f8
6
+ metadata.gz: 8d5fd3bf878e11f7d9d1cba4659c9f199a0cc7908bf2bf9596e6e2716e56a53863cd0cf978dfa3c0db033c8129ab5ddf2f29daf315fa058e50171b783c926012
7
+ data.tar.gz: 5790b07d2a6b3ca787b67e473f83e99ee4d29171ffc6bdbe30e5275b2ae098c7a388bd873cd9a6e1bb1a3206082e59f1bbefcffc158b3f704a0fda3a02637d7e
@@ -10,6 +10,13 @@ class ::RuneBlog::Widget
10
10
  @lines = _get_data?(@datafile)
11
11
  end
12
12
 
13
+ def read_metadata
14
+ meta = read_pairs!("metadata.txt")
15
+ meta.views = meta.views.split
16
+ meta.tags = meta.tags.split
17
+ meta
18
+ end
19
+
13
20
  def _html_body(file, css = nil) # FIXME
14
21
  file.puts "<html>"
15
22
  if css
@@ -23,8 +30,9 @@ class ::RuneBlog::Widget
23
30
  end
24
31
 
25
32
  def build
33
+ dir = @blog.root/:posts
26
34
  posts = nil
27
- Dir.chdir(@blog.root/:posts) { posts = Dir["*"] }
35
+ Dir.chdir(dir) { posts = Dir["*"] }
28
36
  hash = {}
29
37
  @links = []
30
38
  @lines.each do |x|
@@ -32,9 +40,12 @@ class ::RuneBlog::Widget
32
40
  hash[num] = title
33
41
  pre = '%04d' % num
34
42
  nslug = posts.grep(/#{pre}-/).first
43
+ meta = nil
44
+ Dir.chdir(dir/nslug) { meta = read_metadata }
45
+ pubdate = meta.pubdate
35
46
  name = nslug[5..-1]
36
47
  link = name+".html"
37
- @links << [title, link]
48
+ @links << [pubdate, title, link]
38
49
  end
39
50
  write_main
40
51
  write_card
@@ -49,10 +60,11 @@ class ::RuneBlog::Widget
49
60
  _html_body(f, css) do
50
61
  f.puts "<!-- #{@lines.inspect} in #{Dir.pwd} -->"
51
62
  f.puts "<h1>#{card_title}</h1><br><hr>"
52
- @links.each do |title, file|
63
+ @links.each do |pubdate, title, file|
53
64
  title = title.gsub(/\\/, "") # kludge
54
65
  css = "color: #8888FF; text-decoration: none; font-size: 21px"
55
- f.puts %[<a style="#{css}" href="../../#{file}">#{title}</a> <br>]
66
+ f.puts "<!-- pubdate = #{pubdate.inspect} -->"
67
+ f.puts %[#{pubdate} <a style="#{css}" href="../../#{file}">#{title}</a> <br>]
56
68
  end
57
69
  end
58
70
  end
@@ -75,7 +87,7 @@ class ::RuneBlog::Widget
75
87
  </h5>
76
88
  <div class="collapse" id="#{tag}">
77
89
  EOS
78
- @links.each do |title, file|
90
+ @links.each do |pubdate, title, file|
79
91
  url2 = file
80
92
  url_ref = %[href="javascript: void(0)" onclick="javascript:open_main('#{url2}')"]
81
93
  anchor = %[<a #{url_ref}>#{title}</a>]
@@ -89,9 +89,6 @@ def post_trailer
89
89
  perma = _var("publish.proto") + "://" + _var("publish.server") +
90
90
  "/" + _var("publish.path") + "/" + _var("post.aslug") +
91
91
  ".html"
92
- Livetext::Vars.each_pair do |k,v|
93
- STDERR.puts "#{k}: #{v.inspect}" unless k.is_a? Symbol
94
- end
95
92
  tags = _var("post.tags")
96
93
  taglist = tags.empty? ? "" : "Tags: #{tags}"
97
94
 
@@ -3,7 +3,7 @@ if !defined?(RuneBlog::Path)
3
3
  # if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
4
4
 
5
5
  class RuneBlog
6
- VERSION = "0.3.11"
6
+ VERSION = "0.3.12"
7
7
 
8
8
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
9
9
  Path = File.dirname(path)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runeblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-10 00:00:00.000000000 Z
11
+ date: 2020-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext