runeblog 0.2.41 → 0.2.46

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/bin/blog +4 -7
  3. data/empty_view/themes/standard/blog/post_entry.lt3 +11 -10
  4. data/empty_view/themes/standard/etc/blog.css.lt3 +18 -1
  5. data/empty_view/themes/standard/navbar/faq.lt3 +1 -0
  6. data/empty_view/themes/standard/navbar/navbar.lt3 +1 -0
  7. data/empty_view/themes/standard/post/generate.lt3 +9 -4
  8. data/empty_view/themes/standard/widgets/ad/ad.lt3 +8 -1
  9. data/empty_view/themes/standard/widgets/ad/ad1.png +0 -0
  10. data/empty_view/themes/standard/widgets/ad/ad2.png +0 -0
  11. data/empty_view/themes/standard/widgets/ad/ad3.png +0 -0
  12. data/empty_view/themes/standard/widgets/ad/ad4.png +0 -0
  13. data/empty_view/themes/standard/widgets/bydates/bydates.rb +7 -3
  14. data/empty_view/themes/standard/widgets/links/links.rb +28 -3
  15. data/empty_view/themes/standard/widgets/news/news.rb +7 -3
  16. data/empty_view/themes/standard/widgets/pages/pages.rb +10 -3
  17. data/empty_view/themes/standard/widgets/pinned/pinned.rb +7 -3
  18. data/empty_view/themes/standard/widgets/search/search.rb +7 -3
  19. data/empty_view/themes/standard/widgets/sitemap/sitemap.rb +7 -3
  20. data/empty_view/themes/standard/widgets/tag-cloud/tag-cloud.rb +7 -3
  21. data/lib/default.rb +1 -4
  22. data/lib/global.rb +8 -7
  23. data/lib/helpers-blog.rb +15 -15
  24. data/lib/liveblog.rb +94 -57
  25. data/lib/logging.rb +17 -8
  26. data/lib/post.rb +6 -6
  27. data/lib/publish.rb +4 -4
  28. data/lib/repl.rb +1 -0
  29. data/lib/runeblog.rb +77 -47
  30. data/lib/runeblog_version.rb +1 -1
  31. data/lib/view.rb +2 -8
  32. data/lib/xlate.rb +2 -2
  33. data/test/austin.rb +159 -0
  34. metadata +8 -5
  35. data/empty_view/remote/widgets/links/list.data +0 -3
  36. data/empty_view/remote/widgets/news/list.data +0 -4
  37. 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: 01171d08263fe5ee887ce0823abd7195ce9f9240c1f45cf3de94335b0112a98b
4
- data.tar.gz: aa6f0ed12b6554c0b5d93ed0f6d29be4f9a071dc27654b1cebd4d5c6b952591b
3
+ metadata.gz: c764956fc67556826d90815f706b69523817eaee26cf7ec32671794a65e15538
4
+ data.tar.gz: 3fb1d9bcc3ae3802891378568b4ef729ceb757ace7b4a4efdee7aa3d8ba775d2
5
5
  SHA512:
6
- metadata.gz: fba5b0128b75456357871b559f4c033de9c9b4d54215358cf8f371a9125a6145d560b71f764042f9db3deca9a00e64e0a6f9f71356cfcdcc8592e5b7e0b25c8e
7
- data.tar.gz: 7b51735446277efdc8da39e0835434b24ca0de5035cdfbbbeaaad35f09da980a87869687d93fe51e8ef68ee7d7be431c413a06ff7cf4fb46e4e3d8dc735b7226
6
+ metadata.gz: f52c5f8975373cb2544126e3e7245bc37cf7e3c16a2417cdfb29a002f07e369ad0c8a50018b85665a8a20a21632af3094c9e41fa63f8065ca319acef1480322e
7
+ data.tar.gz: 693309103d55a20a48984da73ecdf4c2544e9b950ea504ec54e895ab1bc68560cfad30eede26f8b30c622d9d47cd773f8424d05cf8fcca5dc6440f929420febe
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
@@ -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>
@@ -24,7 +24,6 @@
24
24
  \.post-title-text a {
25
25
  color: $post.text.color;
26
26
  font-size: $post.text.size;
27
- # float: right;
28
27
  display: block;
29
28
  text-decoration: none;
30
29
  }
@@ -41,3 +40,21 @@
41
40
  text-align: top;
42
41
  }
43
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,13 +16,20 @@ 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
+ <table border=0 width=100%><tr>
24
+ <td align=left valign=bottom><h2 class="post-title">$title</h2></td>
25
+ <td align=right valign=top><font size=-5><br></font>$longdate</td>
26
+ </tr></table><hr>
23
27
  $.copy guts.html
24
28
  </div>
25
29
  </section>
26
30
 
27
31
  <br>
28
- <a href="javascript:history.go(-1)">[Back]</a>
32
+ <hr>
33
+ .post_trailer
29
34
  </body>
30
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
@@ -28,6 +28,3 @@ TEXT
28
28
  end
29
29
 
30
30
  end
31
-
32
-
33
-
@@ -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,8 +30,9 @@ def make_exception(sym, str)
30
30
  end
31
31
  end
32
32
 
33
- def system!(str)
34
- log!(enter: __method__, args: [str])
33
+ def system!(str, show: false)
34
+ log!(enter: __method__, args: [str], level: 2)
35
+ STDERR.puts str if show
35
36
  rc = system(str)
36
37
  if rc
37
38
  return rc
@@ -44,12 +45,12 @@ end
44
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
52
  def check_meta(meta, where = "")
52
- log!(enter: __method__, args: [meta, where])
53
+ log!(enter: __method__, args: [meta, where], level: 3)
53
54
  str = "--- #{where}\n"
54
55
  str << "\ncheck_meta: \n" + caller.join("\n") + "\n meta = #{meta.inspect}\n"
55
56
  str << " title missing!\n" unless meta.title
@@ -62,14 +63,14 @@ def check_meta(meta, where = "")
62
63
  end
63
64
 
64
65
  def verify(hash)
65
- log!(enter: __method__, args: [hash])
66
+ log!(enter: __method__, args: [hash], level: 3)
66
67
  hash.each_pair do |expr, msg|
67
68
  puts "<< #{msg}" unless expr
68
69
  end
69
70
  end
70
71
 
71
72
  def assure(hash) # really the same as verify for now...
72
- log!(enter: __method__, args: [hash])
73
+ log!(enter: __method__, args: [hash], level: 3)
73
74
  hash.each_pair do |expr, msg|
74
75
  puts "<< #{msg}" unless expr
75
76
  end