Questions tagged [nanoc]

nanoc is a static site generator, fit for building anything from a small personal blog to a large corporate web site.

nanoc is a static site generator written in Ruby, fit for building anything from a small personal blog to a large corporate web site.

Notable sites using it

96 questions
3
votes
2 answers

nanoc: How can I pass options to pandoc-ruby?

I'm trying to use nanoc 3.5.0 with the pandoc filter that uses pandoc-ruby. Specifically, I'm not able to pass several options from my Rules file such that the final call to PandocRuby.convert() looks like this: PandocRuby.convert(content, …
caracal
  • 2,690
  • 19
  • 22
3
votes
1 answer

undefined method `[]' for nil:NilClass when trying to display metadata in nanoc

(Ruby noob) I'm using nanoc to generate a site. Here is my sample page with metadata: --- title: abc parameters: abc: def ghi: ijk --- test I know that I can have parameters one level up but I want to access them in layout file: <%=…
keepkimi
  • 373
  • 3
  • 12
3
votes
2 answers

PHP code filter in Nanoc's HAML code

I wanted to make a contact form at my nanoc site and I need to put some php code in my .haml file - is there any way (filter maybe?) to easily achieve that or I have to save whole page as a .php (and with stantard html syntax instead of haml…
lukaszkups
  • 5,790
  • 9
  • 47
  • 85
3
votes
1 answer

Encoding error with Japanese text using nanoc

I'm having trouble getting Japanese text to display properly on a website compiled using nanoc. I have the following markup in an HTML file, which is not going through any filters or layouts upon compilation:
Geoffrey Litt
  • 160
  • 1
  • 8
2
votes
2 answers

How do I pass an extension to the Redcarpet Nanoc filter

I'm trying to filter content in Nanoc 3 using their :redcarpet filter. My code looks like the following (from the Rules file): compile '/posts/*/' do filter :redcarpet layout 'default' end I want to pass the option :fenced_code_blocks to…
Clueless
  • 3,984
  • 1
  • 20
  • 27
2
votes
1 answer

Creating Items for an specific section

I'm building a website with nanoc. I have my main index file and now I want to add a article section with some articles I've written. So I use: nanoc create_item articles to create this new section, but how do I create new items within this item I…
eliocs
  • 18,511
  • 7
  • 40
  • 52
2
votes
1 answer

How to stop nanoc from skipping content pages

So I've set up a nanoc site and everything is going well, the only problem is that there is some data in a lib that changes on nearly every compile. When I type nanoc compile Nanoc skips recompiling the site because it thinks that the view has not…
zachaysan
  • 1,726
  • 16
  • 32
2
votes
2 answers

Nanoc layout compile Rules

I'm working with nanoc and I want my index.html to point to specific layout so I created that layout and it is called nosidebar.html My Rules looks like: compile 'index.html' do layout 'nosidebar' end and this doesn't seem to work. What am I…
Noah Clark
  • 8,101
  • 14
  • 74
  • 116
2
votes
0 answers

how to create global nanoc variable between preprocessor and rule

I create variable @foo in preprocessor block. It is global for the time of preprocessing, i.e. different methods can access it. However, in compilation time, i.e. in Rules, this variable is not available. Currently, I use @config map to store such…
igr
  • 10,199
  • 13
  • 65
  • 111
2
votes
1 answer

Does nanoc support nested partials?

I am using partials in nanoc, and I was wondering if it's possible to nest partials in nanoc. In other words, can I have a partial within a partial? When I tested this, the site compiled, but the nested partial did not display. I'm using the…
Sue Y
  • 51
  • 2
2
votes
1 answer

Could not find the required 'adsf' gem, which is necessary for the view command

I was recently working on a project in nanoc and installed bundler so I could use guard to watch the project directory. Now when I run nanoc view the webserver doesn't start up displaying the following error instead: $ nanoc view Could not find the…
leeand00
  • 25,510
  • 39
  • 140
  • 297
2
votes
1 answer

nanoc: problems testing a compile rule by item name or identifier

I use the following tests in a nanoc rule for compiling various kinds of content (including partials) in multiple directories by matching them with their identically-named layouts. Now I've added index files to each content dir, but these need the…
Dave Everitt
  • 17,193
  • 6
  • 67
  • 97
2
votes
1 answer

Nanoc long compile time

I'm using nanoc to generate documentation for my project. I have several files (~50) and layouts already created but currently I'm working on a single file. Strange thing is that it compiles this one file in less than second and than working on…
keepkimi
  • 373
  • 3
  • 12
2
votes
1 answer

Nanoc changing the base path when deploying page in github

I have a simple static page app that i have built with nanoc and i want to deploy it as a github page. Everything goes well except that the assets (like css, javascripts) and all the links in general point to the root of the repo: like…
DArkO
  • 15,880
  • 12
  • 60
  • 88
2
votes
1 answer

How can I get Nanoc to compile the same item in more than one way?

I want to have Nanoc compile a single item in multiple formats - specifically, compile a Markdown file to both HTML and PDF. As far as I know, a single item can only match a single compilation rule. A hard link (ln somefile.md newfile.md) allows me…
Nathan Long
  • 122,748
  • 97
  • 336
  • 451