{% extends '_layouts/cp' %} {% import "_includes/forms" as forms %} {% from "blitz/_macros" import configWarning %} {% from "blitz/_macros" import configFieldWarning %} {% do view.registerAssetBundle("putyourlightson\\blitz\\assets\\BlitzAsset") %} {% set crumbs = [ { label: 'Settings'|t('app'), url: url('settings') }, { label: 'Plugins'|t('app'), url: url('settings/plugins') } ] %} {% set title = 'Blitz' %} {% set tabs = { general: {label: 'General Settings'|t('blitz'), url: '#general'}, storage: {label: 'Cache Storage'|t('blitz'), url: '#storage'}, warming: {label: 'Cache Warming'|t('blitz'), url: '#warming'}, purging: {label: 'Reverse Proxy Purging'|t('blitz'), url: '#purging'}, deployment: {label: 'Remote Deployment'|t('blitz'), url: '#deployment'}, advanced: {label: 'Advanced Settings'|t('blitz'), url: '#advanced'}, } %} {% set fullPageForm = true %} {% set welcome = craft.app.request.getParam('welcome') %} {% set docs = 'https://putyourlightson.com/plugins/blitz#' %} {% block actionButton %} {% endblock %} {% block content %}
{% include 'blitz/_includes/welcome/top' %} {% if craft.blitz.getWebAliasExists() %}

{{ "One or more sites use `@web` in their base URL. The `@web` alias is not recommended if it is determined automatically."|t('blitz')|md(inlineOnly=true) }}

{% endif %}
{% include 'blitz/_includes/welcome/step' with {step: 1, text: 'Enable caching'} %}
{% set info %} {{ 'With this setting enabled, Blitz will begin caching pages according to the included/excluded URI patterns. Disabling this setting will prevent Blitz from caching any new pages.'|t('blitz') }} {% endset %} {{ forms.lightswitchField({ label: "Caching Enabled"|t('blitz'), instructions: "Whether caching should be enabled."|t('blitz') ~ info, warning: config.cachingEnabled is defined ? configWarning('cachingEnabled'), name: 'settings[cachingEnabled]', on: settings.cachingEnabled, required: true, }) }}
{% include 'blitz/_includes/welcome/step' with {step: 2, text: 'Add at least one included URI pattern'} %}
{% set cols = [] %} {% if craft.app.getIsMultiSite() %} {% set allSiteOptions = [{value: '', label: 'All Sites'|t('blitz')}]|merge(siteOptions) %} {% set cols = cols|merge({ siteId: { type: 'select', heading: 'Site'|t('blitz'), options: allSiteOptions, thin: true, } }) %} {% endif %} {% set info -%} {% include 'blitz/_includes/uri-pattern-info' with {docs: docs} %} {%- endset %} {% set cols = cols|merge({ uriPattern: { type: 'singleline', heading: 'URI Pattern'|t('blitz'), placeholder: "Leave blank to match the homepage"|t('blitz'), code: true, info: info, } }) %} {% set info %} {{ 'Only URIs that match one or more included URI patterns will be cached.'|t('blitz') }} {% endset %} {{ forms.editableTableField({ label: "Included URI Patterns"|t('blitz'), instructions: "The URI patterns to include in caching."|t('blitz') ~ info, warning: (config.includedUriPatterns is defined ? configWarning('includedUriPatterns')), name: 'settings[includedUriPatterns]', id: 'includedUriPatterns', cols: cols, rows: settings.includedUriPatterns, addRowLabel: "Add a URI pattern"|t('blitz'), }) }} {% set info %} {{ 'URIs that match one or more excluded URI patterns will not be cached. Excluded URI patterns will override any matching included URI patterns.'|t('blitz') }} {% endset %} {{ forms.editableTableField({ label: "Exclude URI Patterns"|t('blitz'), instructions: "The URI patterns to exclude from caching."|t('blitz') ~ info, warning: (config.excludedUriPatterns is defined ? configWarning('excludedUriPatterns')), name: 'settings[excludedUriPatterns]', id: 'excludedUriPatterns', cols: cols, rows: settings.excludedUriPatterns, addRowLabel: "Add a URI pattern"|t('blitz'), }) }}
{% include 'blitz/_includes/welcome/bottom' with {docs: docs} %}
{% endblock %}