Core: Allow template extension customization

Created on 5 Apr 2016  路  5Comments  路  Source: adonisjs/core

It would be nice if we could change the file extension used for templates.
Even better if Adonis used something specific instead of html by default.

Having them as HTML messes with the formatting in some editors, like WebStorm.
With a custom extension, we could at least fix this ourselves and not affect the settings for real html.

Most helpful comment

Will add support for .nunjucks.

All 5 comments

Will add support for .nunjucks.

Is there a way to allow the use of .html still? My editor provides a lot of help if it uses the .html extension :)

I tried: extensions: ['html'] in config/app.js but they didn't seem to help.

This is why I said a customizable extension would be better, instead of just being limited to one or the other...

I did just have a look in the source based on the commits above. Not quite sure how to get the Config in the View/loader.js. Was thinking of being able to specify the view extension in the config/app.js. On adonis new it would default to extension: 'nunjucks' but you can change this to whatever you want.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seanc picture seanc  路  4Comments

itsg2jakhmola picture itsg2jakhmola  路  3Comments

PC-HUB picture PC-HUB  路  4Comments

douglaszaltron picture douglaszaltron  路  3Comments

imperez picture imperez  路  4Comments