From 4b354c659fd0f0365c230f66b00287807eb837e6 Mon Sep 17 00:00:00 2001 From: Edward Loveall Date: Sat, 23 Oct 2021 15:34:13 -0400 Subject: [PATCH] Add FAQ --- src/actions/faq/index.cr | 5 ++ src/components/shared/layout_footer.cr | 11 ++++ src/pages/faq/index_page.cr | 87 ++++++++++++++++++++++++++ src/pages/home/index_page.cr | 46 +------------- src/pages/main_layout.cr | 7 +++ 5 files changed, 113 insertions(+), 43 deletions(-) create mode 100644 src/actions/faq/index.cr create mode 100644 src/components/shared/layout_footer.cr create mode 100644 src/pages/faq/index_page.cr diff --git a/src/actions/faq/index.cr b/src/actions/faq/index.cr new file mode 100644 index 0000000..4b89d7b --- /dev/null +++ b/src/actions/faq/index.cr @@ -0,0 +1,5 @@ +class Faq::Index < BrowserAction + get "/faq" do + html Faq::IndexPage + end +end diff --git a/src/components/shared/layout_footer.cr b/src/components/shared/layout_footer.cr new file mode 100644 index 0000000..b3f1541 --- /dev/null +++ b/src/components/shared/layout_footer.cr @@ -0,0 +1,11 @@ +class Shared::LayoutFooter < BaseComponent + def render + section do + footer do + para do + a "Source code", href: "https://sr.ht/~edwardloveall/scribe" + end + end + end + end +end diff --git a/src/pages/faq/index_page.cr b/src/pages/faq/index_page.cr new file mode 100644 index 0000000..6ea37ee --- /dev/null +++ b/src/pages/faq/index_page.cr @@ -0,0 +1,87 @@ +class Faq::IndexPage < MainLayout + def page_title + "Scribe FAQ" + end + + def content + h1 "Frequently Asked Questions" + article do + auto_redirect + why_would_i_want_this + mount Shared::LayoutFooter + end + end + + private def auto_redirect + section do + h2 "How-to Automatically Redirect Medium Articles" + para do + text "If you don't want to manually change the URL every time, you can use an extension to do it for you. " + a "This extension", href: "https://einaregilsson.com/redirector/" + text " works well across most browsers." + end + para "Once installed, create a new redirect with the following settings:" + ul do + li do + strong "Description: " + code "Medium -> Scribe" + end + li do + strong "Example URL: " + code "https://medium.com/@user/post-123456abcdef" + end + li do + strong "Include pattern: " + code "^https?://(?:.*\\.)*(? Scribe" - end - li do - strong "Example URL: " - code "https://medium.com/@user/post-123456abcdef" - end - li do - strong "Include pattern: " - code "^https?://(?:.*\\.)*(?