diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f5a23a1b7..36b5eae18 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: "tagged-release" +name: "release-notes" on: push: @@ -6,17 +6,14 @@ on: - "*" jobs: - tagged-release: - name: "Tagged Release" + release-notes: + name: "Regex Filtered Release Notes" runs-on: "ubuntu-latest" - steps: - - - name: "Build & test" - run: | - echo "done!" - - uses: "marvinpinto/action-automatic-releases@v1.2.0" + - uses: "marcantondahmen/release-notes-action@master" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" prerelease: false - draft: true \ No newline at end of file + draft: false + filter: "^(feat|fix)" + strict: true \ No newline at end of file diff --git a/automad/blocks/dist/blocks.min.css b/automad/blocks/dist/blocks.min.css index 6f1aac76b..fda34303c 100644 --- a/automad/blocks/dist/blocks.min.css +++ b/automad/blocks/dist/blocks.min.css @@ -26,7 +26,7 @@ * * AUTOMAD * - * version 1.7.4 + * version 1.7.5 * * Copyright (c) 2014-2021 by Marc Anton Dahmen * https://marcdahmen.de diff --git a/automad/blocks/dist/blocks.min.js b/automad/blocks/dist/blocks.min.js index 874c1eebb..664235fe5 100644 --- a/automad/blocks/dist/blocks.min.js +++ b/automad/blocks/dist/blocks.min.js @@ -26,7 +26,7 @@ * * AUTOMAD * - * version 1.7.4 + * version 1.7.5 * * Copyright (c) 2014-2021 by Marc Anton Dahmen * https://marcdahmen.de diff --git a/automad/blocks/pagelist.php b/automad/blocks/pagelist.php index a7182019a..154a6d5a6 100644 --- a/automad/blocks/pagelist.php +++ b/automad/blocks/pagelist.php @@ -70,6 +70,7 @@ public static function render($data, $Automad) { $defaults = array( 'type' => '', 'matchUrl' => '', + 'excludeHidden' => true, 'filter' => '', 'template' => '', 'excludeCurrent' => true, diff --git a/automad/core/sitemap.php b/automad/core/sitemap.php index 21a661684..7f2436a54 100644 --- a/automad/core/sitemap.php +++ b/automad/core/sitemap.php @@ -37,6 +37,7 @@ namespace Automad\Core; +use Automad\GUI\User as User; defined('AUTOMAD') or die('Direct access not permitted!'); @@ -60,13 +61,17 @@ class Sitemap { public function __construct($collection) { - $sitemap = AM_BASE_DIR . '/sitemap.xml'; - - // If the base dir is writable without having a sitemap.xml or if sitemap.xml exists and is writable itself. - if ((is_writable(AM_BASE_DIR) && !file_exists($sitemap)) || is_writable($sitemap)) { - $this->generate($collection, $sitemap); - } else { - Debug::log('Permissions denied!'); + if (!User::get()) { + + $sitemap = AM_BASE_DIR . '/sitemap.xml'; + + // If the base dir is writable without having a sitemap.xml or if sitemap.xml exists and is writable itself. + if ((is_writable(AM_BASE_DIR) && !file_exists($sitemap)) || is_writable($sitemap)) { + $this->generate($collection, $sitemap); + } else { + Debug::log('Permissions denied!'); + } + } } diff --git a/automad/gui/dist/automad.min.css b/automad/gui/dist/automad.min.css index d900a49e8..d45dcea6d 100644 --- a/automad/gui/dist/automad.min.css +++ b/automad/gui/dist/automad.min.css @@ -26,7 +26,7 @@ * * AUTOMAD * - * version 1.7.4 + * version 1.7.5 * * Copyright (c) 2014-2021 by Marc Anton Dahmen * https://marcdahmen.de diff --git a/automad/gui/dist/automad.min.js b/automad/gui/dist/automad.min.js index 2429e4010..370703e9a 100644 --- a/automad/gui/dist/automad.min.js +++ b/automad/gui/dist/automad.min.js @@ -26,7 +26,7 @@ * * AUTOMAD * - * version 1.7.4 + * version 1.7.5 * * Copyright (c) 2014-2021 by Marc Anton Dahmen * https://marcdahmen.de @@ -149,7 +149,7 @@ alignLeft:'', listUnordered:''}}} class AutomadEditorImageSelection{constructor(t,e){const i=t.replace(/\s/g,"").split(",");this.container=e,this.render(i)}render(t){const e=document.createElement("div"),i=document.createElement("div");t.forEach(t=>{e.appendChild(this.renderItem(t))}),e.classList.add("am-sortable"),i.classList.add("am-u-button"),i.innerHTML='  '+AutomadEditorTranslation.get("ui_add"),i.addEventListener("click",()=>{const t=this.renderItem(""),i=t.querySelector("input") -;e.appendChild(t),Automad.selectImage.dialog(!1,!0,t=>{i.value=t,i.dispatchEvent(new Event("keydown",{bubbles:!0}))})}),this.container.appendChild(e),this.container.appendChild(i),Sortable.create(e,{group:"automad",animation:200,draggable:".am-item",handle:".am-drag, figure",forceFallback:!0,ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag"})}renderItem(t){const e=Automad.util.create.element("div",["am-item"]) +;e.appendChild(t),Automad.selectImage.dialog(!1,!1,t=>{i.value=t,i.dispatchEvent(new Event("keydown",{bubbles:!0}))})}),this.container.appendChild(e),this.container.appendChild(i),Sortable.create(e,{group:"automad",animation:200,draggable:".am-item",handle:".am-drag, figure",forceFallback:!0,ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag"})}renderItem(t){const e=Automad.util.create.element("div",["am-item"]) ;return e.setAttribute("data-am-select-image-field",""), e.innerHTML=`\n\t\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t`, e.querySelector(".am-delete").addEventListener("click",()=>{e.remove()}),Automad.selectImage.preview(e.querySelector("input")),e}save(){const t=this.container.querySelectorAll("input"),e=[];return Array.from(t).forEach(t=>{const i=this.sanitize(t.value);i.length>0&&e.push(i)}),e.join(", ")}sanitize(t){return t.replace(/[^\w\-\/\:\?\=\&\+\*\.]/g,"")}}class AutomadInlineTool{static get isInline(){return!0}static get title(){}static get sanitize(){}get cls(){return{input:"am-inline-tool-input", @@ -255,14 +255,15 @@ this.inputs={to:a.editable(["cdx-input"],o("mail_placeholder_address"),this.data textButton:a.editable(["cdx-input"],"",this.data.textButton)};var n=document.createElement("div"),r=document.createElement("div");n.innerHTML=AutomadBlockMail.toolbox.icon,n.classList.add("am-block-icon"),r.innerHTML=AutomadBlockMail.toolbox.title,r.classList.add("am-block-title"),this.wrapper=document.createElement("div"),this.wrapper.classList.add("am-u-panel","am-u-panel-box"),this.wrapper.appendChild(n),this.wrapper.appendChild(r),this.wrapper.appendChild(document.createElement("hr")), this.wrapper.appendChild(a.label(o("mail_label_address"))),this.wrapper.appendChild(this.inputs.to),this.wrapper.appendChild(a.label(o("mail_label_success"))),this.wrapper.appendChild(this.inputs.success),this.wrapper.appendChild(a.label(o("mail_label_error"))),this.wrapper.appendChild(this.inputs.error),this.wrapper.appendChild(a.label(o("mail_label_placeholder_address"))),this.wrapper.appendChild(this.inputs.placeholderEmail), this.wrapper.appendChild(a.label(o("mail_label_placeholder_subject"))),this.wrapper.appendChild(this.inputs.placeholderSubject),this.wrapper.appendChild(a.label(o("mail_label_placeholder_message"))),this.wrapper.appendChild(this.inputs.placeholderMessage),this.wrapper.appendChild(a.label(o("mail_label_button"))),this.wrapper.appendChild(this.inputs.textButton)}render(){return this.wrapper}save(){var t=Automad.util.stripNbsp;return Object.assign(this.data,{to:t(this.inputs.to.innerHTML), -error:t(this.inputs.error.innerHTML),success:t(this.inputs.success.innerHTML),placeholderEmail:t(this.inputs.placeholderEmail.innerHTML),placeholderSubject:t(this.inputs.placeholderSubject.innerHTML),placeholderMessage:t(this.inputs.placeholderMessage.innerHTML),textButton:t(this.inputs.textButton.innerHTML)})}renderSettings(){return this.layoutSettings}}class AutomadBlockPagelist{static get isReadOnlySupported(){return!0}static get sanitize(){return{type:!1,matchUrl:!1,filter:!1,template:!1, -limit:!1,offset:!1,sortKey:!1,sortOrder:!1,file:!1}}static get toolbox(){return{title:AutomadEditorTranslation.get("pagelist_toolbox"), +error:t(this.inputs.error.innerHTML),success:t(this.inputs.success.innerHTML),placeholderEmail:t(this.inputs.placeholderEmail.innerHTML),placeholderSubject:t(this.inputs.placeholderSubject.innerHTML),placeholderMessage:t(this.inputs.placeholderMessage.innerHTML),textButton:t(this.inputs.textButton.innerHTML)})}renderSettings(){return this.layoutSettings}}class AutomadBlockPagelist{static get isReadOnlySupported(){return!0}static get sanitize(){return{type:!1,excludeHidden:!1,matchUrl:!1, +filter:!1,template:!1,limit:!1,offset:!1,sortKey:!1,sortOrder:!1,file:!1}}static get toolbox(){return{title:AutomadEditorTranslation.get("pagelist_toolbox"), icon:'' -}}constructor({data:t,api:e,config:i}){var a=Automad.util.create,o=AutomadEditorTranslation.get;this.api=e,this.data={type:t.type||"",matchUrl:t.matchUrl||"",filter:t.filter||"",template:t.template||"",limit:t.limit||3,offset:t.offset||0,sortKey:t.sortKey||":path",sortOrder:t.sortOrder||"asc",file:t.file||""},this.layoutSettings=AutomadLayout.renderSettings(this.data,t,e,i),this.wrapper=document.createElement("div"),this.wrapper.classList.add("am-u-panel","am-u-panel-box"), -this.wrapper.innerHTML=`\n\t\t\t
${AutomadBlockPagelist.toolbox.icon}
\n\t\t\t
${AutomadBlockPagelist.toolbox.title}
\n\t\t\t
\n\t\t\t`, -this.inputs={type:this.wrapper.querySelector(".am-block-type"),matchUrl:this.wrapper.querySelector(".am-block-match-url"),filter:this.wrapper.querySelector(".am-block-filter"),template:this.wrapper.querySelector(".am-block-template"),limit:this.wrapper.querySelector(".am-block-limit"),offset:this.wrapper.querySelector(".am-block-offset"),sortKey:this.wrapper.querySelector(".am-block-sort-key"),sortOrder:this.wrapper.querySelector(".am-block-sort-order"), -file:this.wrapper.querySelector(".am-block-file")}}render(){return this.wrapper}save(){var t=Automad.util.stripNbsp;return Object.assign(this.data,{type:this.inputs.type.value,matchUrl:t(this.inputs.matchUrl.innerHTML),filter:t(this.inputs.filter.innerHTML),template:t(this.inputs.template.innerHTML),limit:t(this.inputs.limit.innerHTML),offset:t(this.inputs.offset.innerHTML),sortKey:t(this.inputs.sortKey.innerHTML),sortOrder:this.inputs.sortOrder.value,file:this.inputs.file.value})} -renderSettings(){return this.layoutSettings}}class AutomadBlockParagraph{static get conversionConfig(){return{export:"text",import:"text"}}static get isReadOnlySupported(){return!0}static get pasteConfig(){return{tags:["P"]}}static get sanitize(){return{text:{br:!0}}}static get toolbox(){return{ +}}constructor({data:t,api:e,config:i}){var a=Automad.util.create,o=AutomadEditorTranslation.get;this.api=e,this.data={type:t.type||"",excludeHidden:void 0===t.excludeHidden||t.excludeHidden,matchUrl:t.matchUrl||"",filter:t.filter||"",template:t.template||"",limit:t.limit||3,offset:t.offset||0,sortKey:t.sortKey||":path",sortOrder:t.sortOrder||"asc",file:t.file||""},this.layoutSettings=AutomadLayout.renderSettings(this.data,t,e,i),this.wrapper=document.createElement("div"), +this.wrapper.classList.add("am-u-panel","am-u-panel-box"), +this.wrapper.innerHTML=`\n\t\t\t
${AutomadBlockPagelist.toolbox.icon}
\n\t\t\t
${AutomadBlockPagelist.toolbox.title}
\n\t\t\t
\n\t\t\t`, +this.inputs={type:this.wrapper.querySelector(".am-block-type"),excludeHidden:this.wrapper.querySelector(".am-block-exclude-hidden"),matchUrl:this.wrapper.querySelector(".am-block-match-url"),filter:this.wrapper.querySelector(".am-block-filter"),template:this.wrapper.querySelector(".am-block-template"),limit:this.wrapper.querySelector(".am-block-limit"),offset:this.wrapper.querySelector(".am-block-offset"),sortKey:this.wrapper.querySelector(".am-block-sort-key"), +sortOrder:this.wrapper.querySelector(".am-block-sort-order"),file:this.wrapper.querySelector(".am-block-file")}}render(){return this.wrapper}save(){var t=Automad.util.stripNbsp;return Object.assign(this.data,{type:this.inputs.type.value,excludeHidden:this.inputs.excludeHidden.checked,matchUrl:t(this.inputs.matchUrl.innerHTML),filter:t(this.inputs.filter.innerHTML),template:t(this.inputs.template.innerHTML),limit:t(this.inputs.limit.innerHTML),offset:t(this.inputs.offset.innerHTML), +sortKey:t(this.inputs.sortKey.innerHTML),sortOrder:this.inputs.sortOrder.value,file:this.inputs.file.value})}renderSettings(){return this.layoutSettings}}class AutomadBlockParagraph{static get conversionConfig(){return{export:"text",import:"text"}}static get isReadOnlySupported(){return!0}static get pasteConfig(){return{tags:["P"]}}static get sanitize(){return{text:{br:!0}}}static get toolbox(){return{ icon:'', title:AutomadEditorTranslation.get("paragraph_toolbox")}}constructor({data:t,api:e,config:i}){var a=void 0!==t.large&&t.large;this.api=e,this.placeholder=i.placeholder||"",this._CSS={block:this.api.styles.block,wrapper:"ce-paragraph",large:"am-paragraph-large"},this._data={},this.onKeyUp=this.onKeyUp.bind(this),this.input=this.drawView(a),this.data={text:t.text||"",large:a,alignment:t.alignment||"left"},this.setAlignment(this.input),this.layout={}, this.layoutSettings=AutomadLayout.renderSettings(this.layout,t,e,i)}onKeyUp(t){if("Backspace"!==t.code&&"Delete"!==t.code)return;const{textContent:e}=this.input;""===e&&(this.input.innerHTML="")}drawView(t){var e=Automad.util.create.editable([this._CSS.wrapper,this._CSS.block],"","");return t&&e.classList.add(this._CSS.large),this.placeholder&&(e.dataset.placeholder=this.placeholder),e.addEventListener("keyup",this.onKeyUp),e}render(){return this.input}merge(t){let e={text:this.data.text+t.text} diff --git a/automad/gui/js/editorjs/blocks/pagelist.js b/automad/gui/js/editorjs/blocks/pagelist.js index 17f2ec586..daac0364d 100644 --- a/automad/gui/js/editorjs/blocks/pagelist.js +++ b/automad/gui/js/editorjs/blocks/pagelist.js @@ -43,6 +43,7 @@ class AutomadBlockPagelist { static get sanitize() { return { type: false, + excludeHidden: false, matchUrl: false, filter: false, template: false, @@ -70,6 +71,7 @@ class AutomadBlockPagelist { this.data = { type: data.type || '', + excludeHidden: data.excludeHidden !== undefined ? data.excludeHidden : true, matchUrl: data.matchUrl || '', filter: data.filter || '', template: data.template || '', @@ -105,6 +107,21 @@ class AutomadBlockPagelist { ${create.label(t('pagelist_url_regex')).outerHTML} ${create.editable(['cdx-input', 'am-block-match-url'], 'work|blog', this.data.matchUrl).outerHTML} +
  • +
    + +
    +
  • ${create.label(t('pagelist_type')).outerHTML} ${create.select(['cdx-input', 'am-block-type'], ['all', 'children', 'related', 'siblings'], this.data.type).outerHTML} @@ -136,6 +153,7 @@ class AutomadBlockPagelist { this.inputs = { type: this.wrapper.querySelector('.am-block-type'), + excludeHidden: this.wrapper.querySelector('.am-block-exclude-hidden'), matchUrl: this.wrapper.querySelector('.am-block-match-url'), filter: this.wrapper.querySelector('.am-block-filter'), template: this.wrapper.querySelector('.am-block-template'), @@ -160,6 +178,7 @@ class AutomadBlockPagelist { return Object.assign(this.data, { type: this.inputs.type.value, + excludeHidden: this.inputs.excludeHidden.checked, matchUrl: stripNbsp(this.inputs.matchUrl.innerHTML), filter: stripNbsp(this.inputs.filter.innerHTML), template: stripNbsp(this.inputs.template.innerHTML), diff --git a/automad/gui/js/editorjs/image_selection.js b/automad/gui/js/editorjs/image_selection.js index cfb33fad3..02265176b 100644 --- a/automad/gui/js/editorjs/image_selection.js +++ b/automad/gui/js/editorjs/image_selection.js @@ -66,7 +66,7 @@ class AutomadEditorImageSelection { fields.appendChild(item); - Automad.selectImage.dialog(false, true, (value) => { + Automad.selectImage.dialog(false, false, (value) => { input.value = value; input.dispatchEvent(new Event('keydown', { bubbles: true })); }); diff --git a/automad/gui/lang/bosnian.txt b/automad/gui/lang/bosnian.txt index db73b7cc1..503d8a3c7 100644 --- a/automad/gui/lang/bosnian.txt +++ b/automad/gui/lang/bosnian.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Zadani predložak - +editor_pagelist_exclude_hidden: Isključite skrivene stranice + +- + editor_pagelist_url_regex: URL regularni izraz - diff --git a/automad/gui/lang/bulgarian.txt b/automad/gui/lang/bulgarian.txt index ebf6705e6..b352e2c28 100644 --- a/automad/gui/lang/bulgarian.txt +++ b/automad/gui/lang/bulgarian.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Шаблон по подразбиране - +editor_pagelist_exclude_hidden: Изключете скритите страници + +- + editor_pagelist_url_regex: Филтър за регулярни изрази на URL - diff --git a/automad/gui/lang/czech.txt b/automad/gui/lang/czech.txt index a42718fa5..8b8d99524 100644 --- a/automad/gui/lang/czech.txt +++ b/automad/gui/lang/czech.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Výchozí šablona - +editor_pagelist_exclude_hidden: Vyloučit skryté stránky + +- + editor_pagelist_url_regex: Filtr regulárních výrazů URL - diff --git a/automad/gui/lang/danish.txt b/automad/gui/lang/danish.txt index 40f1bf9b9..5a27b4b83 100644 --- a/automad/gui/lang/danish.txt +++ b/automad/gui/lang/danish.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Standardskabelon - +editor_pagelist_exclude_hidden: Ekskluder skjulte sider + +- + editor_pagelist_url_regex: URL Regex-filter - diff --git a/automad/gui/lang/dutch.txt b/automad/gui/lang/dutch.txt index 069ee02e7..9cc370183 100644 --- a/automad/gui/lang/dutch.txt +++ b/automad/gui/lang/dutch.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Standaardsjabloon - +editor_pagelist_exclude_hidden: Verborgen pagina's uitsluiten + +- + editor_pagelist_url_regex: URL Regex-filter - diff --git a/automad/gui/lang/english.txt b/automad/gui/lang/english.txt index 135ba5a47..54dc51ebc 100644 --- a/automad/gui/lang/english.txt +++ b/automad/gui/lang/english.txt @@ -530,6 +530,10 @@ editor_pagelist_default: Default Template - +editor_pagelist_exclude_hidden: Exclude Hidden Pages + +- + editor_pagelist_url_regex: URL Regex Filter - diff --git a/automad/gui/lang/estonian.txt b/automad/gui/lang/estonian.txt index abcc98513..d93b18b9e 100644 --- a/automad/gui/lang/estonian.txt +++ b/automad/gui/lang/estonian.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Vaikemall - +editor_pagelist_exclude_hidden: Välista peidetud leheküljed + +- + editor_pagelist_url_regex: URL-i regex-filter - diff --git a/automad/gui/lang/finnish.txt b/automad/gui/lang/finnish.txt index 172e950a1..abc56b026 100644 --- a/automad/gui/lang/finnish.txt +++ b/automad/gui/lang/finnish.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Oletusmalli - +editor_pagelist_exclude_hidden: Sulje piilotetut sivut + +- + editor_pagelist_url_regex: URL Regex -suodatin - diff --git a/automad/gui/lang/french.txt b/automad/gui/lang/french.txt index b1b71b549..c2b1bc15f 100644 --- a/automad/gui/lang/french.txt +++ b/automad/gui/lang/french.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Modèle par défaut - +editor_pagelist_exclude_hidden: Exclure les pages cachées + +- + editor_pagelist_url_regex: Filtre d'URL Regex - diff --git a/automad/gui/lang/german.txt b/automad/gui/lang/german.txt index 8f011ed42..b0704b306 100644 --- a/automad/gui/lang/german.txt +++ b/automad/gui/lang/german.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Standardvorlage - +editor_pagelist_exclude_hidden: Verborgene Seiten ausschließen + +- + editor_pagelist_url_regex: URL Regex Filter - diff --git a/automad/gui/lang/greek.txt b/automad/gui/lang/greek.txt index 6b7c7c9be..1511252c8 100644 --- a/automad/gui/lang/greek.txt +++ b/automad/gui/lang/greek.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Προεπιλεγμένο πρότυπο - +editor_pagelist_exclude_hidden: Αποκλείστε κρυμμένες σελίδες + +- + editor_pagelist_url_regex: Φίλτρο Regex URL - diff --git a/automad/gui/lang/icelandic.txt b/automad/gui/lang/icelandic.txt index eab7a2707..b3932abcd 100644 --- a/automad/gui/lang/icelandic.txt +++ b/automad/gui/lang/icelandic.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Sjálfgefið sniðmát - +editor_pagelist_exclude_hidden: Útiloka falinn síður + +- + editor_pagelist_url_regex: Vefslóð Regex sía - diff --git a/automad/gui/lang/irish.txt b/automad/gui/lang/irish.txt index 461dd3312..043be8dd7 100644 --- a/automad/gui/lang/irish.txt +++ b/automad/gui/lang/irish.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Teimpléad Réamhshocraithe - +editor_pagelist_exclude_hidden: Eisiamh na leathanaigh i bhfolach + +- + editor_pagelist_url_regex: Scagaire URL Regex - diff --git a/automad/gui/lang/italian.txt b/automad/gui/lang/italian.txt index 23f0b08e1..86bb126cd 100644 --- a/automad/gui/lang/italian.txt +++ b/automad/gui/lang/italian.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Modello predefinito - +editor_pagelist_exclude_hidden: Escludere pagine nascoste + +- + editor_pagelist_url_regex: Filtro URL Regex - diff --git a/automad/gui/lang/latvian.txt b/automad/gui/lang/latvian.txt index 532d1064c..6d61026db 100644 --- a/automad/gui/lang/latvian.txt +++ b/automad/gui/lang/latvian.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Noklusējuma veidne - +editor_pagelist_exclude_hidden: Izslēgt slēptās lapas + +- + editor_pagelist_url_regex: URL regex filtrs - diff --git a/automad/gui/lang/lithuanian.txt b/automad/gui/lang/lithuanian.txt index 7740e564e..783c0af89 100644 --- a/automad/gui/lang/lithuanian.txt +++ b/automad/gui/lang/lithuanian.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Numatytasis šablonas - +editor_pagelist_exclude_hidden: Išskirti paslėptus puslapius + +- + editor_pagelist_url_regex: URL reguliavimo filtras - diff --git a/automad/gui/lang/norwegian.txt b/automad/gui/lang/norwegian.txt index decf2f47a..c366dc69a 100644 --- a/automad/gui/lang/norwegian.txt +++ b/automad/gui/lang/norwegian.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Standard mal - +editor_pagelist_exclude_hidden: Utelukke skjulte sider + +- + editor_pagelist_url_regex: URL Regex-filter - diff --git a/automad/gui/lang/polish.txt b/automad/gui/lang/polish.txt index 38a2aeafc..0ddac27b9 100644 --- a/automad/gui/lang/polish.txt +++ b/automad/gui/lang/polish.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Domyślny szablon - +editor_pagelist_exclude_hidden: Wyklucz ukryte strony + +- + editor_pagelist_url_regex: URL Regex Filter - diff --git a/automad/gui/lang/portuguese.txt b/automad/gui/lang/portuguese.txt index 91e1bafb5..ed10b658c 100644 --- a/automad/gui/lang/portuguese.txt +++ b/automad/gui/lang/portuguese.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Modelo Padrão - +editor_pagelist_exclude_hidden: Excluir páginas escondidas + +- + editor_pagelist_url_regex: Filtro Regex de URL - diff --git a/automad/gui/lang/romanian.txt b/automad/gui/lang/romanian.txt index c6433dfae..c734726a1 100644 --- a/automad/gui/lang/romanian.txt +++ b/automad/gui/lang/romanian.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Șablon implicit - +editor_pagelist_exclude_hidden: Excludeți paginile ascunse + +- + editor_pagelist_url_regex: Filtru Regex URL - diff --git a/automad/gui/lang/russian.txt b/automad/gui/lang/russian.txt index e33af820d..7baeb2126 100644 --- a/automad/gui/lang/russian.txt +++ b/automad/gui/lang/russian.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Шаблон по умолчанию - +editor_pagelist_exclude_hidden: Исключить скрытые страницы + +- + editor_pagelist_url_regex: Фильтр регулярных выражений URL - diff --git a/automad/gui/lang/serbian.txt b/automad/gui/lang/serbian.txt index 54661473c..9241ec08f 100644 --- a/automad/gui/lang/serbian.txt +++ b/automad/gui/lang/serbian.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Подразумевани образац - +editor_pagelist_exclude_hidden: Искључите скривене странице + +- + editor_pagelist_url_regex: УРЛ регуларни израз - diff --git a/automad/gui/lang/slovak.txt b/automad/gui/lang/slovak.txt index 83f15b591..4d0d12286 100644 --- a/automad/gui/lang/slovak.txt +++ b/automad/gui/lang/slovak.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Predvolená šablóna - +editor_pagelist_exclude_hidden: Vylúčiť skryté stránky + +- + editor_pagelist_url_regex: Filter URL regulárneho výrazu - diff --git a/automad/gui/lang/slovenian.txt b/automad/gui/lang/slovenian.txt index 9f203f553..11d24c15d 100644 --- a/automad/gui/lang/slovenian.txt +++ b/automad/gui/lang/slovenian.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Privzeta predloga - +editor_pagelist_exclude_hidden: Izključite skrite strani + +- + editor_pagelist_url_regex: Filter regularnih izrazov URL - diff --git a/automad/gui/lang/spanish.txt b/automad/gui/lang/spanish.txt index 49ffb63e7..bafacb71a 100644 --- a/automad/gui/lang/spanish.txt +++ b/automad/gui/lang/spanish.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Plantilla predeterminada - +editor_pagelist_exclude_hidden: Excluir páginas ocultas + +- + editor_pagelist_url_regex: Filtro Regex de URL - diff --git a/automad/gui/lang/swedish.txt b/automad/gui/lang/swedish.txt index 851af1d5c..112bd9a1d 100644 --- a/automad/gui/lang/swedish.txt +++ b/automad/gui/lang/swedish.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Standardmall - +editor_pagelist_exclude_hidden: Utesluta dolda sidor + +- + editor_pagelist_url_regex: URL-regexfilter - diff --git a/automad/gui/lang/ukrainian.txt b/automad/gui/lang/ukrainian.txt index 7efdb325c..a156b500a 100644 --- a/automad/gui/lang/ukrainian.txt +++ b/automad/gui/lang/ukrainian.txt @@ -490,6 +490,10 @@ editor_pagelist_default: Шаблон за замовчуванням - +editor_pagelist_exclude_hidden: Виключити приховані сторінки + +- + editor_pagelist_url_regex: Фільтр регулярних виразів URL - diff --git a/automad/package-lock.json b/automad/package-lock.json index 56a1b7e37..23c70a0d3 100644 --- a/automad/package-lock.json +++ b/automad/package-lock.json @@ -1,6 +1,6 @@ { "name": "automad", - "version": "1.7.0", + "version": "1.7.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/automad/package.json b/automad/package.json index 7b7cfd7da..547a1ab45 100644 --- a/automad/package.json +++ b/automad/package.json @@ -1,6 +1,6 @@ { "name": "automad", - "version": "1.7.4", + "version": "1.7.5", "description": "Automad", "author": "Marc Anton Dahmen", "license": "MIT", diff --git a/automad/version.php b/automad/version.php index c1c0d6836..f4206e800 100644 --- a/automad/version.php +++ b/automad/version.php @@ -1 +1 @@ - + diff --git a/bin/README.md b/bin/README.md new file mode 100644 index 000000000..4c939f6e7 --- /dev/null +++ b/bin/README.md @@ -0,0 +1,65 @@ +# Bin + +There are some little scripts in this directory to keep the development workflow consistent by automating certain things such as releases, tests, and the handling of feature/bugfix/refactor branches. + +- [Features, Bugfixes and Refactor Branches](#features-bugfixes-and-refactor-branches) + - [Starting a Branch](#starting-a-branch) + - [Commiting on a Branch](#commiting-on-a-branch) + - [Excluding Commits from the Changelog](#excluding-commits-from-the-changelog) + - [Finishing a Branch](#finishing-a-branch) +- [Releases](#releases) +- [Tests](#tests) + +## Features, Bugfixes and Refactor Branches + +In case developing a feature/bugfix or refactoring is expected to be more complex than just a single commit, it should be done on a separate branch. + +### Starting a Branch + +To start a new feature/bugfix/refactor branch simply run the following command: + + bash bin/start.sh + +Follow the instructions by selecting a type, defining a scope and providing a name. The script will checkout the `develop` branch and then create and checkout a new branch following this naming scheme: + + feat/scope/feature_name + +### Commiting on a Branch + +Please note that GitHub releases are created when a tag is pushed to `origin`. The included changelog is generated out of all commit messages back to the previous release that start with either `feat` or `fix` and follow the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. + +#### Excluding Commits from the Changelog + +When a new *feature* or a *bugfix* is finished, the branch name is used to create a commit message for the merge that qualifies to be included into the changelog. Therefore all commits on that branch are **not** supposed to generate changelog entries. To exclude such commits, a message simply has to violate the requirements by not starting with `feat` or `fix` or not following the *conventional commits* specification. Merges of refactor branches are excluded from the changelog. + +### Finishing a Branch + +When finishing a *feature*, a *bugfix* or refactoring, the branch is merged back to the `develop` branch. Its name is used to generate the commit message following this pattern according to the example above: + + feat(scope): feature name + +After merging successfully, the branch is deleted locally and on the remote. + +## Releases + +When a new version is about to be finished, a sequence of tasks has to be completed in order to pusblish a release. This process is automated and can be started using the following command: + + bash bin/release.sh + +This will start the release process and initiates the following sequence of tasks: + +1. Kill all running *Gulp* (watch) tasks +2. Check whether the current branch is `develop` +3. Run unit tests +4. Bump version numbers by selection between a patch, minor or major version jump +5. Run build tasks for UI and themes (*Gulp*) +6. Commit dist files +7. Merge `develop` into `master` branch +8. Create tag +9. Push + +## Tests + +To make sure, tests are using the correct version of *PHPUnit* with the correct configuration, the following command can be used to run tests: + + bash bin/phpunit.sh \ No newline at end of file diff --git a/bin/finish.sh b/bin/finish.sh new file mode 100755 index 000000000..aed604feb --- /dev/null +++ b/bin/finish.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Run this script on a feature, bugfix or refactoring branch to squash and merge changes to develop. + +# Change to the base directory of the repository. +dir=$(dirname "$0") +cd "$dir/.." + +branch=$(git branch | egrep -v "(master|develop)" | grep \* | sed "s|\* ||") + +if [[ ! $branch ]] +then + echo "You are not on a feature, bugfix or refactor branch!" + exit 0 +fi + +if [[ $(git status -s) ]] +then + echo "Working directory is not clean!" + git status -s + exit 0 +fi + +while true +do + read -n 1 -p "Finish $branch? (y/n) " option + case $option in + [Yy]* ) + break + ;; + [Nn]* ) + exit 0 + ;; + * ) + echo "Please only enter \"y\" or \"n\"." + ;; + esac +done + +ps | grep "gulp watch" | grep -v grep | awk '{print $1}' | xargs kill + +msg="$( echo $branch | sed -E 's|([^/]+)/([^/]+)/(.*)|\1(\2): \3|' | sed 's|_| |g' )" + +git checkout develop +git merge $branch --no-ff -m "$msg" && git branch --delete $branch && git push -d origin $branch \ No newline at end of file diff --git a/phpunit.sh b/bin/phpunit.sh similarity index 83% rename from phpunit.sh rename to bin/phpunit.sh index cb0e829fd..7e49c687f 100755 --- a/phpunit.sh +++ b/bin/phpunit.sh @@ -1,5 +1,8 @@ #!/bin/zsh +dir=$(dirname "$0") +cd "$dir/.." + phar="phpunit-7.5.0.phar" local="$(pwd)/$phar" url="https://phar.phpunit.de/$phar" diff --git a/release.sh b/bin/release.sh similarity index 89% rename from release.sh rename to bin/release.sh index 19acc8f1e..33d9a686e 100755 --- a/release.sh +++ b/bin/release.sh @@ -19,6 +19,11 @@ # 9. Push changes to origin +# Change to the base directory of the repository. +dir=$(dirname "$0") +cd "$dir/.." + + # Test branch. if [[ $(git branch | grep \* | cut -d ' ' -f2) != "develop" ]] then @@ -32,7 +37,7 @@ ps | grep "gulp watch" | grep -v grep | awk '{print $1}' | xargs kill # Run tests. -bash phpunit.sh +bash bin/phpunit.sh echo @@ -103,12 +108,12 @@ echo echo "Updating version numbers ..." echo "" > automad/version.php -for json in {automad,packages/{*/*,*}}/{package,theme}.json +for json in {automad,packages/{*/*,*}}/{package,package-lock,theme}.json do if [[ -f $json ]] then mv $json $json.bak - sed "/version/s/[0-9][^\"]*/$tag/" $json.bak > $json + sed "1,/version/s/[0-9][^\"]*/$tag/" $json.bak > $json rm $json.bak fi done @@ -155,7 +160,7 @@ echo # Commit changes. echo "Committing changes ..." -git add -A && git commit -m "build(release): prepared release $tag" +git add -A && git commit -m "build(release): prepare release $tag" echo @@ -167,7 +172,7 @@ echo # Merging. echo "Merging branch develop ..." -git merge develop --no-ff -m "build(release): merged branch develop (release $tag)" +git merge develop --no-ff -m "build(release): merge branch develop (release $tag)" echo diff --git a/bin/start.sh b/bin/start.sh new file mode 100755 index 000000000..57c163c87 --- /dev/null +++ b/bin/start.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# Run this script to checkout develop and start a fresh feature, bugfix or refactor branch. + +# Change to the base directory of the repository. +dir=$(dirname "$0") +cd "$dir/.." + +if [[ $(git status -s) ]] +then + echo "Working directory is not clean!" + git status -s + exit 0 +fi + +git checkout develop + +echo "Choose type of branch:" +echo +echo " 1) Feature (default)" +echo " 2) Bugfix" +echo " 3) Refactor" +echo +read -n 1 -p "Please select a number or press Enter for a Feature: " option +echo + +case $option in + 1) branchType="feat";; + 2) branchType="fix";; + 3) branchType="refactor";; + *) branchType="feat";; +esac + +read -p "Please enter a scope: " branchScope + +read -p "Please enter a name: " branchName + +branch="$branchType/$branchScope/$( echo $branchName | tr '[:upper:]' '[:lower:]' | sed 's/ /_/g' )" + +while true +do + read -n 1 -p "Create $branch? (y/n) " option + case $option in + [Yy]* ) + break + ;; + [Nn]* ) + exit 0 + ;; + * ) + echo "Please only enter \"y\" or \"n\"." + ;; + esac +done + +git branch $branch +git checkout $branch \ No newline at end of file diff --git a/packages/standard/dark/theme.json b/packages/standard/dark/theme.json index 80329884d..bca2cf87a 100644 --- a/packages/standard/dark/theme.json +++ b/packages/standard/dark/theme.json @@ -2,7 +2,7 @@ "name": "Dark", "description": "A dark and elegant multi-purpose theme", "author": "Marc Anton Dahmen", - "version": "1.7.4", + "version": "1.7.5", "license": "MIT", "masks": { "page": [ diff --git a/packages/standard/light/theme.json b/packages/standard/light/theme.json index d8b31bc56..400889d0d 100644 --- a/packages/standard/light/theme.json +++ b/packages/standard/light/theme.json @@ -2,7 +2,7 @@ "name": "Light", "description": "A light and elegant multi-purpose theme", "author": "Marc Anton Dahmen", - "version": "1.7.4", + "version": "1.7.5", "license": "MIT", "masks": { "page": [ diff --git a/packages/standard/package-lock.json b/packages/standard/package-lock.json index cb0cee30e..02ad7b9dc 100644 --- a/packages/standard/package-lock.json +++ b/packages/standard/package-lock.json @@ -1,6 +1,6 @@ { "name": "standard", - "version": "1.5.4", + "version": "1.7.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/standard/package.json b/packages/standard/package.json index ffdd8de90..6e89da717 100644 --- a/packages/standard/package.json +++ b/packages/standard/package.json @@ -1,6 +1,6 @@ { "name": "standard", - "version": "1.7.4", + "version": "1.7.5", "description": "A standard collection of elegant Automad themes", "main": "gulpfile.js", "private": true, diff --git a/version.sh b/version.sh deleted file mode 100755 index 038d12e27..000000000 --- a/version.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - - -# version.sh -# -# (c) 2013-2021 by Marc Anton Dahmen -# -# A version number will be generated from the position of the working copy in the Git history. -# -# Following the conventions of semantic versioning, a plus sign (+), -# followed by a number representing the distance from the latest tag to the next committed revision (working copy parent +1) -# will be appended to the latest tag to create a unique version number on all dev branches. -# -# Example: -# If 1.0.0-beta was the lasted release and the next commit on a dev branch will be 123 commits ahead of that tag, -# the generated version number will be 1.0.0-beta+123. - - -file="automad/version.php" - -echo -echo "---" -echo "Generating version number" -echo - -tag=$(git describe --tags $(git rev-list --tags --max-count=1)) - -echo "Find latest tag across all branches: $tag" - -distance=$(($(git rev-list --count $(git rev-list --tags --max-count=1)..HEAD) + 1)) -echo "Distance to $tag: $distance" - -# Append a plus sign followed by the number of commits ahead of the latest tag. -version="$tag+$distance" - -echo "Generated version number: $version" -echo "---" -echo -echo "" > $file