diff --git a/Rules b/Rules index 13c479e..b0d6960 100644 --- a/Rules +++ b/Rules @@ -20,14 +20,14 @@ end compile '/assets/js/*' do filter :erb - filter :uglify_js if File.basename(item[:content_filename], ".*") == 'all' + :uglify_js if File.basename(item[:content_filename], ".*") == 'all' end compile '/content/*' do - if item.identifier == '/content/toc/' + if item.identifier.to_s == '/content/toc/' filter :kramdown layout 'blank' - elsif item.identifier == '/content/footer/' + elsif item.identifier.to_s == '/content/footer/' layout 'blank' elsif item[:extension] == 'md' filter :kramdown, {:input => 'GFM'} @@ -43,18 +43,18 @@ end route '/assets/css/*' do # if not debug mode, only let all.css through unless @config[:debug] - item.identifier.chop + '.css' if File.basename(item[:content_filename], ".*") == 'all' + item.identifier.to_s.chop + '.css' if File.basename(item[:content_filename], ".*") == 'all' else - item.identifier.chop + '.css' + item.identifier.to_s.chop + '.css' end end route '/assets/js/*' do # if not debug mode, only let all.js through unless @config[:debug] - item.identifier.chop + '.js' if File.basename(item[:content_filename], ".*") == 'all' + item.identifier.to_s.chop + '.js' if File.basename(item[:content_filename], ".*") == 'all' else - item.identifier.chop + '.js' + item.identifier.to_s.chop + '.js' end end @@ -62,10 +62,10 @@ end route '/content/*' do if item.binary? # Write item with identifier /foo/ to /foo.ext - item.identifier.sub("/content", "").chop + '.' + item[:extension] + item.identifier.to_s.sub("/content", "").chop + '.' + item[:extension] else # Write item with identifier /foo/ to /foo/index.html - item.identifier.sub("/content", "") + 'index.html' + item.identifier.to_s.sub("/content", "") + 'index.html' end end diff --git a/nanoc.yaml b/nanoc.yaml index adb6bb3..d614d61 100644 --- a/nanoc.yaml +++ b/nanoc.yaml @@ -29,6 +29,8 @@ prune: # .git, .svn etc. exclude: [ '.git', '.hg', '.svn', 'CVS' ] +string_pattern_type: legacy + # The data sources where nanoc loads its data from. This is an array of # hashes; each array element represents a single data source. By default, # there is only a single data source that reads data from the “content/” and @@ -38,6 +40,8 @@ data_sources: # The type is the identifier of the data source. By default, this will be # `filesystem_unified`. type: filesystem_unified + identifier_type: legacy + encoding: utf-c8 # The path where items should be mounted (comparable to mount points in # Unix-like systems). This is “/” by default, meaning that items will have diff --git a/wercker.yml b/wercker.yml index 1b01e2d..0eb1e2d 100644 --- a/wercker.yml +++ b/wercker.yml @@ -1,13 +1,14 @@ -box: flaviut/nim-by-example-build-vm@0.0.7 +box: flaviut/nim-by-example-build-vm:0.1.2 build: steps: - script: name: build code: | - source /home/ubuntu/.rvm/scripts/rvm + source /usr/local/rvm/scripts/rvm git remote add publish 'git@github.com:nim-by-example/nim-by-example.github.io.git' git config --global user.email 'nim-by-example.github.io' git config --global user.name 'Builder' + git config --global push.default simple git checkout master nanoc cp -r ./output/. ./ @@ -16,11 +17,15 @@ build: git commit -am'Build Site' deploy: steps: + - script: + name: ssh-keys + code: | + mkdir -p ~/.ssh/ + echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' > ~/.ssh/known_hosts + echo -e "$GIT_CREDENTIALS" > ~/.ssh/id_rsa + chmod 0600 ~/.ssh/id_rsa + chmod 0644 ~/.ssh/known_hosts - script: name: deploy code: | - mkdir ~/.ssh/ - echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' > ~/.ssh/known_hosts - echo "$GIT_CREDENTIALS" > ~/.ssh/id_rsa - chmod 0600 ~/.ssh/id_rsa git push --force publish