Permalink
Browse files

Fix asset path for extra files in subdirectories. (Fixes #40)

  • Loading branch information...
1 parent 9500879 commit 2a3fe10293c61d59e2e01874a4520a2a1c933a98 @netzpirat netzpirat committed Apr 17, 2012
Showing with 16 additions and 3 deletions.
  1. +5 −0 CHANGELOG.md
  2. +7 −2 lib/generator.js
  3. +4 −1 src/generator.coffee
View
@@ -1,3 +1,7 @@
+# Master
+
+- [#40](https://github.com/netzpirat/codo/issues/40): Fix asset path for extra files in subdirectories. ([@ryan-roemer][])
+
# Version 0.6.2 - April 4, 2012
- Don't not show the empty tab search window on start in Firefox. ([@netzpirat][])
@@ -70,4 +74,5 @@
[@inossidabile]: https://github.com/inossidabile
[@mattijs]: https://github.com/mattijs
[@netzpirat]: https://github.com/netzpirat
+[@ryan-roemer]: https://github.com/ryan-roemer
[@Squeegy]: https://github.com/Squeegy
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -127,10 +127,13 @@ module.exports = class Generator
try
content = fs.readFileSync extra, 'utf-8'
content = marked content if /\.(markdown|md)$/.test extra
+ numSlashes = extra.split('/').length - 1
+ assetPath = ''
+ assetPath += '../' for slash in [0...numSlashes]
filename = "#{ extra }.html"
@templater.render 'file', {
- path: ''
+ path: assetPath
filename: extra,
content: content
breadcrumbs: [

0 comments on commit 2a3fe10

Please sign in to comment.