Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a blog-oritend tutorial / sample git repo / template #296

Open
chengguangnan opened this issue Jul 7, 2024 · 0 comments
Open

Need a blog-oritend tutorial / sample git repo / template #296

chengguangnan opened this issue Jul 7, 2024 · 0 comments

Comments

@chengguangnan
Copy link

chengguangnan commented Jul 7, 2024

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 %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant