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 very appreciated.


回答1:


okay, I think I've solved it:

compile '/javascripts/*/' do
  nil
end

...

route '/javascripts/*/' do
    item.identifier.chop + ".js"
end

If anyone knows better solution, feel free to put it here.



来源:https://stackoverflow.com/questions/13882097/how-add-own-javascript-file-to-nanoc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!