Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@vjousse

vjousse/post.cr Secret

Created September 8, 2020 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vjousse/62b35d618a71d44c0b32024a14029657 to your computer and use it in GitHub Desktop.
Save vjousse/62b35d618a71d44c0b32024a14029657 to your computer and use it in GitHub Desktop.
require "markd"
class Blog::Post < BrowserAction
include Auth::AllowGuests
get "/blog/:post_slug" do
file_content = File.read("content/fr/#{post_slug}.md")
html Blog::PostPage, title: post_slug, html_content: html_content
end
end
# URL http://localhost:3001/blog/2012-11-05-recrutement-développeur-web-comment-sortir-du-lot-cv-lettre-de-motivation
# gives the value `2012-11-05-recrutement-d%C3%A9veloppeur-web-comment-sortir-du-lot-cv-lettre-de-motivation` inside the variable post_slug
# this seems pretty normal to me. Any way to "unescap" the `é` character to get it bakc from the `%C3%A9` entity?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment