Giter Club home page Giter Club logo

Comments (9)

defunctzombie avatar defunctzombie commented on August 12, 2024

It is necessary because hbs uses layouts by default. If you don't want the layout feature, then you disable it with layout: false

from hbs.

stechz avatar stechz commented on August 12, 2024

Yep, I figured that out (see above). My question is: why does it use layouts by default?

from hbs.

defunctzombie avatar defunctzombie commented on August 12, 2024

Cause that is what I decided? I mean, it is arbitrary either way. I have found that most users generally want layouts by default, and those that don't know to turn it off.

from hbs.

stechz avatar stechz commented on August 12, 2024

Oh! I mean, if the file isn't there, perhaps we could assume that layout should be disabled?

from hbs.

donpark avatar donpark commented on August 12, 2024

Layout is an Express feature so it would be inappropriate to override at view engine level. I suggest filing an issue at Express project.

from hbs.

defunctzombie avatar defunctzombie commented on August 12, 2024

Actually, from what I understand, it is no longer an express feature as of 3.x It is left to the template engines to decide how or if they wish to do layout type things. For example, jade does it completely differently.

I am not against being silent about the lack of layout.hbs file and skipping when not available. However, if layout is specifically set to true, then I think the error should happen. Thoughts?

from hbs.

cfjedimaster avatar cfjedimaster commented on August 12, 2024

I'd vote for an throwing an error.

from hbs.

donpark avatar donpark commented on August 12, 2024

Ha. Looks like Express 3.0 changes are more extensive than I thought.

Re whether to throw error, I think a warning is more appropriate if layout value exists and is true.

More interesting situation is when layout.hbs exists and layout value doesn't exist. I think presence of layout.hbs file is equivalent to layout set to true. User can force hbs to ignore layout.hbs by setting layout to false. Question is whether to inform the user about this via info or warning.

from hbs.

stechz avatar stechz commented on August 12, 2024

+1 throwing an error for layout: true

from hbs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.