diff --git a/src/flextype/Support/Parsers/Markdown.php b/src/flextype/Support/Parsers/Markdown.php index 1c4714db..958651b5 100644 --- a/src/flextype/Support/Parsers/Markdown.php +++ b/src/flextype/Support/Parsers/Markdown.php @@ -55,9 +55,9 @@ final class Markdown protected function __construct() { $this->markdownFacade = new ParsedownExtra(); - $this->markdownFacade->setBreaksEnabled(flextype('registry')->get('flextype.settings.markdown.auto_line_breaks')); - $this->markdownFacade->setUrlsLinked(flextype('registry')->get('flextype.settings.markdown.auto_url_links')); - $this->markdownFacade->setMarkupEscaped(flextype('registry')->get('flextype.settings.markdown.escape_markup')); + $this->markdownFacade->setBreaksEnabled(flextype('registry')->get('flextype.settings.parsers.markdown.auto_line_breaks')); + $this->markdownFacade->setUrlsLinked(flextype('registry')->get('flextype.settings.parsers.markdown.auto_url_links')); + $this->markdownFacade->setMarkupEscaped(flextype('registry')->get('flextype.settings.parsers.markdown.escape_markup')); } /** diff --git a/src/flextype/Support/Parsers/Shortcodes/EntriesShortcode.php b/src/flextype/Support/Parsers/Shortcodes/EntriesShortcode.php index 709d4882..bb6e1ecf 100644 --- a/src/flextype/Support/Parsers/Shortcodes/EntriesShortcode.php +++ b/src/flextype/Support/Parsers/Shortcodes/EntriesShortcode.php @@ -10,7 +10,7 @@ declare(strict_types=1); use Thunder\Shortcode\Shortcode\ShortcodeInterface; // Shortcode: [entries_fetch id="entry-id" field="field-name" default="default-value"] -if (flextype('registry')->get('flextype.settings.shortcode.shortcodes.entries.enabled')) { +if (flextype('registry')->get('flextype.settings.parsers.shortcode.shortcodes.entries.enabled')) { flextype('parsers')->shortcode()->addHandler('entries_fetch', static function (ShortcodeInterface $s) { return arrays(flextype('entries')->fetch($s->getParameter('id')))->get($s->getParameter('field'), $s->getParameter('default')); }); diff --git a/src/flextype/Support/Parsers/Shortcodes/RawShortcode.php b/src/flextype/Support/Parsers/Shortcodes/RawShortcode.php index 8f79e72e..e521b350 100644 --- a/src/flextype/Support/Parsers/Shortcodes/RawShortcode.php +++ b/src/flextype/Support/Parsers/Shortcodes/RawShortcode.php @@ -12,7 +12,7 @@ use Thunder\Shortcode\Events; use Thunder\Shortcode\Shortcode\ShortcodeInterface; // Shortcode: [raw] -if (flextype('registry')->get('flextype.settings.shortcode.shortcodes.raw.enabled')) { +if (flextype('registry')->get('flextype.settings.parsers.shortcode.shortcodes.raw.enabled')) { flextype('parsers')->shortcode()->addHandler('raw', static function (ShortcodeInterface $s) { return $s->getContent(); }); diff --git a/src/flextype/Support/Parsers/Shortcodes/RegistryShortcode.php b/src/flextype/Support/Parsers/Shortcodes/RegistryShortcode.php index 0d4cc169..aa025f17 100644 --- a/src/flextype/Support/Parsers/Shortcodes/RegistryShortcode.php +++ b/src/flextype/Support/Parsers/Shortcodes/RegistryShortcode.php @@ -10,7 +10,7 @@ declare(strict_types=1); use Thunder\Shortcode\Shortcode\ShortcodeInterface; // Shortcode: [registry_get name="item-name" default="default-value"] -if (flextype('registry')->get('flextype.settings.shortcode.shortcodes.registry.enabled')) { +if (flextype('registry')->get('flextype.settings.parsers.shortcode.shortcodes.registry.enabled')) { flextype('parsers')->shortcode()->addHandler('registry_get', static function (ShortcodeInterface $s) { return flextype('registry')->get($s->getParameter('name'), $s->getParameter('default')); }); diff --git a/src/flextype/Support/Parsers/Shortcodes/UrlShortcode.php b/src/flextype/Support/Parsers/Shortcodes/UrlShortcode.php index 8f920d5a..887aeef2 100644 --- a/src/flextype/Support/Parsers/Shortcodes/UrlShortcode.php +++ b/src/flextype/Support/Parsers/Shortcodes/UrlShortcode.php @@ -11,7 +11,7 @@ use Slim\Http\Environment; use Slim\Http\Uri; // Shortcode: [url] -if (flextype('registry')->get('flextype.settings.shortcode.shortcodes.url.enabled')) { +if (flextype('registry')->get('flextype.settings.parsers.shortcode.shortcodes.url.enabled')) { flextype('parsers')->shortcode()->addHandler('url', static function () { if (flextype('registry')->has('flextype.settings.url') && flextype('registry')->get('flextype.settings.url') !== '') { return flextype('registry')->get('flextype.settings.url'); diff --git a/src/flextype/bootstrap.php b/src/flextype/bootstrap.php index 0116082c..61c0d870 100755 --- a/src/flextype/bootstrap.php +++ b/src/flextype/bootstrap.php @@ -134,9 +134,9 @@ if (in_array(flextype('registry')->get('flextype.settings.timezone'), DateTimeZo /** * Init shortocodes * - * Load Flextype Shortcodes from directory /flextype/Support/Parsers/Shortcodes/ based on flextype.settings.shortcode.shortcodes array + * Load Flextype Shortcodes from directory /flextype/Support/Parsers/Shortcodes/ based on flextype.settings.parsers.shortcode.shortcodes array */ -$shortcodes = flextype('registry')->get('flextype.settings.shortcode.shortcodes'); +$shortcodes = flextype('registry')->get('flextype.settings.parsers.shortcode.shortcodes'); foreach ($shortcodes as $shortcodeName => $shortcode) { $shortcodeFilePath = ROOT_DIR . '/src/flextype/Support/Parsers/Shortcodes/' . str_replace('_', '', ucwords($shortcodeName, '_')) . 'Shortcode.php'; diff --git a/src/flextype/settings.yaml b/src/flextype/settings.yaml index 424e9734..13a94a3f 100644 --- a/src/flextype/settings.yaml +++ b/src/flextype/settings.yaml @@ -344,24 +344,25 @@ image: # - markdown.auto_line_breaks: Enable automatic line breaks # - markdown.auto_url_links: Enable automatic HTML links # - markdown.escape_markup: Escape markup tags into entities -markdown: - auto_line_breaks: false - auto_url_links: false - escape_markup: false - +# # Shortcode # # - shortcodes: Flextype Shortcodes to load. -shortcode: - shortcodes: - entries: - enabled: true - raw: - enabled: true - registry: - enabled: true - url: - enabled: true +parsers: + markdown: + auto_line_breaks: false + auto_url_links: false + escape_markup: false + shortcode: + shortcodes: + entries: + enabled: true + raw: + enabled: true + registry: + enabled: true + url: + enabled: true # CORS #