Skip to content
This repository

When docpad not found layout, docpad print layout's name it looking for. #173

Merged
merged 1 commit into from over 2 years ago

2 participants

Changwoo Park Benjamin Arthur Lupton
Changwoo Park

If I have no layout required, I cannot know what layout I need.
so I make docpad print layout'name it looking for. For example:

Could not find the layout: undefined => Could not find the layout: my-layout

Changwoo Park pismute When docpad not found layout, docpad print layout's name it looking for.
If I have no layout required, I cannot know what layout I need.
so I make docpad print layout'name it looking for

 `Could not find the layout: undefined` => `Could not find the layout: my-layout`
4ba8680
Benjamin Arthur Lupton balupton merged commit aaa0acf into from
Benjamin Arthur Lupton balupton closed this
Benjamin Arthur Lupton
Owner

Just released as 4.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 09, 2012
Changwoo Park pismute When docpad not found layout, docpad print layout's name it looking for.
If I have no layout required, I cannot know what layout I need.
so I make docpad print layout'name it looking for

 `Could not find the layout: undefined` => `Could not find the layout: my-layout`
4ba8680
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. +4 4 lib/models/file.coffee
8 lib/models/file.coffee
@@ -484,21 +484,21 @@ class FileModel extends EventSystem
484 484 # next(err,layout)
485 485 getLayout: (next) ->
486 486 # Prepare
487   - layout = @layout
  487 + layoutName = @layout
488 488
489 489 # Check
490   - unless layout
  490 + unless layoutName
491 491 return next?(
492 492 new Error('This document does not have a layout')
493 493 )
494 494
495 495 # Find parent
496   - @layouts.findOne {relativeBase:layout}, (err,layout) ->
  496 + @layouts.findOne {relativeBase:layoutName}, (err,layout) ->
497 497 # Check
498 498 if err
499 499 return next?(err)
500 500 else if not layout
501   - err = new Error "Could not find the layout: #{layout}"
  501 + err = new Error "Could not find the layout: #{layoutName}"
502 502 return next?(err)
503 503 else
504 504 return next?(null, layout)

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.