This commit is contained in:
Edward Loveall 2021-10-23 15:34:13 -04:00
parent 5df9c44a5c
commit 4b354c659f
No known key found for this signature in database
GPG Key ID: 789A4AE983AC8901
5 changed files with 113 additions and 43 deletions

5
src/actions/faq/index.cr Normal file
View File

@ -0,0 +1,5 @@
class Faq::Index < BrowserAction
get "/faq" do
html Faq::IndexPage
end
end

View File

@ -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

View File

@ -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?://(?:.*\\.)*(?<!link\\.)medium\\.com(/.*)?$"
end
li do
strong "Redirect to: "
code "https://"
code app_domain
code "$1"
end
li do
strong "Pattern type: "
code "( ) Wildcard (•) Regular Expression"
end
end
para "Visiting any medium.com site (including user.medium.com subdomains) should now redirect to Scribe instead!"
end
end
private def why_would_i_want_this
section do
h2 "Why Would I Want to Use This?"
para do
text "There are a number of potential reasons:"
ul do
li do
text "You believe in an "
a "open web", href: "http://scripting.com/liveblog/users/davewiner/2016/01/20/0900.html"
end
li do
text "You believe more in "
a "the author", href: "https://www.manton.org/2016/01/15/silos-as-shortcuts.html"
text " than the platform"
end
li do
text "You "
a "don't like the reading experience", href: "https://twitter.com/BretFisher/status/1206766086961745920"
text " that Medium provides"
end
li do
text "You object to "
a "Medium's extortionist business tactics", href: "https://www.cdevn.com/why-medium-actually-sucks/"
end
li do
text "You're concerned about how "
a "Medium uses your data", href: "https://tosdr.org/en/service/1003"
end
li do
a "Other reasons", href: "https://nomedium.dev/"
end
end
end
end
end
end

View File

@ -37,51 +37,11 @@ class Home::IndexPage < MainLayout
section do
h2 "How-To Automatically"
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?://(?:.*\\.)*(?<!link\\.)medium\\.com(/.*)?$"
end
li do
strong "Redirect to: "
code "https://"
code app_domain
code "$1"
end
li do
strong "Pattern type: "
code "( ) Wildcard (•) Regular Expression"
end
end
para "Visiting any medium.com site (including user.medium.com subdomains) should now redirect to Scribe instead!"
end
section do
footer do
para do
a "Source code", href: "https://sr.ht/~edwardloveall/scribe"
end
text "Check out the "
link "FAQ", to: Faq::Index
end
end
mount Shared::LayoutFooter
end
end
def app_domain
URI.parse(Home::Index.url).normalize
.to_s
.sub(/\/$/, "")
.sub(/^https?:\/\//, "")
end
end

View File

@ -20,4 +20,11 @@ abstract class MainLayout
end
end
end
private def app_domain
URI.parse(Home::Index.url).normalize
.to_s
.sub(/\/$/, "")
.sub(/^https?:\/\//, "")
end
end