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