Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs for default variables #59

Closed
jonschlinkert opened this issue Feb 19, 2013 · 7 comments
Closed

docs for default variables #59

jonschlinkert opened this issue Feb 19, 2013 · 7 comments
Assignees
Labels

Comments

@jonschlinkert
Copy link
Member

e.g.

page.title
site.name etc.

@ghost ghost assigned jonschlinkert Feb 19, 2013
@jonschlinkert
Copy link
Member Author

{{pages}}
{{page}}
{{ext}}
{{basename}}
{{filename}}

@doowb, any others?

@Arkkimaagi
Copy link
Contributor

{{assets}} maybe?

@jonschlinkert
Copy link
Member Author

good call lol, that was the most obvious one and of course I forgot it... thanks!

@Arkkimaagi
Copy link
Contributor

{{published}}
{{removeHbsWhitespace}}

This is a list I produced by printing options parameter from a helper to my console:

assets: '../..',
categories: [],
currentPage: [...],
data: undefined,
defaultLayout: [Function],
defaultLayoutName: 'default',
engine: 'handlebars',
ext: '',
helpers: 'src/__assemble/helpers/myHelpers.js',
layout: undefined,
layoutName: 'Default',
pageName: 'index.html',
pages: [...],
partials: {},
removeHbsWhitespace: true,
tags: [],
# all partial files that I had, example:
nav: {},
header: {},
# all data files that I had, example:
site: {...},
url: {...}

In the notation above I've replaced some inner data with ... and I have replaced my partials and data files with example code. There may be something that I've added in my environment, but I tried to clean those away.

This is the global scope I think, and as far as I know, currently it's available to the page aswell. Previously we have been talking about the contents of currentPage (that's going to be renamed to page as I heard). But isn't the global scope relevant for documentation also?

I'd prefer to see internal assemble variables under their own namespace as I have mentioned before. Things like removeHbsWhitespace should not pollute the global level. (I know, I added it myself, but I did not know of a better place for it.) Since all the data files and all the partials will populate the same level (as they should, for convenience within the templates), some less needed internal settings could be located to a more safer place. Something like assemble.removeHbsWhitespace or even assemble.engines.handlebars.removeExpressionWhitespace.

@Arkkimaagi
Copy link
Contributor

Oh, and of course we have the handlebars internals (..) and helpers from both assemble (100+ helpers) and handlebars(#with, #each, #if ...) that should be listed somewhere probably too.

Sure, they're not variables as such, but pollute the same namespace. (I think)

It would be a nice to have a good reference for all of these, so that new users would not have to dig trough all of them places for the information.

@jonschlinkert
Copy link
Member Author

@Arkkimaagi I created this issue so I wouldn't forget to do it, but you got to it before I did! thanks for doing this.

this issue is just focused on getting a list of the variables together for the documentation, but we already started an issues to address the points you're making, so let's punt this discussion over there: #126

isn't the global scope relevant for documentation also?

You and I are on the same page, the helpers need to be addressed in the docs as well (I've already started). I'm going to create an issue for that just to get it started.

We'll make sure all of this gets documented. I have a lot of documentation that I'm trying to get organized so I can push it up, thanks for being patient.

@jonschlinkert
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants