runeblog 0.2.42 → 0.2.47

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/bin/blog +4 -7
  3. data/empty_view/assets/austin-pano.jpg +0 -0
  4. data/empty_view/themes/standard/blog/generate.lt3 +5 -3
  5. data/empty_view/themes/standard/blog/post_entry.lt3 +11 -10
  6. data/empty_view/themes/standard/etc/blog.css.lt3 +18 -0
  7. data/empty_view/themes/standard/navbar/faq.lt3 +1 -0
  8. data/empty_view/themes/standard/navbar/navbar.lt3 +1 -0
  9. data/empty_view/themes/standard/post/generate.lt3 +5 -4
  10. data/empty_view/themes/standard/widgets/ad/ad.lt3 +8 -1
  11. data/empty_view/themes/standard/widgets/ad/ad1.png +0 -0
  12. data/empty_view/themes/standard/widgets/ad/ad2.png +0 -0
  13. data/empty_view/themes/standard/widgets/ad/ad3.png +0 -0
  14. data/empty_view/themes/standard/widgets/ad/ad4.png +0 -0
  15. data/empty_view/themes/standard/widgets/bydates/bydates.rb +7 -3
  16. data/empty_view/themes/standard/widgets/links/links.rb +28 -3
  17. data/empty_view/themes/standard/widgets/news/news.rb +7 -3
  18. data/empty_view/themes/standard/widgets/pages/pages.rb +10 -3
  19. data/empty_view/themes/standard/widgets/pinned/pinned.rb +7 -3
  20. data/empty_view/themes/standard/widgets/search/search.rb +7 -3
  21. data/empty_view/themes/standard/widgets/sitemap/sitemap.rb +7 -3
  22. data/empty_view/themes/standard/widgets/tag-cloud/tag-cloud.rb +7 -3
  23. data/lib/default.rb +1 -1
  24. data/lib/global.rb +15 -40
  25. data/lib/helpers-blog.rb +15 -44
  26. data/lib/liveblog.rb +92 -56
  27. data/lib/logging.rb +17 -8
  28. data/lib/post.rb +7 -10
  29. data/lib/publish.rb +4 -5
  30. data/lib/repl.rb +2 -6
  31. data/lib/runeblog.rb +58 -71
  32. data/lib/runeblog_version.rb +1 -1
  33. data/lib/view.rb +2 -9
  34. data/lib/xlate.rb +35 -35
  35. data/test/austin.rb +29 -20
  36. metadata +8 -5
  37. data/empty_view/remote/widgets/links/list.data +0 -3
  38. data/empty_view/remote/widgets/news/list.data +0 -4
  39. data/empty_view/remote/widgets/pages/list.data +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4614cd8057ff8c6482fefa922372cda4e4bfc3ff0cabf607aa09452d11bd893
4
- data.tar.gz: 060c3e221272fcc0d196db0892c696ee3aec22cf8d3fc52c0804fd1be5e94694
3
+ metadata.gz: e4cdb2c0546394c622e9a648273dde7865fc8e4dd6839776c175c406ff34dba1
4
+ data.tar.gz: b96eb0e7783607b91b3b23d435eff368cea9102caa8a9342901318008d3fd0f1
5
5
  SHA512:
6
- metadata.gz: d686398ca6cfa3f27c24956cd28a51bdb6ce719c5ddd84a9ccb01ffa836f5ab8bc729e476b0822347aed57c2e05728defb5981b3c7b5085957465f4e93328336
7
- data.tar.gz: 12164e9cc1b8202dcb3591b0a02f4cbd12ebb7b5510e775c1070bb94caa868ce9b21fe10dbf760f6ff644bf4f82003f40e7bac0cc86ad30ee185fe08e3d4cd2b
6
+ metadata.gz: 1945c5f3667d6c25f74e5d7878be2cb22016588551cad9fd66949908640b18d1730cdb0463754df82bcd0ed58a8af4febf5e309fbf3f7afa62ab808f9f0e453d
7
+ data.tar.gz: 1a646b8c95822f3ed083e3a58b946efe79eda8babc23985d9e6bcd5fca1efbbe500e4b41f9fce3c54aaa41168616cbc1c2789e7984d13ff0048f2ccc2afc96eb
data/bin/blog CHANGED
@@ -16,10 +16,9 @@ def get_started
16
16
  puts
17
17
  puts fx(<<-TEXT, :bold)
18
18
  Blog repo successfully created.
19
- You can create views with the command: new view
20
- Create a post within the current view: new post
21
- You can't publish until you set up the publish file
22
- via the config command.
19
+ For help, type h or help.
20
+ Create views with: new view
21
+ Create a post (within current view): new post
23
22
  TEXT
24
23
  end
25
24
 
@@ -55,9 +54,7 @@ if ! RuneBlog.exist?
55
54
  print fx("\n No blog repo found. Create new one? (y/n): ", :bold)
56
55
  response = gets.chomp
57
56
  if response.downcase == "y"
58
- print fx("\n Enter default view name: ", :bold)
59
- view_name = gets.chomp
60
- RuneBlog.create_new_blog_repo(view_name)
57
+ RuneBlog.create_new_blog_repo
61
58
  get_started
62
59
  else
63
60
  exit
@@ -14,16 +14,18 @@
14
14
  .include blog/head.lt3
15
15
  <body>
16
16
 
17
+ .set color = #101035
18
+
17
19
  . FIXME
18
- <table width=100%>
20
+ <table width=100% bgcolor=$color>
19
21
  <tr>
20
- <td width=30% bgcolor=black>
22
+ <td width=30% bgcolor=$color>
21
23
  <div style="text-align: center; color: white">
22
24
  <h1>Around Austin</h1><br>
23
25
  The view from downtown...
24
26
  </div>
25
27
  </td>
26
- <td><img src=assets/sky2.jpg width=100%></img>
28
+ <td><img src=assets/austin-pano.jpg width=100%></img>
27
29
  </tr>
28
30
  </table>
29
31
 
@@ -4,18 +4,19 @@
4
4
  . --------------------------------------------------
5
5
 
6
6
  <div class="post">
7
- <table width=100%>
7
+ <table width=100% cellpadding=7>
8
8
  <tr>
9
- <td width=12% valign=top>
10
- <span class="post-date mt-1 mb-1">
11
- <b>#{date}</b>
12
- </span>
9
+ <td width=14% valign=top align=right style="margin-top: -1px;">
10
+ <!-- <span class="post-date mt-1 mb-1" style="margin-top: 3px; text-align: right"> -->
11
+ <font size=-1><b>#{date}</b></font>
12
+ <!-- </span> -->
13
13
  </td>
14
- <td> <!-- <span class="post-title-box"> -->
15
- <span class="post-title-text"><a href="#{url}">#{title}</a></span>
16
- <b>#{teaser_text}</b>
17
- <br>
18
- <a style="text-decoration: none" href="#{url}"><small>Keep reading...</small></a></p> <!-- </span> -->
14
+ <td>
15
+ <!-- <span class="post-title-box"> -->
16
+ <span class="post-title-text"><a href="#{url}" style="margin-top: -5px">#{title}</a></span>
17
+ <b>#{teaser_text}</b>&nbsp;&nbsp;
18
+ <a style="text-decoration: none" href="#{url}"><small>Keep reading...</small></a>
19
+ <!-- </span> -->
19
20
  </td>
20
21
  </tr>
21
22
  </table>
@@ -40,3 +40,21 @@
40
40
  text-align: top;
41
41
  }
42
42
 
43
+ \.mydrop {
44
+ color: #444444;
45
+ float: left;
46
+ text-align: top;
47
+ # font-family: Verdana;
48
+ font-size: 38px;
49
+ line-height: 38px;
50
+ # padding-top: 0px;
51
+ padding-right: 8px;
52
+ padding-left: 3px;
53
+ }
54
+
55
+ . not used?
56
+ \.thumbnail img {
57
+ max-height: 100%;
58
+ max-width: 100%;
59
+ }
60
+
@@ -0,0 +1 @@
1
+ .include ../widgets/pages/faq.lt3
@@ -12,5 +12,6 @@
12
12
  index Home
13
13
  about About
14
14
  contact Contact
15
+ faq FAQ
15
16
  .end
16
17
 
@@ -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>
@@ -1,15 +1,22 @@
1
1
  . In real life, ads won't work this way...
2
2
 
3
+ .include vars.lt3
4
+
3
5
  .set classname="btn btn-light float-right"
4
6
  .set card.title="Advertisement"
5
7
  .set card.text="Build your amazing website with blabla.com."
6
- .set extra="bg-dark text-white"
8
+ . set extra="bg-dark text-white"
9
+
10
+ <!-- "$ad.image" -->
7
11
 
8
12
  <div class="card $extra mb-3">
9
13
  <div class="card-body">
14
+ <!--
10
15
  <h5 class="card-title">$card.title</h5>
11
16
  <p class="card-text">$card.text</p>
12
17
  <a href="javascript: void(0)" onclick="javascript:open_main('widgets/ad/ad.html')" class="$classname">Visit page</a>
18
+ -->
19
+ <img style="max-height: 100%; max-width: 100%" src="$ad.image"></img>
13
20
  </div>
14
21
  </div>
15
22
 
@@ -2,13 +2,17 @@
2
2
 
3
3
  class ::RuneBlog::Widget
4
4
  class Bydates
5
- def self.build
5
+ def initialize(repo)
6
+ @blog = repo
6
7
  end
7
8
 
8
- def self.edit_menu
9
+ def build
9
10
  end
10
11
 
11
- def self.refresh
12
+ def edit_menu
13
+ end
14
+
15
+ def refresh
12
16
  end
13
17
  end
14
18
  end
@@ -1,14 +1,39 @@
1
1
  # Custom code for 'links' widget
2
2
 
3
+ require 'liveblog'
4
+
3
5
  class ::RuneBlog::Widget
4
6
  class Links
5
- def self.build
7
+ Type = "links"
8
+
9
+ def initialize(repo)
10
+ @blog = repo
11
+ end
12
+
13
+ def build
14
+ input = "list.data"
15
+ lines = File.readlines(input)
16
+ data = lines.map! {|x| x.chomp.split(/, */, 3) }
17
+ css = "* { font-family: verdana }"
18
+ card_title = "External Links" # FIXME
19
+ File.open("#{Type}-main.html", "w") do |f|
20
+ _html_body(f, css) do
21
+ f.puts "<h1>#{card_title}</h1><br><hr>"
22
+ url_ref = nil
23
+ data.each do |url, frameable, title|
24
+ url_ref = (frameable == "yes") ? "href = '#{url}'" : _blank(url)
25
+ css = "color: #8888FF; text-decoration: none; font-size: 21px" # ; font-family: verdana"
26
+ f.puts %[<a style="#{css}" #{url_ref}>#{title}</a> <br>]
27
+ end
28
+ end
29
+ end
30
+ # remember -card also
6
31
  end
7
32
 
8
- def self.edit_menu
33
+ def edit_menu
9
34
  end
10
35
 
11
- def self.refresh
36
+ def refresh
12
37
  end
13
38
  end
14
39
  end
@@ -2,13 +2,17 @@
2
2
 
3
3
  class ::RuneBlog::Widget
4
4
  class News
5
- def self.build
5
+ def initialize(repo)
6
+ @blog = repo
6
7
  end
7
8
 
8
- def self.edit_menu
9
+ def build
9
10
  end
10
11
 
11
- def self.refresh
12
+ def edit_menu
13
+ end
14
+
15
+ def refresh
12
16
  end
13
17
  end
14
18
  end
@@ -4,18 +4,25 @@
4
4
 
5
5
  class ::RuneBlog::Widget
6
6
  class Pages
7
- def self.build
7
+ def initialize(repo)
8
+ @blog = repo
9
+ end
10
+
11
+ def build
12
+ # build child pages
8
13
  children = Dir["*.lt3"] - ["pages.lt3"]
9
14
  children.each do |child|
10
15
  dest = child.sub(/.lt3$/, ".html")
11
16
  xlate src: child, dst: dest # , debug: true
12
17
  end
18
+ # build mainfile
19
+ # build cardfile
13
20
  end
14
21
 
15
- def self.edit_menu
22
+ def edit_menu
16
23
  end
17
24
 
18
- def self.refresh
25
+ def refresh
19
26
  end
20
27
  end
21
28
  end
@@ -2,13 +2,17 @@
2
2
 
3
3
  class ::RuneBlog::Widget
4
4
  class Pinned
5
- def self.build
5
+ def initialize(repo)
6
+ @blog = repo
6
7
  end
7
8
 
8
- def self.edit_menu
9
+ def build
9
10
  end
10
11
 
11
- def self.refresh
12
+ def edit_menu
13
+ end
14
+
15
+ def refresh
12
16
  end
13
17
  end
14
18
  end
@@ -2,13 +2,17 @@
2
2
 
3
3
  class ::RuneBlog::Widget
4
4
  class Search
5
- def self.build
5
+ def initialize(repo)
6
+ @blog = repo
6
7
  end
7
8
 
8
- def self.edit_menu
9
+ def build
9
10
  end
10
11
 
11
- def self.refresh
12
+ def edit_menu
13
+ end
14
+
15
+ def refresh
12
16
  end
13
17
  end
14
18
  end
@@ -2,13 +2,17 @@
2
2
 
3
3
  class ::RuneBlog::Widget
4
4
  class Sitemap
5
- def self.build
5
+ def initialize(repo)
6
+ @blog = repo
6
7
  end
7
8
 
8
- def self.edit_menu
9
+ def build
9
10
  end
10
11
 
11
- def self.refresh
12
+ def edit_menu
13
+ end
14
+
15
+ def refresh
12
16
  end
13
17
  end
14
18
  end
@@ -2,13 +2,17 @@
2
2
 
3
3
  class ::RuneBlog::Widget
4
4
  class TagCloud
5
- def self.build
5
+ def initialize(repo)
6
+ @blog = repo
6
7
  end
7
8
 
8
- def self.edit_menu
9
+ def build
9
10
  end
10
11
 
11
- def self.refresh
12
+ def edit_menu
13
+ end
14
+
15
+ def refresh
12
16
  end
13
17
  end
14
18
  end
@@ -5,7 +5,7 @@ class RuneBlog::Default
5
5
  def RuneBlog.post_template(num: 0, title: "No title", date: nil, view: "test_view",
6
6
  teaser: "No teaser", body: "No body", tags: ["untagged"],
7
7
  views: [], back: "javascript:history.go(-1)", home: "no url")
8
- log!(enter: __method__, args: [num, title, date, view, teaser, body, tags, views, back, home])
8
+ log!(enter: __method__, args: [num, title, date, view, teaser, body, tags, views, back, home], level: 3)
9
9
  viewlist = (views + [view.to_s]).join(" ")
10
10
  taglist = ".tags " + tags.join(" ")
11
11
  <<-TEXT
@@ -20,7 +20,7 @@ end
20
20
  # Refactor, move stuff elsewhere?
21
21
 
22
22
  def make_exception(sym, str)
23
- log!(enter: __method__, args: [sym, str])
23
+ log!(enter: __method__, args: [sym, str], level: 3)
24
24
  return if Object.constants.include?(sym)
25
25
  Object.const_set(sym, StandardError.dup)
26
26
  define_method(sym) do |*args|
@@ -30,47 +30,22 @@ def make_exception(sym, str)
30
30
  end
31
31
  end
32
32
 
33
- def system!(str)
34
- log!(enter: __method__, args: [str])
35
- rc = system(str)
36
- if rc
37
- return rc
38
- else
39
- STDERR.puts "FAILED: #{str.inspect}"
40
- STDERR.puts "\ncaller = \n#{caller.join("\n ")}\n"
41
- return rc
42
- end
43
- rc
44
- end
33
+ def system!(str, show: false)
34
+ log!(enter: __method__, args: [str], level: 2)
35
+ STDERR.puts str if show
36
+ rc = system(str)
37
+ if rc
38
+ return rc
39
+ else
40
+ STDERR.puts "FAILED: #{str.inspect}"
41
+ STDERR.puts "\ncaller = \n#{caller.join("\n ")}\n"
42
+ return rc
43
+ end
44
+ rc
45
+ end
45
46
 
46
47
  def prefix(num)
47
- log!(enter: __method__, args: [num])
48
+ log!(enter: __method__, args: [num], level: 3)
48
49
  "#{'%04d' % num.to_i}"
49
50
  end
50
51
 
51
- def check_meta(meta, where = "")
52
- log!(enter: __method__, args: [meta, where])
53
- str = "--- #{where}\n"
54
- str << "\ncheck_meta: \n" + caller.join("\n") + "\n meta = #{meta.inspect}\n"
55
- str << " title missing!\n" unless meta.title
56
- str << " title missing! (empty)" if meta.title && meta.title.empty?
57
- str << " num missing!\n" unless meta.num
58
- if str =~ /missing!/
59
- debug str
60
- raise str
61
- end
62
- end
63
-
64
- def verify(hash)
65
- log!(enter: __method__, args: [hash])
66
- hash.each_pair do |expr, msg|
67
- puts "<< #{msg}" unless expr
68
- end
69
- end
70
-
71
- def assure(hash) # really the same as verify for now...
72
- log!(enter: __method__, args: [hash])
73
- hash.each_pair do |expr, msg|
74
- puts "<< #{msg}" unless expr
75
- end
76
- end