Hey everyone. I have a need to use the Alias feature, but I’m not sure if I’m doing it right.
I have 2 pages that I want to redirect to my more recent page. So in my more recent page (content/products/itmvc/) I made the front matter look like this:
+++
...
aliases = ["/pages/itmvc/"]
...
+++
Absolutely nothing happens to the index.html for content/pages/itmvc. I’ve tried content/pages/itmvc, my.tld/pages/itmvc, content/pages/itmvc/index.html all to no avail. My understanding would be that it would change content/pages/itmvc to a new index.html with the special tags to perform the redirect. But really nothing at all happens to either pages. Am I doing something wrong?
Only the full info (aka the full site on GitHub, for instance) would make me look further into this. Maybe others would like to chime in with some wild guesses.
OK, now I read what you write. Alias is not a redirect to another page feature. It is page aliasing, nothing more. It writes actual redirect files to disk.
So for the page that I listed as an alias to: /pages/itmvc/, I was thinking that the output of building the site (after adding the alias) would place a newindex.html file in the folder /public/pages/itmvc that looked like this:
But instead, nothing happens at all. It’s just the same old content in that folder. It doesn’t throw any errors, but it doesn’t seem to do what I thought it would do - swap out the original content with the above index.html
@heynickc I’m confused: if you named all three files the same name but want them all to lead to the newest version, why even include an alias in the first place? I don’t use .toml for my front matter, but I don’t have any issues with the following yaml front matter:
title: My New Page
date: 2016-07-23
aliases: [/my-old-page/]
When navigating to mysite.com/my-old-page/ is redirects to mysite.com/my-new-page without issue. Also, have you tried removing the old markdown files that you no longer want on the site? Seems to make more sense for search purposes as well…