Closed kayaelle closed 3 months ago
Hmm, it doesn't seem that the jekyll-redirect-from library can handle resource requests that are not webpage URLs, i.e. a link to a pdf.
Can you do a custom 404 to redirect a specific link (to a PDF) to another PDF or generated page?
Redirect wordpress...pdf to correct pdf.
Or
Redirect wordpress...pdf to the homepage or publications page?
On Thu, Mar 2, 2023 at 3:22 PM fields37 @.***> wrote:
Hmm, it doesn't seem that the jekyll-redirect-from library can handle resource requests that are not webpage URLs, i.e. a link to a pdf.
— Reply to this email directly, view it on GitHub https://github.com/digitalcredentials/dcc-website/issues/14#issuecomment-1452496313, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFXVRUZSKYB72QSKZ4JQITW2D6QJANCNFSM6AAAAAAU733JQI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I was able to handle this in https://github.com/digitalcredentials/dcc-website-jekyll/commit/8785d18ef389720c65d4d8641150c5fa37f1b07b by adding a markdown 404 page so any 404 errors remain on the Jekyll site, and then adding a redirect script that checks the URL and switches it to the correct one.
In order for the 404 page to continue functioning with images and styles loading, when the site URL is changed the base href in line https://github.com/digitalcredentials/dcc-website-jekyll/blob/8785d18ef389720c65d4d8641150c5fa37f1b07b/_layouts/default.html#L7 will need to be edited to reflect the new page URL.
And for the redirects to work, when the page is moved to a custom domain from the Github pages format, pathSegmentsToKeep in line https://github.com/digitalcredentials/dcc-website-jekyll/blob/8785d18ef389720c65d4d8641150c5fa37f1b07b/js/redirect.js#L5 will need to be changed to 0 to reflect the additional subdomain that exists in the URL of a github pgaes site.
To do: close this issue and put the instructions in the above comment into a "Launch checklist" issue
@fields37 - leaving this issue open in prep for launch
Hey @fields37 - will the instructions above on Mar 20 still work?
This issue can be closed.
The correct white paper is located here: https://github.com/digitalcredentials/dcc-website/blob/master/docs/white-paper-building-digital-credential-infrastructure-future.pdf
On the Jekyll site, please redirect https://github.com/digitalcredentials/dcc-website/tree/master/wp-content/uploads/2020/02 to https://github.com/digitalcredentials/dcc-website/blob/master/docs/white-paper-building-digital-credential-infrastructure-future.pdf
This is an example of a Jekyll library that does redirects: https://github.com/jekyll/jekyll-redirect-from