nanoc

Must include files in nanoc always be in the layouts folder?

自古美人都是妖i 提交于 2019-12-24 04:16:07
问题 We would like to use server side includes (SSI) in the content of our nanoc site. This would allow us to chunk shared information and include it in multiple pages. It would also allow us to only maintain one source file of this shared information. I figured out how to add an SSI (partial) in nanoc. As you know in nanoc we have the following root level folders, among others: /content/ /layouts/ According to the instructions I found (https://nanoc.ws/doc/items-and-layouts/#partials), it seems

How can I get the nanoc SASS filter to use SCSS syntax?

帅比萌擦擦* 提交于 2019-12-22 03:19:14
问题 In my nanoc site, I want to specify my styles using SCSS: p { em { color: red; } } ... not SASS: p em color: red But if I try using SCSS, I get a compile error from the SASS filter. How do I get it to use SCSS? 回答1: This turned out to be quite simple: filter :sass, syntax: :scss Filters in nanoc seem to follow the pattern of taking any options they're given and passing them along to whatever object actually does the work. For instance, Nanoc::Filters::Sass does this in its run method: def run

Dump format error while compiling site

我们两清 提交于 2019-12-13 05:23:57
问题 When compiling my site in nanoc on the console, I'm receiving this error: ArgumentError: dump format error for symbol(0x20). Here's the full crash.log: http://pastebin.com/nrT0gwQh What's causing this error? 回答1: Removing tmp will clear the error. When I had the same issue, I realised that what I had done was a global find and replace on the entire nanoc directory, which changed a file in /tmp . This is what caused the error - changing contents of the tmp directory with a tool outside nanoc

Nanoc layout compile Rules

老子叫甜甜 提交于 2019-12-11 12:17:42
问题 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 doing wrong? 回答1: I haven't done exactly what you are but maybe something like this: compile '/' do rep.layout 'nosidebar' end 回答2: You can always add something like: compile '*' do if item.binary? # don’t filter binary items else layout item[:layout] ||

How add own javascript file to nanoc?

痞子三分冷 提交于 2019-12-10 13:13:44
问题 again I have a problem with files in nanoc. This time I wanted to attach custom file slide.js to my blog but I cannot (don't know why - probably something is wrong with my routes). Here's my routes: compile '/js/*/' do # don’t filter or layout end ... route '/js/*/' do /'js'/ + item.identifier.chop + '.js' end And in the head section of my layout I've put: %script{:type => "text/javascript", :src => "/js/slide.js"}/ (yes, it's a HAML). Can anyone help me to solve this problem? It would be

How to generate pages for each tag in nanoc

。_饼干妹妹 提交于 2019-12-10 01:58:27
问题 I am new to nanoc and I am still finding my around it. I am able to get my site ready, it looks good and functions good, too. But I need to have a tags area. I am able to achieve that with <%= tags_for(post, params = {:base_url => "http://example.com/tag/"}) %> But how do I generate pages for tag? So for instance there is a tag called "NFL", so every time a user clicks on it, he/she should be directed to http://example.com/tag/nfl with a list of articles that correspond with NFL. I can setup

How to generate pages for each tag in nanoc

六眼飞鱼酱① 提交于 2019-12-05 01:43:49
I am new to nanoc and I am still finding my around it. I am able to get my site ready, it looks good and functions good, too. But I need to have a tags area. I am able to achieve that with <%= tags_for(post, params = {:base_url => "http://example.com/tag/"}) %> But how do I generate pages for tag? So for instance there is a tag called "NFL", so every time a user clicks on it, he/she should be directed to http://example.com/tag/nfl with a list of articles that correspond with NFL. I can setup a layout which will do that. But then what kind of logic should be I using? And also do I need to have

How can I get the nanoc SASS filter to use SCSS syntax?

无人久伴 提交于 2019-12-05 00:14:42
In my nanoc site, I want to specify my styles using SCSS: p { em { color: red; } } ... not SASS: p em color: red But if I try using SCSS, I get a compile error from the SASS filter. How do I get it to use SCSS? This turned out to be quite simple: filter :sass, syntax: :scss Filters in nanoc seem to follow the pattern of taking any options they're given and passing them along to whatever object actually does the work. For instance, Nanoc::Filters::Sass does this in its run method: def run(content, params={}) options = params.dup # supply default options, etc... engine = ::Sass::Engine.new

Nanoc changing the base path when deploying page in github

泄露秘密 提交于 2019-11-30 20:01:12
问题 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 /css/style.css instead of being /docs/css/style.css Everything works well on localhost but fails when published. i am using rake publish to push it to gh-pages. Here is my Rakefile require 'nanoc3/tasks' BASE_URL = "http://darko1002001.github.com/docs/" desc