【发布时间】:2016-02-07 19:56:11
【问题描述】:
我正在为我的网站使用 Jekyll,并且我有以 {% if page.second-image %} 开头并以 {% endif %} 结尾的附加图片。不幸的是,即使帖子中没有第二张图片,这些图片标签仍会显示。如果没有将它们编码到当前帖子中,我如何让 Jekyll 忽略它们?谢谢!!
layout: post
title: title
date: 2015-09-02
image: /img/path.png
second-image: /img/path.png
third-image: /img/path.png
description: Landing Page/Menu Design
meta-title: meta title information
但帖子模板中的第 4、5 和第 6 张图片显示为断开的链接,即使它们不存在
【问题讨论】:
-
能否将您的帖子 yaml front-matter 添加到您的问题中?
-
当然。 --- 布局:帖子标题:标题日期:2015-09-02 图片:/img/path.png 第二张图片:/img/path.png 第三张图片:/img/path.png 描述:登陆页面/菜单设计元标题:元标题信息 --- 但随后第 4、第 5 和第 6 张图像显示为断开的链接,即使它们不在帖子中
标签: image conditional jekyll broken-links