~edwardloveall/scribe

46d87930b879e1bcfb45784dbb2e6b462d2d73bf — Edward Loveall 4 months ago 037bc7c
Use FAQ entry to explain custom domains
3 files changed, 40 insertions(+), 47 deletions(-)

M src/pages/faq/index_page.cr
M src/pages/home/index_page.cr
M src/version.cr
M src/pages/faq/index_page.cr => src/pages/faq/index_page.cr +34 -31
@@ 7,9 7,9 @@ class Faq::IndexPage < MainLayout
    h1 "Frequently Asked Questions"
    article do
      auto_redirect
      custom_domains
      why_would_i_want_this
      other_instances
      custom_domains
      mount Shared::LayoutFooter
    end
  end


@@ 77,6 77,39 @@ class Faq::IndexPage < MainLayout
    end
  end

  private def custom_domains
    section do
      a name: "custom-domains"
      h2 "What about Medium articles on custom domains?"
      para do
        text <<-TEXT
          Scribe can read these also. The URL just needs to end with the
          characters at the end of the URL called the Post ID. Here's an
          example:
        TEXT
      end
      para do
        code "example.com/my-post-"
        code "09a6af907a2", class: "highlight"
        text " can be converted to "
        br
        code app_domain
        code "/my-post-"
        code "09a6af907a2", class: "highlight"
      end
      para do
        text <<-TEXT
          The instructions above may redirect custom domains automatically. To
          manually redirect a specific custom domain to Scribe, add another
          redirect and replace
        TEXT
        text " "
        code "medium\\.com", class: "highlight"
        text " with the domain of your choosing."
      end
    end
  end

  private def why_would_i_want_this
    section do
      h2 "Why Would I Want to Use This?"


@@ 126,34 159,4 @@ class Faq::IndexPage < MainLayout
      end
    end
  end

  private def custom_domains
    section do
      h2 "What about Medium articles on custom domains?"
      para do
        text <<-TEXT
          Scribe can read these also. The URL just needs to end with the
          characters at the end of the URL called the Post ID. Here's an
          example:
        TEXT
      end
      para do
        code "example.com/my-post-"
        code "09a6af907a2", class: "highlight"
        text " can be converted to "
        br
        code app_domain
        code "/my-post-"
        code "09a6af907a2", class: "highlight"
      end
      para do
        text <<-TEXT
          To redirect automatically, follow the intructions above to on how to
          redirect medium articles. Replace
        TEXT
        code " medium\\.com"
        text " with the domain of your choosing."
      end
    end
  end
end

M src/pages/home/index_page.cr => src/pages/home/index_page.cr +5 -15
@@ 12,7 12,11 @@ class Home::IndexPage < MainLayout
        href: "/@ftrain/big-data-small-effort-b62607a43a8c"
      )
    end
    para "Custom domains work the too. See below for a How-To."
    para do
      text "Custom domains work too. See "
      link "the FAQ", to: Faq::Index.with("custom-domains")
      text " for more information."
    end
    article do
      section do
        h2 "How-To"


@@ 34,20 38,6 @@ class Home::IndexPage < MainLayout
            text "/@user/my-post-09a6af907a2"
          end
        end
        para do
          text "For articles on custom domains, instead of replacing "
          code "medium.com", class: "highlight"
          text " replace the custom domain. E.g. instead of "
          code do
            span "customdomain.com", class: "highlight"
            text "/blog/my-post-09a6af907a2"
          end
          text " change it to "
          code do
            span app_domain, class: "highlight"
            text "/blog/my-post-09a6af907a2"
          end
        end
      end
      section do
        h2 "How-To Automatically"

M src/version.cr => src/version.cr +1 -1
@@ 1,3 1,3 @@
module Scribe
  VERSION = "2022-01-04"
  VERSION = "2022-01-08"
end