Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sommerregen committed Oct 9, 2015
2 parents c0e1f6b + de42b49 commit 50cc1d3
Show file tree
Hide file tree
Showing 22 changed files with 1,768 additions and 715 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
assets/logo.svg
*.xcf
.idea
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# v1.2.0
## 10/09/2015

1. [](#new)
* Added support for Shortcode filter methods
2. [](#improved)
* Assets from shortcode `{{% assets %}}` are now being cached with page contents
* Added blueprints for Grav Admin plugin
* Use `fieldset` fields to group shortcode options **(requires Grav 0.9.44+)**
3. [](#bugfix)
* Fixed [#2](https://github.com/Sommerregen/grav-plugin-shortcodes/issues/2) (Not working with Grav's Admin Panel)

# v1.1.0
## 08/08/2015

Expand All @@ -19,7 +31,7 @@
* Improved error handling in Twig
3. [](#bugfix)
* Fixed indentation of source code
* Fixed error while trying to call a shortcodes directory instead of Shortcodes [#1](https://github.com/Sommerregen/grav-plugin-shortcodes/issues/1)
* Fixed [#1](https://github.com/Sommerregen/grav-plugin-shortcodes/issues/1) (Error while trying to call a shortcodes directory instead of Shortcodes)

# v1.0.0
## 06/23/2015
Expand Down
298 changes: 238 additions & 60 deletions blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Shortcodes"
version: 1.1.0
version: 1.2.0
description: "This plugin enables to use shortcodes (simple snippets) inside a document to be rendered by Grav."
icon: puzzle-piece
author:
Expand All @@ -16,84 +16,262 @@ form:
fields:
global:
type: section
title: "Global plugin configurations"
title: PLUGINS.SHORTCODES.GLOBAL_CONFIG
underline: 1

fields:
enabled:
type: toggle
label: "Plugin Status"
label: PLUGINS.SHORTCODES.PLUGIN_STATUS
highlight: 1
default: 0
options:
1: "Enabled"
0: "Disabled"
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool

default:
type: section
title: "Default configurations for special shortcodes"
title: PLUGINS.SHORTCODES.DEFAULT_CONFIG
underline: 1

fields:
shortcodes.assets.enabled:
type: toggle
label: "Activate <code>{{% assets %}}</code> shortcode"
default: 0
options:
1: "Yes"
0: "No"
validate:
type: bool
assets:
type: fieldset
collapsible: false
icon: list-alt
title: PLUGINS.SHORTCODES.ASSETS

shortcodes.comment.enabled:
type: toggle
label: "Activate <code>{{% comment %}}</code> shortcode"
default: 0
options:
1: "Yes"
0: "No"
validate:
type: bool
fields:
shortcodes.assets.enabled:
type: toggle
label: PLUGINS.SHORTCODES.ASSETS_ENABLED
default: 1
highlight: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool

shortcodes.embed.enabled:
type: toggle
label: "Activate <code>{{% embed %}}</code> shortcode"
default: 0
options:
1: "Yes"
0: "No"
validate:
type: bool
assets.options:
type: fieldset
title: PLUGINS.SHORTCODES.OPTIONS
collapsible: true
collapsed: true
icon: gear

shortcodes.markdown.enabled:
type: toggle
label: "Activate <code>{{% markdown %}}</code> shortcode"
default: 0
options:
1: "Yes"
0: "No"
validate:
type: bool
fields:
shortcodes.assets.options.type:
type: select
size: small
label: PLUGINS.SHORTCODES.ASSETS_OPTIONS.TYPE
default: css
options:
css: PLUGINS.SHORTCODES.ASSETS_OPTIONS.CSS
js: PLUGINS.SHORTCODES.ASSETS_OPTIONS.JS
validate:
type: string

shortcodes.summary.enabled:
type: toggle
label: "Activate <code>{{% summary %}}</code> shortcode"
default: 0
options:
1: "Yes"
0: "No"
validate:
type: bool
shortcodes.assets.options.inline:
type: toggle
label: PLUGINS.SHORTCODES.ASSETS_OPTIONS.INLINE
default: 0
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool

shortcodes.twig.enabled:
type: toggle
label: "Activate <code>{{% twig %}}</code> shortcode"
default: 0
options:
1: "Yes"
0: "No"
validate:
type: bool
shortcodes.assets.options.priority:
type: text
size: x-small
label: PLUGINS.SHORTCODES.ASSETS_OPTIONS.PRIORITY
help: PLUGINS.SHORTCODES.ASSETS_OPTIONS.PRIORITY_HELP
default: 10
validate:
type: int
min: 0
max: 65536

shortcodes.assets.options.pipeline:
type: toggle
label: PLUGINS.SHORTCODES.ASSETS_OPTIONS.PIPELINE
default: 0
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool

shortcodes.assets.options.load:
type: select
size: large
label: PLUGINS.SHORTCODES.ASSETS_OPTIONS.LOAD
help: PLUGINS.SHORTCODES.ASSETS_OPTIONS.LOAD_HELP
default: ""
options:
"": PLUGINS.SHORTCODES.ASSETS_OPTIONS.DEFAULT
async: PLUGINS.SHORTCODES.ASSETS_OPTIONS.ASYNC
defer: PLUGINS.SHORTCODES.ASSETS_OPTIONS.DEFER

comment:
type: fieldset
title: PLUGINS.SHORTCODES.COMMENT
collapsed: true
icon: comments

fields:
shortcodes.comment.enabled:
type: toggle
label: PLUGINS.SHORTCODES.COMMENT_ENABLED
default: 1
highlight: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool

embed:
type: fieldset
title: PLUGINS.SHORTCODES.EMBED
collapsible: true
collapsed: false
icon: trello

fields:
shortcodes.embed.enabled:
type: toggle
label: PLUGINS.SHORTCODES.EMBED_ENABLED
default: 1
highlight: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool

embed.options:
type: fieldset
title: PLUGINS.SHORTCODES.OPTIONS
collapsible: true
collapsed: true
icon: gear

fields:
shortcodes.embed.options.template:
type: text
size: medium
label: PLUGINS.SHORTCODES.EMBED_TEMPLATE
placeholder: "template"
validate:
type: string

markdown:
type: fieldset
title: PLUGINS.SHORTCODES.MARKDOWN
collapsible: false
icon: code

fields:
shortcodes.markdown.enabled:
type: toggle
label: PLUGINS.SHORTCODES.MARKDOWN_ENABLED
default: 1
highlight: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool

markdown.options:
type: fieldset
title: PLUGINS.SHORTCODES.OPTIONS
collapsible: true
collapsed: true
icon: gear

fields:
shortcodes.markdown.options.extra:
type: toggle
label: Markdown extra
help: PLUGIN_ADMIN.MARKDOWN_EXTRA_HELP
default: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool

shortcodes.markdown.options.auto_line_breaks:
type: toggle
label: PLUGIN_ADMIN.AUTO_LINE_BREAKS
help: PLUGIN_ADMIN.AUTO_LINE_BREAKS_HELP
default: 0
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool

shortcodes.markdown.options.auto_url_links:
type: toggle
label: PLUGIN_ADMIN.AUTO_URL_LINKS
help: PLUGIN_ADMIN.AUTO_URL_LINKS_HELP
default: 0
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool

shortcodes.markdown.options.escape_markup:
type: toggle
label: PLUGIN_ADMIN.ESCAPE_MARKUP
help: PLUGIN_ADMIN.ESCAPE_MARKUP_HELP
default: 0
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool

summary:
type: fieldset
title: PLUGINS.SHORTCODES.SUMMARY
collapsible: false
icon: align-justify

fields:
shortcodes.summary.enabled:
type: toggle
label: PLUGINS.SHORTCODES.SUMMARY_ENABLED
default: 1
highlight: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool

twig:
type: fieldset
title: PLUGINS.SHORTCODES.TWIG
collapsible: false
icon: leaf

fields:
shortcodes.twig.enabled:
type: toggle
label: PLUGINS.SHORTCODES.TWIG_ENABLED
default: 1
highlight: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool

6 changes: 3 additions & 3 deletions classes/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct($routes = [])
{
// Set routes for autoloading
if (!is_array($routes) || count($routes) == 0) {
$routes = [__NAMESPACE__ => __DIR__];
$routes = [__NAMESPACE__ . '\\' => __DIR__];
}

$this->route($routes);
Expand Down Expand Up @@ -89,14 +89,14 @@ public function autoload($class)
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'autoload'), false, $prepend);
spl_autoload_register([$this, 'autoload'], false, $prepend);
}

/**
* Unregisters this instance as an autoloader
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'autoload'));
spl_autoload_unregister([$this, 'autoload']);
}
}
2 changes: 1 addition & 1 deletion classes/BlockShortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class BlockShortcode extends Twig\GenericShortcode
* @param callable $callable Callable to call for the shortcode.
* @param array $options An array of shortcode options.
*/
public function __construct($name, $callable, array $options = array())
public function __construct($name, $callable, array $options = [])
{
parent::__construct($name, $callable, 'block', $options);
}
Expand Down
Loading

0 comments on commit 50cc1d3

Please sign in to comment.