+2
Gemfile
+2
Gemfile
+4
Gemfile.lock
+4
Gemfile.lock
···
2
2
remote: https://rubygems.org/
3
3
specs:
4
4
base64 (0.2.0)
5
+
builder (3.3.0)
5
6
ffi (1.17.1-arm64-darwin)
6
7
haml (6.3.0)
7
8
temple (>= 0.8.2)
···
10
11
kramdown (2.5.1)
11
12
rexml (>= 3.3.9)
12
13
logger (1.7.0)
14
+
markaby (0.9.4)
15
+
builder
13
16
minisky (0.5.0)
14
17
base64 (~> 0.1)
15
18
multi_json (1.15.0)
···
56
59
DEPENDENCIES
57
60
haml
58
61
kramdown (~> 2.5)
62
+
markaby (~> 0.9.4)
59
63
minisky
60
64
puma (~> 6.6)
61
65
rackup (~> 2.2)
+3
main.rb
+3
main.rb
···
2
2
require "sinatra/contrib"
3
3
4
4
require "haml"
5
+
require "markaby/kernel_method"
5
6
require "kramdown"
6
7
require_relative "extra/helpers"
7
8
ENV["LUA_LIB"] = abs_path("./liblua.dylib")
···
16
17
data = MainBlog.post_list(page)
17
18
cursor = data[:cursor]
18
19
posts = data[:records]
20
+
@title = MainBlog.home_rec["title"]
19
21
haml :index, locals: { cursor: cursor, posts: posts, backbutton: backbutton }
20
22
end
21
23
22
24
get "/post/:post_id" do
23
25
post = MainBlog.get_post(params[:post_id])
26
+
@title = post["value"]["title"] + " | " + MainBlog.home_rec["title"]
24
27
haml :post, locals: { post_content: post["value"] }
25
28
end
26
29
+9
-1
views/block.haml
+9
-1
views/block.haml
···
4
4
- @text = section["text"]
5
5
- if @text.empty?
6
6
- else
7
-
!= haml :paragraph
7
+
%p<>!= haml :paragraph
8
+
- when "list"
9
+
%ol
10
+
- section["text"].each do |elem|
11
+
- @text = elem
12
+
%li<>!= haml :paragraph
13
+
- when "code"
14
+
%pre
15
+
%code<>= section["text"]
8
16
- when "heading"
9
17
%h3>= section["text"]
10
18
- when "subheading"
-5
views/index.haml
-5
views/index.haml
+5
views/layout.haml
+5
views/layout.haml