I have a Jekyll blog at example.com
and want the path example.com/doc
to point to a static file (a pdf, in particular). Jekyll alias generators seem to work only for individual posts, not static files.
What's the trick?
I have a Jekyll blog at example.com
and want the path example.com/doc
to point to a static file (a pdf, in particular). Jekyll alias generators seem to work only for individual posts, not static files.
What's the trick?
Step 1. Create a directory 'doc' in your root.
Step 2. Create an index.html in this directory with a meta redirect in the head like this:
<!DOCTYPE html>
<html>
<head>
<title>You are being redirected</title>
<meta http-equiv="refresh" content="0; url=filename.pdf">
</head>
<body>You are being redirected... if not, <a href="filename.pdf">click here</a>.</body>
</html>
Step 3. Put the filename.pdf file next to your index.html.
alias alpha/beta
=> omega
Create folder _alpha/beta
update _config.yml
includes_dir: _alpha
collections:
alpha:
collections_dir: _alpha/beta
output: true
permalink: /omega/:name