scribe/src/pages/home/index_page.cr

47 lines
1.0 KiB
Crystal
Raw Normal View History

2021-09-06 19:38:18 +02:00
class Home::IndexPage < MainLayout
def page_title
"Scribe"
end
def content
h1 "Scribe"
article do
section do
2021-10-03 23:17:36 +02:00
h2 "How-To"
2021-09-06 19:38:18 +02:00
para do
2021-10-03 23:17:36 +02:00
text "To view a Medium post simply replace "
code "medium.com", class: "highlight"
text " with "
code app_domain, class: "highlight"
2021-09-06 19:38:18 +02:00
end
para do
2021-10-03 23:17:36 +02:00
text "For example if the URL is: "
code do
span "medium.com", class: "highlight"
text "/@user/my-post-09a6af907a2"
end
text " change it to "
code do
span app_domain, class: "highlight"
text "/@user/my-post-09a6af907a2"
end
2021-09-06 19:38:18 +02:00
end
end
section do
2021-10-03 23:17:36 +02:00
footer do
para do
a "Source code", href: "https://git.sr.ht/~edwardloveall/scribe"
end
2021-09-06 19:38:18 +02:00
end
end
end
end
2021-10-03 23:17:36 +02:00
def app_domain
URI.parse(Home::Index.url).normalize
.to_s
.sub(/\/$/, "")
.sub(/^https?:\/\//, "")
end
2021-09-06 19:38:18 +02:00
end