Redirect cv page to pdf #806
-
Hi! I have updated my website from the previous version and would like to redirect the cv page to a pdf of my cv instead of displaying details on the page itself. Could someone advise how this can be done? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
You'll need to modify the header html to point to your CV's URL using an anchor tag. :) |
Beta Was this translation helpful? Give feedback.
-
You can add a file named <!DOCTYPE html>
<html>
<head>
<link rel="canonical" href="{{ page.redirect_to }}"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="0;url={{ page.redirect_to }}" />
</head>
<body>
<h1>Redirecting...</h1>
<a href="{{ page.redirect_to }}">Click here if you are not redirected.<a>
<script>location='{{ page.redirect_to }}'</script>
</body>
</html> and replace the ---
layout: redirected
permalink: /cv/
redirect_to: https://your.pdf.location
--- I think this can solve your question. |
Beta Was this translation helpful? Give feedback.
-
You could also modify <!-- Head -->
<head>
{%- if page.redirect -%}
<meta http-equiv="refresh" content="3; url={{ site.baseurl }}/" />
{%- endif -%}
{%- if page.redirect_to -%}
<meta http-equiv="refresh" content="0; url={{ page.redirect_to }}/" />
{%- endif -%}
{% include head.html %}
</head> Then, your ---
layout: default
permalink: /cv/
title: cv
nav: true
nav_order: 4
redirect_to: /assets/pdf/your-cv.pdf
--- Since this solution re-uses the |
Beta Was this translation helpful? Give feedback.
-
In case it is helpful, you can also have the pdf embedded in the webpage. Like this you avoid that people leave the website when reading the pdf. The solution can be found at https://stackoverflow.com/questions/46105960/inserting-my-pdf-in-my-blogs |
Beta Was this translation helpful? Give feedback.
You could also modify
_layouts/default.html
to include the following:Then, your
_pages/cv.md
would look like:Since this solution re-uses the
default.html
page, it benefits from still including things like analytics scripts for the cv page.