Skip to content
nanoc code and content for my site https://npras.in
HTML Ruby CSS JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
content
layouts
lib
.gitignore
.hgignore
.ruby-version
Gemfile
Gemfile.lock
Guardfile
README.md
Rules
nanoc.yaml

README.md

README

Commands

To start local server, run bundle exec nanoc live.

Publish and deploy

bundle exec nanoc
bundle exec nanoc deploy

or

be nanoc && be nanoc deploy

Console

To debug, sometimes you might have to jump to the loaded irb console with bundle exec nanoc shell.

There, you can access all items with the variable items. The 'primary keyfor each item seems to beidentifier`.

Here's an example of how to get a specific item if you know its identifier.

item = items.find {|i| i.identifier == "/general/2019-05-26-aliens.md"}
item = items.find {|i| i.identifier == "/books/2017-04-16-Hpmor.md"}

To distinguish between a blog post and a normal page, you could check for the absence of the item[:kind] attribute. For blog articles, it's value is article.

You can’t perform that action at this time.