This is a quick demo showing you how you can redirect markdown files in GitHub pages using an HTML template. You can check the source code and fork/change it to your needs.
You can use the
forward.html layout template to redirect any one of your markdown files to another document. By default, it redirects directly, but you can tweak the time and the messaging you want to show to your needs using Markdown frontmatter.
The simplest option is to choose the
forward template and define a
target URL to send the user to.
This just sends the user directly to the URL you provide. Try plain-redirect.md
--- layout: forward target: https://example.com ---
You have a few more options to set to customise your redirect:
--- layout: forward target: https://example.com targetname: Example.com targettitle: Taking you to example.com time: 10 message: This isn't here any more! ---
targetis the URL to redirect to. This defaults to the
targetnameis the text to display for the URL
targettitleis the title shown in the heading and the page title. This defaults to “Redirecting to
timeis the time in seconds
messageis the message to show above the link provided as a fallback
You can try this example redirect-all-options-set.md