<%= render file: Rails.root+'/app/views/sites/blog_tyrnov/header.html',locals: { page:page, site:site}%>
<% post=[]%> <% if params[:section].blank? %> <% if params[:month].blank? %> <% Page.find_by(slug: 'blog', site_id: site.id).children.each do |section|%> <% Page.find_by(slug: section.slug, site_id: site.id).children.each do |item|%> <% post.push(item)%> <% end %> <% end %> <% else %> <% Page.find_by(slug: 'blog', site_id: site.id).children.each do |item|%> <% post.push(item)%> <% end %> <% end %> <% else %> <% Page.find_by(slug: params[:section], site_id: site.id).children.each do |item|%> <% post.push(item)%> <% end %> <% end %> <% post.each do |item|%>

<%=item.name%>

<%=raw truncate(item.preview, escape: false,length: 190) %>

Автор: <%=item.author%> <%=item.publish_at.strftime("%d.%m.%Y")%>
<% item.tags.each do |tag| %> <%= tag.name %> <% end %>
<%=raw truncate(item.body, escape: false,length: 250) %>
подробнее
<% end %>
<%= render file: Rails.root+'/app/views/sites/blog_tyrnov/footer.html',locals: { page:page, site:site}%>