Open blissgrn opened 6 years ago
I would also find this very useful, since I would like to make my asset path relative to public/themes and not to /public as it is now by default.
Hi @sergiz
It's been a while and not sure I remember everything but if it can help you, here what I finaly did.
In each theme.json : { "name": "my-custom-theme-1", "extends": "my-parent-theme", "asset-path": "themes/my-custom-theme-1" }
I believe I did not change anything in the config/themes.php, which I found more convenient.
'themes_path' => null, [...] 'themes' => [],
Cheers.
@blissgrn unfortunately you can only configure the location for the views, but not for the assets. You are right that you can achieve a similar result by placing a json file inside the theme (views) folder
@blissgrn That's what I want to avoid (and I guess you did too, considering your original post). Currently there is no way to implicity have asset path set to something else than public/, so you have to define it manually for every theme. With a new configuration option that you proposed, we could avoid that (and avoid even having to make theme.json for every theme).
theme.json
is optional. You can just use the config/themes.php file to configure your themes. (This is IMO a better approach)
The json file was developed as a feature to make the themes portable between applications with no external configuration dependencies
I will not close this issue, because I think that it could be a good feature to add in the future
I know theme.json is optional, but if you don't want your themes assets building up in public/, then in it is de facto not optional anymore since you cannot globally define for all assets to be in for example public/themes/.
It is a pretty minor change to add default assets path configuration option (like we have for views), but it would make things much nicer (I guess I'm not the only one that likes to keep theme assets in a subdirectory, not directly in public/).
Is there an update regarding this?
Me too, same issue
Hi,
I'd like more information about this topic : https://github.com/igaster/laravel-theme/issues/38 Indeed, I'd like to have all my themes under public/themes folder Is it possible to configure something like this :
// VIEWS
'themes_path' => null,
// ASSETS
'assets_path' => 'themes'
Instead of having to configure the path for each themes:
'themes' => [
'main' => ['asset-path' => 'themes/main'],
'example1' => ['asset-path' => 'themes/example1'],
'example2' => ['asset-path' => 'themes/example2'],
];
Thank you :)