mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
✨ Added snippets feature to editor
no issue Snippets are pieces of saved content that are given a name and made available for easy and quick insertion when editing posts or pages. They can contain rich text, cards, or a combination of both making it faster and less error-prone to re-use pieces of content across multiple posts. Snippet length is not constrained meaning they can also stand in as post type templates alleviating the need to keep drafts around as templates and copy/pasting each time they are used. Feature changes: - added "create snippet" icon to selection and card toolbars - added "Snippets" section to the plus and slash menus - for the slash menu, continuing to type after opening the menu will filter by snippet name - all saved snippets are available to all staff users - snippets can be deleted by clicking the trash can icon when hovering the mouse over a snippet entry in the plus or slash menus - creation/deletion of snippets is available to staff users with the owner, admin, or editor role This commit: - removed developer experiments guard around snippet UI
This commit is contained in:
parent
581b195e12
commit
1e639c2504
@ -38,7 +38,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
{{#if (and this.saveAsSnippet (enable-developer-experiments))}}
|
{{#if this.saveAsSnippet}}
|
||||||
{{#if this.toolbar.items}}
|
{{#if this.toolbar.items}}
|
||||||
<li class="ma0 lh-solid kg-action-bar-divider bg-darkgrey-l2 h5" role="separator"></li>
|
<li class="ma0 lh-solid kg-action-bar-divider bg-darkgrey-l2 h5" role="separator"></li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -44,8 +44,7 @@ export default Component.extend({
|
|||||||
let snippetsSection = {
|
let snippetsSection = {
|
||||||
title: 'Snippets',
|
title: 'Snippets',
|
||||||
items: [],
|
items: [],
|
||||||
rowLength: 1,
|
rowLength: 1
|
||||||
developerExperiment: true
|
|
||||||
};
|
};
|
||||||
|
|
||||||
snippets.forEach((snippet) => {
|
snippets.forEach((snippet) => {
|
||||||
|
@ -63,8 +63,7 @@ export default class KoenigSlashMenuComponent extends Component {
|
|||||||
let snippetsSection = {
|
let snippetsSection = {
|
||||||
title: 'Snippets',
|
title: 'Snippets',
|
||||||
items: [],
|
items: [],
|
||||||
rowLength: 1,
|
rowLength: 1
|
||||||
developerExperiment: true
|
|
||||||
};
|
};
|
||||||
|
|
||||||
snippets.forEach((snippet) => {
|
snippets.forEach((snippet) => {
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{{#if (and @addSnippet (enable-developer-experiments))}}
|
{{#if @addSnippet}}
|
||||||
{{#unless this.basicOnly}}
|
{{#unless this.basicOnly}}
|
||||||
<li class="ma0 lh-solid kg-action-bar-divider bg-darkgrey-l2 h5" role="separator"></li>
|
<li class="ma0 lh-solid kg-action-bar-divider bg-darkgrey-l2 h5" role="separator"></li>
|
||||||
<li class="ma0 lh-solid">
|
<li class="ma0 lh-solid">
|
||||||
|
Loading…
Reference in New Issue
Block a user