Skip to content

Commit

Permalink
Don't actively redirect users.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Jan 2, 2024
1 parent cfc6ca3 commit b70bbd0
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,9 @@ end

function hfun_redirect(params)
url = params[1]

# XXX: is this safe?
#Franklin.set_var!(Franklin.LOCAL_VARS, "fd_full_url", url)

return """
<meta http-equiv="refresh" content="0;url=$url">
<!-- fallback 1: use Javscript, in case the browser doesn't like meta tags in the body -->
<script>
window.onload = function() {
window.location.href = "$url";
}
</script>
<!-- fallback 2: provide a visual element, in case Javascript is disabled -->
<p>This blog post is located at <a href="$url">$url</a></p>
"""
# NOTE: we don't do a <meta> or <script> redirect, because that would
# end up in the RSS feed which some sites pick up verbatim.
return """<p>This post is located at <a href="$url">$url</a></p>"""
end

function hfun_post_date()
Expand Down

0 comments on commit b70bbd0

Please sign in to comment.