J'ai un blog Middleman avec des fichiers post dans source/journal.Utilisation de haml pour poster des fichiers avec un blog intermédiaire
Ma config blog:
activate :blog do |blog|
# set options on blog
blog.prefix = "journal"
blog.permalink = "{year}-{month}-{day}-{title}.html.haml"
blog.sources = "{title}.html.haml"
blog.layout = "journal_layout"
end
Et un fichier post dans la source/Journal/02/12/2015-bonjour-world.html.haml
\---
title: Hello World
date: 2015-12-02
category: Photography
\---
%article
%h1 Hello World
%p Denver, Colorado :: December 2nd, 2015
%p Lore ipsum dolar
Je peux tirer vers le haut la page avec une URL directe, mais le poste n'enregistre pas:
- blog.articles[0...5].each do |article|
%article
%h2= link_to article.title, article.url
... et le frontmatter apparaît comme le texte brut en haut de la page.
Un grand merci pour votre temps.
MISE À JOUR!
config blog doit être:
activate :blog do |blog|
# set options on blog
blog.prefix = "journal"
blog.permalink = "{year}-{month}-{day}-{title}.html"
blog.sources = "{year}-{month}-{day}-{title}.html.haml"
blog.layout = "journal_layout"
end
et le fichier HAML article:
---
title: Hello World
date: 2015-12-02
category: Photography
---
%article
%h1 Hello World
%p Denver, Colorado :: December 2nd, 2015
%p Lore ipsum dolar
Merci Torbinsky! Cela a fonctionné parfaitement. – user1515340