fix(tazjin/blog): Make redirects from old links permanent

Change-Id: I41d71f9aae7e64bdfef8f2b7142d13009b216eaa
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2752
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2021-04-01 19:35:20 +02:00 committed by tazjin
parent ab7e752b4a
commit d2376e24d1

View file

@ -52,8 +52,7 @@ in {
# Generate embeddable nginx configuration for redirects from old post URLs # Generate embeddable nginx configuration for redirects from old post URLs
oldRedirects = lib.concatStringsSep "\n" (map (post: '' oldRedirects = lib.concatStringsSep "\n" (map (post: ''
location ~* ^(/en)?/${post.oldKey} { location ~* ^(/en)?/${post.oldKey} {
# TODO(tazjin): 301 once this works return 301 https://tazj.in/blog/${post.key};
return 302 https://tazj.in/blog/${post.key};
} }
'') (filter (hasAttr "oldKey") posts)); '') (filter (hasAttr "oldKey") posts));
} }