runeblog 0.1.93 → 0.1.94

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: 39aa19eb6c069bb8c40cee3d1c6c9c3a34a547095dee8e2637a33279743e8ed2
4
- data.tar.gz: 0315f36323d6ab162a3f0ba3065606e500bbad4acb20d833cb6ad2173ea3701e
3
+ metadata.gz: dde4860831c4c3da1e36c4176d4aba0625a1d29a9a99ff2689d4dc4804228dac
4
+ data.tar.gz: 9492a6f450c4f79285b73dbca0d570b704dd052826b4e843df0b43a898beace6
5
5
  SHA512:
6
- metadata.gz: 94c97d66219c9296b516d652d934e7f1596a1e631d60773cfb6c73d94127c06623fcbc98068504c395c83a305f916980efd25bc93743a1f73089024cbaa3f50a
7
- data.tar.gz: b1ea9f5a2159a82ea13d75dbdf8d54f444baf088b1beeb4b4956cebfc97ab27d7091e1dff1915ba6e9381b61d7cf933a9296f2e69d423284f5a2dbb853650b22
6
+ metadata.gz: ab149f65c893edef8ab26d43028c6a58272475a972e0fab41dfc425e87390f99ceaf1f64d87f2f09df6059a67fe9634bb9ba187d7f51630d2a1de5bd08a6a5e9
7
+ data.tar.gz: d5dfad340047b73c67290807a147d745c36d7f99df4aa88383bf5eca513c3c189842346ce9ec14b4f4de1cd969d3d312b71d8f6b1a4b31a74f1d519491884f62
data/lib/helpers-blog.rb CHANGED
@@ -14,7 +14,7 @@ module RuneBlog::Helpers
14
14
 
15
15
  def livetext(src, dst)
16
16
  src << ".lt3" unless src.end_with?(".lt3")
17
- dst << ".html" unless src.end_with?(".html")
17
+ dst << ".html" unless dst.end_with?(".html")
18
18
  system("livetext #{src} >#{dst}")
19
19
  end
20
20
 
data/lib/liveblog.rb CHANGED
@@ -193,8 +193,8 @@ def write_post
193
193
  @postdir.gsub!(/\/\//, "/") # FIXME unneeded?
194
194
  Dir.mkdir(@postdir) unless Dir.exist?(@postdir) # FIXME remember assets!
195
195
  Dir.chdir(@postdir)
196
- @meta.views = @meta.views.join(" ")
197
- @meta.tags = @meta.tags.join(" ") rescue ""
196
+ @meta.views = @meta.views.join(" ") if @meta.views.is_a? Array
197
+ @meta.tags = @meta.tags.join(" ") if @meta.tags.is_a? Array
198
198
  File.write("teaser.txt", @meta.teaser)
199
199
 
200
200
  fields = [:num, :title, :date, :pubdate, :views, :tags]
@@ -212,6 +212,7 @@ end
212
212
  def teaser
213
213
  raise "'post' was not called" unless @meta
214
214
  @meta.teaser = _body_text
215
+ setvar :teaser, @meta.teaser
215
216
  _out @meta.teaser + "\n"
216
217
  # FIXME
217
218
  end
@@ -290,17 +291,17 @@ def head # Does NOT output <head> tags
290
291
  defaults = {}
291
292
  defaults = { "charset" => %[<meta charset="utf-8">],
292
293
  "http-equiv" => %[<meta http-equiv="X-UA-Compatible" content="IE=edge">],
293
- "title" => %[<title>\n #{_var(:title)} | #{_var(:desc)}\n </title>],
294
+ "title" => %[<title>\n #{_var(:blog)} | #{_var(:blog_desc)}\n </title>],
294
295
  "generator" => %[<meta name="generator" content="Runeblog v #@version">],
295
- "og:title" => %[<meta property="og:title" content="#{_var(:title)}">],
296
- "og:locale" => %[<meta property="og:locale" content="en_US">],
297
- "description" => %[<meta name="description" content="#{_var(:desc)}">],
298
- "og:description" => %[<meta property="og:description" content="#{_var(:desc)}">],
296
+ "og:title" => %[<meta property="og:title" content="#{_var(:blog)}">],
297
+ "og:locale" => %[<meta property="og:locale" content="#{_var(:locale)}">],
298
+ "description" => %[<meta name="description" content="#{_var(:blog_desc)}">],
299
+ "og:description" => %[<meta property="og:description" content="#{_var(:blog_desc)}">],
299
300
  "linkc" => %[<link rel="canonical" href="#{_var(:host)}">],
300
301
  "og:url" => %[<meta property="og:url" content="#{_var(:host)}">],
301
- "og:site_name" => %[<meta property="og:site_name" content="#{_var(:title)}">],
302
+ "og:site_name" => %[<meta property="og:site_name" content="#{_var(:blog)}">],
302
303
  "style" => %[<link rel="stylesheet" href="etc/blog.css">],
303
- "feed" => %[<link type="application/atom+xml" rel="alternate" href="#{_var(:host)}/feed.xml" title="#{_var(:title)}">],
304
+ "feed" => %[<link type="application/atom+xml" rel="alternate" href="#{_var(:host)}/feed.xml" title="#{_var(:blog)}">],
304
305
  "favicon" => %[<link rel="shortcut icon" type="image/x-icon" href="../etc/favicon.ico">\n <link rel="apple-touch-icon" href="../etc/favicon.ico">]
305
306
  }
306
307
  result = {}
@@ -319,12 +320,19 @@ def head # Does NOT output <head> tags
319
320
  result["style"] = %[<link rel="stylesheet" href="('/etc/#{remain}')">]
320
321
  # Later: allow other overrides
321
322
  when ""; break
323
+ else
324
+ STDERR.puts "-- got '#{word}'; old value = #{result[word].inspect}"
325
+ if defaults[word]
326
+ result[word] = %[<meta property="#{word}" content="#{remain}">]
327
+ STDERR.puts "-- new value = #{result[word].inspect}"
322
328
  else
323
329
  puts "Unknown tag '#{word}'"
330
+ end
324
331
  end
325
332
  end
326
333
  hash = defaults.dup.update(result) # FIXME collisions?
327
- # _out "<html lang=en_US>"
334
+
335
+ # _out "<!-- "; _out hash.inspect; _out "--> "
328
336
  hash.each_value {|x| _out " " + x }
329
337
  _out "<body>"
330
338
  end
@@ -569,7 +577,7 @@ rescue
569
577
  end
570
578
 
571
579
  def navbar
572
- title = _var(:title)
580
+ title = _var(:blog)
573
581
  open = <<-HTML
574
582
  <nav class="navbar navbar-expand-lg navbar-light bg-light">
575
583
  <a class="navbar-brand" href="index.html">#{title}</a>
data/lib/runeblog.rb CHANGED
@@ -396,9 +396,17 @@ class RuneBlog
396
396
  copy!("#{@theme}/*", "#{staging}")
397
397
  copy(lt3, staging)
398
398
  html = noext[5..-1]
399
+ livetext draft, html
400
+ STDERR.puts "pwd = #{Dir.pwd}"
401
+ copy(draft, "../../staging/post/index.html")
402
+ title_line = File.readlines(draft).grep(/^.title /).first
403
+ title = title_line.split(" ", 2)[1]
404
+ excerpt = File.read("teaser.txt")
405
+ vars = %[.set title="#{title.chomp}"\n] +
406
+ %[.set teaser="#{excerpt.chomp}"]
399
407
  Dir.chdir(staging) do
400
- livetext draft, html
401
- # link to POST??
408
+ File.open("vars.lt3", "w") {|f| f.puts vars }
409
+ livetext "post/generate.lt3", html
402
410
  copy html, "../remote"
403
411
  collect_recent_posts("recent.html")
404
412
  copy("recent.html", "../remote")
@@ -2,7 +2,7 @@
2
2
  if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
3
3
 
4
4
  class RuneBlog
5
- VERSION = "0.1.93"
5
+ VERSION = "0.1.94"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
data/lib/view.rb CHANGED
@@ -38,14 +38,10 @@ class RuneBlog::View
38
38
 
39
39
  def publishable_files
40
40
  vdir = dir()
41
- files = [local_index()]
42
- others = Dir.entries(vdir + "/remote").grep(/^\d\d\d\d/).map {|x| "#{vdir}/remote/#{x}" }
43
- abort "FIXME... publishable_files"
44
- deep_assets = Dir["#{vdir}/themes/standard/assets/*"]
45
- deep_assets.each do |file| # Do this at view creation
46
- cmd = "cp #{file} #{vdir}/assets"
47
- system(cmd)
48
- end
41
+ remote = local_index()
42
+ files = [remote]
43
+ others = Dir.entries(vdir + "/remote").map {|x| "#{vdir}/remote/#{x}" }
44
+
49
45
  assets = Dir.entries("#{vdir}/assets") - %w[. ..]
50
46
  assets.map! {|x| "#{vdir}/assets/#{x}" }
51
47
  assets.reject! {|x| File.directory?(x) }
data/test/general_test.rb CHANGED
@@ -2,7 +2,7 @@ $LOAD_PATH << "."
2
2
  # require "test_helper"
3
3
 
4
4
  require "minitest/autorun"
5
- require "minitest/fail_fast"
5
+ # require "minitest/fail_fast"
6
6
 
7
7
  require 'runeblog'
8
8
  require 'lib/repl'
@@ -1,7 +1,13 @@
1
- .set author="Hal Fulton"
2
- .set title="My Blog (and Welcome To It)"
3
- .set desc="All the stuff you never needed to know"
4
- .set host=localhost:4000//
1
+ .variables
2
+ author Hal Fulton
3
+ blog My Blog (and Welcome To It)
4
+ blog_desc All the stuff you never needed to know
5
+ host localhost:4000//
6
+ charset utf-8
7
+ site rubyhacker.com
8
+ url localhost:4000//
9
+ locale en_US
10
+ .end
5
11
 
6
12
  . Maybe move publish info here?
7
13
 
@@ -6,15 +6,18 @@
6
6
  <!-- Editing this file is not recommended. -->
7
7
  <!-- It was generated from $File on $$date. -->
8
8
 
9
+ .include meta.lt3
9
10
  .include global.lt3
10
- .include blog/head.lt3
11
- . post head stuff...
12
11
 
13
- . html/body mismatch?
12
+ .include vars.lt3
13
+ .head
14
+ og:title $title
15
+ description $teaser
16
+ .end
14
17
 
15
18
  <section class="post">
16
19
  <div class="entry-content">
17
- $.include post/index.lt3
20
+ $.include post/index.html
18
21
  </div>
19
22
  </section>
20
23
  </body>
@@ -0,0 +1,29 @@
1
+
2
+ charset: utf-8
3
+ blog: My Blog (and Welcome To It)
4
+ blog_desc: All the stuff you never needed to know
5
+ site: rubyhacker.com
6
+ url: localhost:4000//
7
+ locale: en_US
8
+
9
+ <meta charset="utf-8">
10
+ ** <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
11
+ ** <meta name="viewport" content="width=device-width,initial-scale=1">
12
+
13
+ <p>
14
+ <title>
15
+ My Blog (and Welcome To It) | All the stuff you never needed to know
16
+ </title>
17
+ <meta name="generator" content="Runeblog v 0.1.93">
18
+ <meta property="og:title" content="My Blog (and Welcome To It)">
19
+ <meta property="og:locale" content="en_US">
20
+ <meta name="description" content="All the stuff you never needed to know">
21
+ <meta property="og:description" content="All the stuff you never needed to know">
22
+ <link rel="canonical" href="localhost:4000//">
23
+ <meta property="og:url" content="localhost:4000//">
24
+ <meta property="og:site_name" content="My Blog (and Welcome To It)">
25
+ <link rel="stylesheet" href="etc/blog.css">
26
+ <link type="application/atom+xml" rel="alternate" href="localhost:4000///feed.xml" title="My Blog (and Welcome To It)">
27
+ <link rel="shortcut icon" type="image/x-icon" href="../etc/favicon.ico">
28
+ <link rel="apple-touch-icon" href="../etc/favicon.ico">
29
+ <body>
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.1.93
4
+ version: 0.1.94
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-14 00:00:00.000000000 Z
11
+ date: 2019-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext
@@ -98,6 +98,7 @@ files:
98
98
  - themes/standard/sidebar/news.lt3
99
99
  - themes/standard/sidebar/tag-cloud.lt3
100
100
  - themes/standard/tryme.lt3
101
+ - themes/standard/vars
101
102
  homepage: https://github.com/Hal9000/runeblog
102
103
  licenses:
103
104
  - Ruby