cms.js
cms.js copied to clipboard
Can't put url on post metadata and pull them via the template engine
I was trying to put urls in the post listings. Sort of a featured image for each post.
---
layout: post
title: New feature TEST
excerpt: Cum sociis natoque penatibus et magnis dis parturient montes...
author: Chris
image: http://placehold.it/300x300
---
As a test I've put a url.
Then modified the layout on the post listings to reflect the changes:
<% if(post.image) { %>
<div class="post-image">
<img src="<%= post.image %>" alt="">
</div>
<% } %>
and the output html looks like this:
<div class="post-image">
<img src="http" alt="">
</div>
Is it intentional? I suppose the // in the url are getting escaped by themselves.
At first glance this looks like a bug with the front matter parser. Definitely not intentional behavior. Probably right that the "//" is getting escaped or there might be a split by ":" that's causing the issue.
I recently found this project and am having some fun. ;)