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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfd45d7f160becf53463b3d7155903923442bd09ad5bda3060073ae1ce026451
4
- data.tar.gz: b6821e7aa9e5d363bdfbb93545cad68fcdd1d3288ffaef9661691f0fdf9a8925
3
+ metadata.gz: 6baabb9426c6b2e8d316203e12b941a357a31463425810721d8a72f3add24ecd
4
+ data.tar.gz: 9e823dba18e88f9e6159724fbdbb228392eb6433d21f91e6e922b2e7d850cb4d
5
5
  SHA512:
6
- metadata.gz: '04480d91caa79a7373398e29b25c4cb3af1c7057fd766350d03f5a0e7aa6d84edd5d2b12a00fb67c813695723d0423f5a0e5a32c811211679b105d39eb7ae780'
7
- data.tar.gz: 4ecaa3247239a822399a494643001c0a70346695284fada297aee876bf441168d44a1c6b0722c2ecc8338e0872087b2b44044470aed03aff6b4544f28b7dfb0d
6
+ metadata.gz: 8bc8bc41c43fec627fb6184ce3b9b44fb4f442a8f462b1396ce180c64d00663772e306701e6b4c7edf466eb930162a39ede08bc642d724fde0c2327b97852c45
7
+ data.tar.gz: 4c5f370aa66624daac8355ddf03b7824e890e27b97eaaa27cb81e788c38352e9a6be90ea37c7e501fd7f198e4a6727054c951cb3a26992d88751e45ab0535e16
@@ -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
- stuff = File.read("banner/navbar.html")
129
- str2 << "<td colspan=#{span}><div style='text-align: center'>#{stuff}</div></td>" + "\n"
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
- str2 << "<td colspan=#{span}>" + File.read(file) + "</td>" + "\n"
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
- extra = ""
752
- extra = "navbar-expand-lg" if orient == :horiz
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
- <ul class="navbar-nav mr-auto">
770
+ #{list1}
758
771
  HTML
759
772
  finish = <<-HTML
760
- </ul>
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 %[<li class="nav-item active"> <a class="nav-link" href="index.html">#{cdata}<span class="sr-only">(current)</span></a> </li>]
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 %[<li class="nav-item"> <a class="nav-link" #{href_main}>#{cdata}</a> </li>]
791
+ output.puts %[#{li1} <a class="nav-link" #{href_main}>#{cdata}</a> #{li2}]
781
792
  end
782
793
  end
783
794
  output.puts finish
@@ -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.77"
5
+ VERSION = "0.2.78"
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.77
4
+ version: 0.2.78
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton