1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-03 04:47:07 +01:00

Merge pull request #191 from ryneeverett/theme-helpers

Register handlebars helpers in themes. Fix #158.
This commit is contained in:
hacksalot
2018-01-27 17:44:36 -05:00
committed by GitHub
4 changed files with 21 additions and 4 deletions

View File

@ -115,8 +115,12 @@ _load = (formatsHash) ->
# Found a CSS file without an HTML file in a theme that inherits
# from another theme. This is the override CSS file.
that.overrides = { file: cssf.path, data: cssf.data }
formatsHash
# Now, save all the javascript file paths to a theme property.
jsFiles = fmts.filter (fmt) -> fmt and (fmt.ext == 'js')
@.jsFiles = jsFiles.map (jsf) -> jsf['path']
formatsHash
### Load a single theme file. ###

View File

@ -30,7 +30,9 @@ module.exports = ( theme, opts ) ->
func.apply @, args
hVal
, @
HANDLEBARS.registerHelper wrappedHelpers
HANDLEBARS.registerHelper blockHelpers
for themeHelpers in theme.jsFiles
HANDLEBARS.registerHelper require themeHelpers
return