4

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?

JWS
  • 335
  • 3
  • 13

2 Answers2

1

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.

Mr. Hugo
  • 11,887
  • 3
  • 42
  • 60
0

alias alpha/beta => omega

  1. Create folder _alpha/beta

  2. update _config.yml

includes_dir: _alpha

collections:
  alpha:
    collections_dir: _alpha/beta
    output: true
    permalink: /omega/:name