runeblog 0.2.77 → 0.2.78
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/liveblog.rb +26 -15
- 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: 6baabb9426c6b2e8d316203e12b941a357a31463425810721d8a72f3add24ecd
|
4
|
+
data.tar.gz: 9e823dba18e88f9e6159724fbdbb228392eb6433d21f91e6e922b2e7d850cb4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bc8bc41c43fec627fb6184ce3b9b44fb4f442a8f462b1396ce180c64d00663772e306701e6b4c7edf466eb930162a39ede08bc642d724fde0c2327b97852c45
|
7
|
+
data.tar.gz: 4c5f370aa66624daac8355ddf03b7824e890e27b97eaaa27cb81e788c38352e9a6be90ea37c7e501fd7f198e4a6727054c951cb3a26992d88751e45ab0535e16
|
data/lib/liveblog.rb
CHANGED
@@ -91,10 +91,11 @@ end
|
|
91
91
|
def banner
|
92
92
|
count = 0
|
93
93
|
span = 1
|
94
|
-
bg = "white" # outside loop
|
94
|
+
@bg = "white" # outside loop
|
95
95
|
wide = nil
|
96
96
|
high = 250
|
97
97
|
str2 = ""
|
98
|
+
navbar = nil
|
98
99
|
lines = _body.to_a
|
99
100
|
|
100
101
|
lines.each do |line|
|
@@ -107,7 +108,7 @@ def banner
|
|
107
108
|
when "height"
|
108
109
|
high = data[0]
|
109
110
|
when "bgcolor"
|
110
|
-
bg = data[0] || "white"
|
111
|
+
@bg = data[0] || "white"
|
111
112
|
when "image"
|
112
113
|
image = data[0] || "banner.jpg"
|
113
114
|
image = "banner"/image
|
@@ -125,13 +126,15 @@ def banner
|
|
125
126
|
when "navbar"
|
126
127
|
dir = @blog.root/:views/@blog.view/"themes/standard/banner/" + "\n"
|
127
128
|
_make_navbar # horiz is default
|
128
|
-
|
129
|
-
|
129
|
+
file = "banner/navbar.html"
|
130
|
+
navbar = File.read(file)
|
131
|
+
# str2 << "<td colspan=#{span}><div style='text-align: center'>#{stuff}</div></td>" + "\n"
|
130
132
|
when "vnavbar"
|
131
133
|
dir = @blog.root/:views/@blog.view/"themes/standard/banner/"
|
132
134
|
_make_navbar(:vert)
|
133
135
|
file = "banner/vnavbar.html"
|
134
|
-
|
136
|
+
navbar = File.read(file)
|
137
|
+
# str2 << "<td colspan=#{span}>" + File.read(file) + "</td>" + "\n"
|
135
138
|
when "break"
|
136
139
|
span = count - 1
|
137
140
|
str2 << " </tr>\n <tr>" + "\n"
|
@@ -139,11 +142,12 @@ def banner
|
|
139
142
|
str2 << " '#{tag}' isn't known" + "\n"
|
140
143
|
end
|
141
144
|
end
|
142
|
-
_out "<table width=100% height=#{high} bgcolor=##{bg}>"
|
145
|
+
_out "<table width=100% height=#{high} bgcolor=##{@bg}>"
|
143
146
|
_out " <tr>"
|
144
147
|
_out str2
|
145
148
|
_out " </tr>"
|
146
149
|
_out "</table>"
|
150
|
+
_out navbar if navbar
|
147
151
|
rescue => err
|
148
152
|
STDERR.puts "err = #{err}"
|
149
153
|
STDERR.puts err.backtrace.join("\n")
|
@@ -748,21 +752,28 @@ def _make_navbar(orient = :horiz)
|
|
748
752
|
vdir = @root/:views/@blog.view
|
749
753
|
title = _var(:blog)
|
750
754
|
|
751
|
-
|
752
|
-
|
753
|
-
|
755
|
+
if orient == :horiz
|
756
|
+
name = "navbar.html"
|
757
|
+
li1, li2 = "", ""
|
758
|
+
extra = "navbar-expand-lg"
|
759
|
+
list1 = list2 = ""
|
760
|
+
else
|
761
|
+
name = "vnavbar.html"
|
762
|
+
li1, li2 = '<li class="nav-item">', "</li>"
|
763
|
+
extra = ""
|
764
|
+
list1, list2 = '<l class="navbar-nav mr-auto">', "</ul>"
|
765
|
+
end
|
766
|
+
|
754
767
|
start = <<-HTML
|
755
768
|
<!-- FIXME weird bug here!!! -->
|
756
769
|
<nav class="navbar #{extra} navbar-light bg-light">
|
757
|
-
|
770
|
+
#{list1}
|
758
771
|
HTML
|
759
772
|
finish = <<-HTML
|
760
|
-
|
773
|
+
#{list2}
|
761
774
|
</nav>
|
762
775
|
HTML
|
763
776
|
|
764
|
-
name = (orient == :horiz) ? "navbar.html" : "vnavbar.html"
|
765
|
-
|
766
777
|
html_file = @blog.root/:views/@blog.view/"themes/standard/banner"/name
|
767
778
|
output = File.new(html_file, "w")
|
768
779
|
output.puts start
|
@@ -773,11 +784,11 @@ def _make_navbar(orient = :horiz)
|
|
773
784
|
full = :banner/basename+".html"
|
774
785
|
href_main = _main(full)
|
775
786
|
if basename == "index" # special case
|
776
|
-
output.puts %[
|
787
|
+
output.puts %[#{li1} <a class="nav-link" href="index.html">#{cdata}<span class="sr-only">(current)</span></a> #{li2}]
|
777
788
|
else
|
778
789
|
dir = @blog.root/:views/@blog.view/"themes/standard/banner"
|
779
790
|
xlate cwd: dir, src: basename, dst: vdir/"remote/banner"/basename+".html" # , debug: true
|
780
|
-
output.puts %[
|
791
|
+
output.puts %[#{li1} <a class="nav-link" #{href_main}>#{cdata}</a> #{li2}]
|
781
792
|
end
|
782
793
|
end
|
783
794
|
output.puts finish
|
data/lib/runeblog_version.rb
CHANGED