Blog.new_article.template parsing into blog overview page

Hey So I am trying to work on my blog and having difficulty.

In my config.rb file I have this

activate :blog do |blog|

set options on blog

blog.prefix = “blog”
blog.permalink = “{title}.html”
blog.new_article_template = File.expand_path(’…/source/blog-template.erb’, FILE)
blog.layout = “article-layout”
end

and in my blog-template.erb I have this


title: <%= @title %>
date: <%= @date.strftime(’%F %R %Z’) %>
tags:
intro:

now I am not sure if this is correct. I want to add a introtext and have it output in my blog overview page

When I create a new article it goes and created it and shows


title: article-name
date: article-date
tags:
intro:

which is exactly what I want except how to I output intro???

in my overview page I have

<% blog.articles.each do |article| %>
<%= article.date.strftime(’%b %e %Y’) %>
<%= article.title %>

<%= article.intro %>


<% end %>

when I save this I get an error undefined method `intro’

I don’t get it I thought it should work since I created a new template and overriding the original…

Help

Hello @rachna
I have exactly the same issue :joy:

I think we need to dig on this

Maybe we need to create a custom method for accessing the data, but I am not sure

def attrs_to_frontmatter(page)
  page.attributes.slice('published_at', 'updated_at', 'slug', 'class_name', 'breadcrumb', 'created_at', 'title').tap do |frontmatter|
    frontmatter['status'] = page.status.name
    frontmatter['created_by'] = user_to_hash(page.created_by) unless page.created_by.nil?
    frontmatter['updated_by'] = user_to_hash(page.updated_by) unless page.updated_by.nil?
    frontmatter['category'] = 'meeting'
  end
end

Please also raise an issue or check the issues here