Hide a link if there's no YAML Front Matter


#1

So I have a setup in my posts where I reference project links like:


project-id: project-id-1
title: Project Title
project-des: Project description
project-link:

And I have a link like:

“href=”{{ project-slides.project-link }}">Open Link

Is there a way to not have the entire link displayed when there is nothing to reference in the ‘project-link:’ part?

Thanks


#2

wrap it in an if statement:

{% if page.project-link %} put your link in here {% endif %}


#3

Sorry for the late reply, but oddly that didn’t work for me?