-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
I'm in favor of nanoc, however I found that there are no offical tutorial on how to make a blog with nanoc. The tutorial which I found in Google is also 12 years old.
I'm a Ruby web developer and have used site generators before, but it still takes some trial and error to setup a blog. I think setting up a blog should be a very smooth experience.
I think provide a blog-oritend sample project git repo would be very helpful. I might provide one later.
Below are the changes that I have to make to make my first blog site running:
# Rules
compile '/**/*.html' do
filter :erb
....
compile '/**/*.md' do
filter :kramdown
layout '/default.*'
write item.identifier.without_ext + '.html'
end
# lib/default.rb
use_helper Nanoc::Helpers::Blogging
use_helper Nanoc::Helpers::LinkTo
# content/index.html
<% sorted_articles.each do |post| %>
<div class='post'>
<h1><%= link_to post[:title], post.path %></h1>
<aside>Posted at: <%= post[:created_at] %></aside>
<article>
<%= post.compiled_content %>
</article>
</div>
<% end %>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels