ich eine jekyll Seite haben, wo ich die die beiden Ordner haben: products
_products/product_name
Verwenden Seite Attribut in Include-Anweisung jekyll
und ich habe eine md-Datei Produktseite containg dieses:
---
title: product_title
subtitle: subtilte
layout: product
description: long description
product_icon: product_image_path
---
Und diese einfache Layout:
---
layout: default
---
<!-- Main -->
<div id="main">
<div id="content" class="container">
<header id="product_header">
<div class="half_left center">
<img id="product_icon" src="/assets/{{ page.product_icon }}" alt="">
<h2 id="product_title">{{ page.title }}</h2>
<h3 id="product_subtitle">{{page.subtitle}}</h3>
</div>
<div class="half_right center">
{% markdown _products/page.title/short.md %}
</div>
<div class="clear"></div>
</header>
{{content}}
</div>
</div>
jedoch in: {% markdown _products/page.title/short.md %}
ich scheine nicht in der Lage der Seitentitel zu erfassen, wie ich dies tun kann?
Mein Abschlag tag:
# From: http://wolfslittlestore.be/2013/10/rendering-markdown-in-jekyll/
=begin
Jekyll tag to include Markdown text from _includes directory preprocessing with Liquid.
Usage:
{% markdown <filename> %}
Dependency:
- kramdown
=end
module Jekyll
class MarkdownTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text.strip
end
require "kramdown"
def render(context)
tmpl = File.read File.join Dir.pwd, "", @text
site = context.registers[:site]
tmpl = (Liquid::Template.parse tmpl).render site.site_payload
html = Kramdown::Document.new(tmpl).to_html
end
end
end
Liquid::Template.register_tag('markdown', Jekyll::MarkdownTag)
Kann mir jemand sagen, wie ich die Page.Title im {% markdown _products/page.title/short.md %}
ich diesen Fehler erfassen: Liquid Exception: No such file or directory @ rb_sysopen - /home/tools/git/pagename.github.io/_products/page.title/short in _layouts/product.html