1

I am using Jekyll to create a personal website. I am using the Beautiful-Jekyll template that is very popular. There is a navigation bar already defined in _config.yml. I want to make Resume link to my resume pdf.

I have accomplished that with this code (in _config.yml):

# List of links in the navigation bar
navbar-links:
  Moi: "aboutme"
  Projects:
    - Hell Game: "http://deanattali.com/beautiful-jekyll/"
    - Success City: "http://www.markdowntutorial.com/"
  Resume: "Tech Resume.pdf"

However, this only opens the resume in the same tab. I want it to open in a separate tab. In HTML, you achieve this by using target="_blank". How do I do this in YAML?

I tried this but my index.html actually doesn't use links. I know, weird.

flyx
  • 35,506
  • 7
  • 89
  • 126
Jessica
  • 1,083
  • 2
  • 12
  • 27
  • 2
    The linked template certainly [does use links](https://github.com/daattali/beautiful-jekyll/blob/master/_includes/navbarlink.html#L16) for its navbar items, it's just in an included file and not directly in the `index.html`. – flyx Jun 22 '19 at 12:01

1 Answers1

1

beautiful-jekyll/_includes/nav.html line 26:

<a href="{{ linkparts[1] | relative_url }}">{{ linkparts[0] }}</a>

Change it into:

<a href="{{ linkparts[1] | relative_url }}" 
{% if linkparts[1] contains '.pdf' %}target="_blank"{% endif %}
>{{ linkparts[0] }}</a>

Or use this (java)script/solution: https://jekyllcodex.org/without-plugin/new-window-fix/

Mr. Hugo
  • 11,887
  • 3
  • 42
  • 60