Discussion:
[hakyll] Replacing generated files with redirects
p***@gmail.com
2015-10-22 13:12:08 UTC
Permalink
Folks,

Before I start asking question, let me introduce the architecture I have
right now.

First of all, I am processing "posts/*" and generating from them fairly
simple HTML that is not intended for external consumption. Those generate
pages are later on included (through getMatches) on my main page as well as
in the RSS feed. I decided to use getMatches to add custom pagination to my
blog.

Now I have problem with RSS rendering. Because I included them from
"posts/*" the link points to those HTML pages. However, after processing is
done, I would like to replace HTML in posts with redirect links to my main
page (I do not want to have pages with duplicate content). I could use
grouping and generate redirects to a separate folder and than simply copy
it over posts, but this is a hack. Do you see any way out here? Am I
abusing hakyll to do something that it was never designed to do?

Thanks,
Piotr
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hakyll+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jasper Van der Jeugt
2015-10-24 09:58:05 UTC
Permalink
Hello Piotr,

Would something like this work:

1. Drop the route for those simple HTML pages, so they are not actually
written to disk.

2. Write a custom `urlField` which sets the $url$ field to something on
your main page, and use this in the `Context` for those pages
everywhere.

I can elaborate if something is not clear.

Hope this helps,
Peace,
Jasper
Post by p***@gmail.com
Folks,
Before I start asking question, let me introduce the architecture I have
right now.
First of all, I am processing "posts/*" and generating from them fairly
simple HTML that is not intended for external consumption. Those generate
pages are later on included (through getMatches) on my main page as well as
in the RSS feed. I decided to use getMatches to add custom pagination to my
blog.
Now I have problem with RSS rendering. Because I included them from
"posts/*" the link points to those HTML pages. However, after processing is
done, I would like to replace HTML in posts with redirect links to my main
page (I do not want to have pages with duplicate content). I could use
grouping and generate redirects to a separate folder and than simply copy
it over posts, but this is a hack. Do you see any way out here? Am I
abusing hakyll to do something that it was never designed to do?
Thanks,
Piotr
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hakyll+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...