mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 16:14:25 +03:00
Added package.js support for themes (and plugins)
Closes #2081 * Amended require-tree to populate availableThemes and availablePlugins to use full file names (`basename.ext`) as keys instead of just basename. This way `image.jpg`, `image.png`, `image.gif` won't overwrite the `image` key. * Amended require-tree to allow package.json file parsing to return the contents of the file as json on the `package.json` key. * settings api populates theme data `package` if it exists. Otherwise it assigns `false` to it * `general.hbs` (salute) was reworked to if there is the package key on the theme is not false, it will use the `name` and `version` keys of that. You can break it by not having a `name` or `version` in the package.json file. * Added error and warning messages for package.json file parse errors and misses
This commit is contained in:
parent
ed4a330778
commit
fa70603332
@ -69,7 +69,8 @@
|
||||
<label for="activeTheme">Theme</label>
|
||||
<select id="activeTheme" name="general[activeTheme]">
|
||||
{{#each availableThemes}}
|
||||
<option value="{{name}}" {{#if active}}selected{{/if}}>{{name}}</option>
|
||||
<option value="{{name}}" {{#if active}}selected{{/if}}>{{#if package}}{{package.name}} - {{package.version}}{{else}}{{name}}{{/if}}</option>
|
||||
{{#unless package}}<script>console.log('Hi! The theme named "{{name}}" does not have a package.json file or it\' malformed. This will be required in the future. For more info, see http://docs.ghost.org/themes/.');</script>{{/unless}}
|
||||
{{/each}}
|
||||
</select>
|
||||
<p>Select a theme for your blog</p>
|
||||
|
Loading…
Reference in New Issue
Block a user