diff --git a/README.md b/README.md
index a06b58c6f..07bd988b5 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
[Publii](https://getpublii.com/) is a desktop-based CMS for Windows, Mac and Linux that makes creating static websites fast
and hassle-free, even for beginners.
-**Current version: 0.36.0 (build 13213)**
+**Current version: 0.36.1 (build 13320)**
## Why Publii?
Unlike static-site generators that are often unwieldy and difficult to use, Publii provides an
diff --git a/app/back-end/app.js b/app/back-end/app.js
index ea79b8ae2..6404e648f 100644
--- a/app/back-end/app.js
+++ b/app/back-end/app.js
@@ -10,11 +10,7 @@ const sqlite = require('better-sqlite3');
const compare = require('node-version-compare');
const normalizePath = require('normalize-path');
// Electron classes
-const electron = require('electron');
-const shell = electron.shell;
-const Menu = electron.Menu;
-const dialog = electron.dialog;
-const BrowserWindow = electron.BrowserWindow;
+const { screen, shell, nativeTheme, Menu, dialog, BrowserWindow } = require('electron');
// Collection classes
const Posts = require('./posts.js');
const Tags = require('./tags.js');
@@ -343,7 +339,7 @@ class App {
}
if (!this.windowBounds) {
- let screens = electron.screen.getAllDisplays();
+ let screens = screen.getAllDisplays();
let width = screens[0].workAreaSize.width;
let height = screens[0].workAreaSize.height;
@@ -442,14 +438,15 @@ class App {
nodeIntegration: true,
webviewTag: true,
spellcheck: true,
- preload: path.join(__dirname, 'app-preload.js')
+ preload: path.join(__dirname, 'app-preload.js'),
+ icon: path.join(__dirname, 'assets', 'icon.png')
};
- if (this.appConfig.appTheme === 'dark') {
+ if (this.appConfig.appTheme === 'dark' || (this.appConfig.appTheme === 'system' && nativeTheme.shouldUseDarkColors)) {
windowParams.backgroundColor = '#202128';
}
- let displays = electron.screen.getAllDisplays();
+ let displays = screen.getAllDisplays();
let externalDisplay = displays.find((display) => {
return display.bounds.x !== 0 || display.bounds.y !== 0;
});
@@ -459,9 +456,9 @@ class App {
!externalDisplay &&
(
windowParams.x < 0 ||
- windowParams.x > electron.screen.getPrimaryDisplay().workAreaSize.width ||
+ windowParams.x > screen.getPrimaryDisplay().workAreaSize.width ||
windowParams.y < 0 ||
- windowParams.y > electron.screen.getPrimaryDisplay().workAreaSize.height
+ windowParams.y > screen.getPrimaryDisplay().workAreaSize.height
)
) {
windowParams.x = 0;
@@ -535,12 +532,35 @@ class App {
if (process.platform === 'linux') {
this.mainWindow.webContents.on('before-input-event', (event, input) => {
- if (input.control && input.code === 'KeyQ') {
+ if (input.control && input.key === 'a') {
this.app.quit();
}
});
}
+ this.mainWindow.on('close', function(e) {
+ let currentWindowURL = e.sender.webContents.getURL();
+
+ if (
+ currentWindowURL.indexOf('/posts/editor/blockeditor/') === -1 &&
+ currentWindowURL.indexOf('/posts/editor/markdown/') === -1 &&
+ currentWindowURL.indexOf('/posts/editor/tinymce/') === -1
+ ) {
+ return;
+ }
+
+ const choice = dialog.showMessageBoxSync(this, {
+ type: 'question',
+ buttons: ['Yes', 'No'],
+ title: 'Confirm',
+ message: "Are you sure you want to quit? \nAll unsaved changes will be lost."
+ });
+
+ if (choice === 1) {
+ e.preventDefault();
+ }
+ });
+
// Open Dev Tools
if(this.appConfig.openDevToolsInMain) {
this.mainWindow.webContents.openDevTools();
@@ -596,6 +616,16 @@ class App {
return true;
}
+
+ /**
+ * Function used to add sites to the back-end sites list
+ *
+ * @param {string} siteCatalog
+ * @param {onkject} siteData
+ */
+ addSite (siteCatalog, siteData) {
+ this.sites[siteCatalog] = siteData;
+ }
}
module.exports = App;
diff --git a/app/back-end/assets/icon.png b/app/back-end/assets/icon.png
new file mode 100644
index 000000000..1a0ea2ca4
Binary files /dev/null and b/app/back-end/assets/icon.png differ
diff --git a/app/back-end/builddata.json b/app/back-end/builddata.json
index 1ab70ff70..dc61f8c0c 100644
--- a/app/back-end/builddata.json
+++ b/app/back-end/builddata.json
@@ -1 +1 @@
-{"version":"0.36.0","build":13213,"status":"beta"}
\ No newline at end of file
+{"version":"0.36.1","build":13320,"status":"beta"}
diff --git a/app/back-end/modules/deploy/libraries/netlify-api.js b/app/back-end/modules/deploy/libraries/netlify-api.js
index e8c118cf7..b8f339272 100644
--- a/app/back-end/modules/deploy/libraries/netlify-api.js
+++ b/app/back-end/modules/deploy/libraries/netlify-api.js
@@ -29,7 +29,7 @@ class NetlifyAPI {
let hashesOfFilesToUpload = deployData.body.required;
let filesToUpload = this.getFilesToUpload(localFilesList, hashesOfFilesToUpload);
this.events.onStart(filesToUpload.length);
-
+
for (let i = 0; i < filesToUpload.length; i++) {
let filePath = filesToUpload[i];
@@ -79,7 +79,7 @@ class NetlifyAPI {
async makeApiRequest (method, endpoint, data) {
let endpointUrl = this.apiUrl + endpoint.replace(':site_id', this.siteID);
-
+
return asyncRequest({
method: method,
uri: endpointUrl,
@@ -99,12 +99,13 @@ class NetlifyAPI {
let endpointUrl = this.apiUrl + 'deploys/' + deployID + '/files' + filePath;
let fullFilePath = this.getFilePath(this.inputDir, filePath, true);
let fileContent = await asyncReadFile(fullFilePath);
-
+
return asyncRequest({
method: 'PUT',
uri: endpointUrl,
headers: {
- 'User-Agent': 'Publii'
+ 'User-Agent': 'Publii',
+ 'Content-Type': 'application/octet-stream'
},
body: fileContent,
auth: {
diff --git a/app/back-end/modules/import/wxr-parser.js b/app/back-end/modules/import/wxr-parser.js
index afd137917..a7a92853d 100644
--- a/app/back-end/modules/import/wxr-parser.js
+++ b/app/back-end/modules/import/wxr-parser.js
@@ -367,6 +367,7 @@ class WxrParser {
let postSlug = slug(posts[i].title);
let postAuthor = this.temp.authors[slug(posts[i]['dc:creator'])];
let postText = this.preparePostText(posts[i]['content:encoded'], postImages);
+ let postStatus = posts[i]['wp:status'] === 'draft' ? 'draft' : 'published'
let postTags = '';
let postTitle = typeof posts[i].title === 'string' ? posts[i].title : 'Untitled';
@@ -396,7 +397,7 @@ class WxrParser {
title: postTitle,
slug: postSlug,
author: postAuthor,
- status: 'published',
+ status: postStatus,
tags: postTags,
text: postText,
creationDate: moment(posts[i]['wp:post_date']).format('x'),
diff --git a/app/back-end/modules/render-html/contexts/feed.js b/app/back-end/modules/render-html/contexts/feed.js
index 542bd8255..3a31200b8 100644
--- a/app/back-end/modules/render-html/contexts/feed.js
+++ b/app/back-end/modules/render-html/contexts/feed.js
@@ -39,54 +39,25 @@ class RendererContextFeed extends RendererContext {
prepareData() {
let self = this;
this.posts = this.posts || [];
+ this.posts = this.posts.map(post => this.renderer.cachedItems.posts[post.id]);
+
this.posts = this.posts.map(post => {
- let postURL = self.siteConfig.domain + '/' + post.slug + '.html';
- let domainMediaPath = self.siteConfig.domain + '/media/posts/' + post.id + '/';
- let preparedText = post.text.split('#DOMAIN_NAME#').join(domainMediaPath);
- preparedText = ContentHelper.parseText(preparedText, post.editor);
let contentMode = self.siteConfig.advanced.feed.showFullText ? 'fullText' : 'excerpt';
- let text = this.cleanUpText(preparedText);
- text = ContentHelper.setInternalLinks(text, self.renderer);
- let excerpt = ContentHelper.prepareExcerpt(this.themeConfig.config.excerptLength, preparedText);
- excerpt = ContentHelper.setInternalLinks(excerpt, self.renderer);
- let authorData = this.getAuthor('post', post.id);
-
- if(contentMode !== 'fullText') {
- text = false;
- }
-
- if(self.siteConfig.advanced.urls.cleanUrls) {
- postURL = self.siteConfig.domain + '/' + post.slug + '/';
-
- if(self.renderer.previewMode || self.siteConfig.advanced.urls.addIndex) {
- postURL += 'index.html';
- }
- }
return {
title: post.title,
- url: postURL,
- author: authorData,
- text: text,
- excerpt: excerpt,
+ url: post.url,
+ author: this.getAuthor('post', post.id),
+ text: contentMode === 'fullText' ? post.text : false,
+ excerpt: post.excerpt,
createdAt: post.created_at,
- // Get higher date - created_at or modified_at
- modifiedAt: post.created_at > post.modified_at ? post.created_at : post.modified_at,
+ modifiedAt: post.created_at > post.modified_at ? post.created_at : post.modified_at, // Get higher date - created_at or modified_at
categories: this.getPostCategories(post.id),
thumbnail: this.getPostThumbnail(post.id)
}
});
}
- cleanUpText (text) {
- text = text.replace(/\
/gmi, '');
- text = text.replace(/contenteditable="false"/gmi, '');
- text = text.replace(/contenteditable="true"/gmi, '');
- text = text.replace(/data\-[a-z\-0-9]{1,}=".*?"/gmi, '');
-
- return text;
- }
-
setContext() {
this.loadData();
this.prepareData();
diff --git a/app/back-end/modules/render-html/helpers/content.js b/app/back-end/modules/render-html/helpers/content.js
index 1cc099f03..eea737890 100644
--- a/app/back-end/modules/render-html/helpers/content.js
+++ b/app/back-end/modules/render-html/helpers/content.js
@@ -42,7 +42,7 @@ class ContentHelper {
preparedText = ContentHelper.parseText(preparedText, editor);
// Remove content for AMP or non-AMP depending from ampMode value
- if(ampMode) {
+ if (ampMode) {
preparedText = preparedText.replace(/[\s\S]*?<\/publii-non-amp>/gmi, '');
preparedText = preparedText.replace(//gmi, '');
preparedText = preparedText.replace(/<\/publii-amp>/gmi, '');
@@ -74,7 +74,7 @@ class ContentHelper {
}
// Add loading="lazy" attributes to img, video, audio, iframe tags
- if (renderer.siteConfig.advanced.mediaLazyLoad) {
+ if (renderer.siteConfig.advanced.mediaLazyLoad && !ampMode) {
preparedText = preparedText.replace(/ a, .navbar .navbar__submenu li:hover > span[aria-haspopup=true] {
- color: var(var(--white)) !important;
+ color: var(--white) !important;
}
.navbar .navbar__toggle {
background: var(--dark);
@@ -1270,7 +1270,7 @@ textarea {
}
.navbar_mobile_overlay {
- background: var(var(--white));
+ background: var(--white);
height: calc(100vh - 4.4rem);
left: 0;
opacity: 1;
@@ -1299,7 +1299,7 @@ textarea {
}
.navbar_mobile_overlay .navbar__menu li a,
.navbar_mobile_overlay .navbar__menu li span {
- color: var(var(--dark));
+ color: var(--dark);
display: block;
padding: 0.5666666667rem;
position: relative;
@@ -1308,7 +1308,7 @@ textarea {
.navbar_mobile_overlay .navbar__menu li span:active,
.navbar_mobile_overlay .navbar__menu li span:focus,
.navbar_mobile_overlay .navbar__menu li span:hover {
- color: var(var(--dark));
+ color: var(--dark);
}
.navbar_mobile_overlay .navbar__menu li a[aria-haspopup=true]::after,
.navbar_mobile_overlay .navbar__menu li span[aria-haspopup=true]::after {
@@ -1340,7 +1340,7 @@ textarea {
}
.navbar_mobile_sidebar {
- background: var(var(--white));
+ background: var(--white);
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);
height: 100vh;
@@ -1371,7 +1371,7 @@ textarea {
}
.navbar_mobile_sidebar .navbar__menu li a,
.navbar_mobile_sidebar .navbar__menu li .is-separator {
- color: var(var(--dark));
+ color: var(--dark);
display: block;
padding: 10px 20px 10px 0;
position: relative;
@@ -1380,7 +1380,7 @@ textarea {
.navbar_mobile_sidebar .navbar__menu li .is-separator:active,
.navbar_mobile_sidebar .navbar__menu li .is-separator:focus,
.navbar_mobile_sidebar .navbar__menu li .is-separator:hover {
- color: var(var(--dark));
+ color: var(--dark);
}
.navbar_mobile_sidebar .navbar__menu li a[aria-haspopup=true]::after,
.navbar_mobile_sidebar .navbar__menu li .is-separator[aria-haspopup=true]::after {
@@ -1928,7 +1928,7 @@ textarea {
.post__video--1by1::before, .post__iframe--1by1::before {
padding-top: 100%;
}
-.post__video > iframe, .post__iframe > iframe {
+.post__video > iframe, .post__video > video, .post__iframe > iframe, .post__iframe > video {
border: none;
height: 100%;
left: 0;
@@ -2170,16 +2170,6 @@ textarea {
flex-wrap: wrap;
}
}
-@media all and (min-width: 56.25em) {
- .gallery--wide {
- margin-left: -var(--page-margin);
- margin-right: -var(--page-margin);
- }
-}
-.gallery--full {
- margin-left: calc(-50vw + 50%);
- margin-right: calc(-50vw + 50%);
-}
@media all and (min-width: 56.25em) {
.gallery-wrapper--wide {
margin-left: calc(-1 * var(--page-margin));
diff --git a/app/default-files/default-themes/simple/assets/js/scripts.js b/app/default-files/default-themes/simple/assets/js/scripts.js
index 4350ca310..100c045ee 100755
--- a/app/default-files/default-themes/simple/assets/js/scripts.js
+++ b/app/default-files/default-themes/simple/assets/js/scripts.js
@@ -44,13 +44,17 @@ window.addEventListener('scroll', function (e) {
submenuWidth: 300,
doubleClickTime: 500,
mobileMenuExpandableSubmenus: false,
+ isHoverMenu: true,
// selectors
wrapperSelector: '.navbar',
buttonSelector: '.navbar__toggle',
menuSelector: '.navbar__menu',
submenuSelector: '.navbar__submenu',
mobileMenuSidebarLogoSelector: null,
+ mobileMenuSidebarLogoUrl: null,
relatedContainerForOverlayMenuSelector: null,
+ // attributes
+ ariaButtonAttribute: 'aria-haspopup',
// CSS classes
separatorItemClass: 'is-separator',
parentItemClass: 'has-submenu',
@@ -93,6 +97,12 @@ window.addEventListener('scroll', function (e) {
} else if (config.mobileMenuMode === 'sidebar') {
initMobileMenuSidebar();
}
+
+ initClosingMenuOnClickLink();
+
+ if (!config.isHoverMenu) {
+ initAriaAttributes();
+ }
};
/**
@@ -102,7 +112,9 @@ window.addEventListener('scroll', function (e) {
var submenuParents = document.querySelectorAll(config.wrapperSelector + ' .' + config.parentItemClass);
for (var i = 0; i < submenuParents.length; i++) {
- submenuParents[i].addEventListener('mouseenter', function () {
+ var eventTrigger = config.isHoverMenu ? 'mouseenter' : 'click';
+
+ submenuParents[i].addEventListener(eventTrigger, function () {
var submenu = this.querySelector(config.submenuSelector);
var itemPosition = this.getBoundingClientRect().left;
var widthMultiplier = 2;
@@ -154,11 +166,13 @@ window.addEventListener('scroll', function (e) {
submenu.setAttribute('aria-hidden', false);
});
- submenuParents[i].addEventListener('mouseleave', function () {
- var submenu = this.querySelector(config.submenuSelector);
- submenu.removeAttribute('style');
- submenu.setAttribute('aria-hidden', true);
- });
+ if (config.isHoverMenu) {
+ submenuParents[i].addEventListener('mouseleave', function () {
+ var submenu = this.querySelector(config.submenuSelector);
+ submenu.removeAttribute('style');
+ submenu.setAttribute('aria-hidden', true);
+ });
+ }
}
}
@@ -186,7 +200,7 @@ window.addEventListener('scroll', function (e) {
var relatedContainer = document.querySelector(config.relatedContainerForOverlayMenuSelector);
menuWrapper.classList.toggle(config.hiddenElementClass);
button.classList.toggle(config.openedMenuClass);
- button.setAttribute('aria-expanded', button.classList.contains(config.openedMenuClass));
+ button.setAttribute(config.ariaButtonAttribute, button.classList.contains(config.openedMenuClass));
if (button.classList.contains(config.openedMenuClass)) {
document.documentElement.classList.add(config.noScrollClass);
@@ -216,6 +230,8 @@ window.addEventListener('scroll', function (e) {
if (config.mobileMenuSidebarLogoSelector !== null) {
menuContentHTML = document.querySelector(config.mobileMenuSidebarLogoSelector).outerHTML;
+ } else if (config.mobileMenuSidebarLogoUrl !== null) {
+ menuContentHTML = '';
}
menuContentHTML += document.querySelector(config.menuSelector).outerHTML;
@@ -243,7 +259,7 @@ window.addEventListener('scroll', function (e) {
menuWrapper.classList.add(config.hiddenElementClass);
menuOverlay.classList.add(config.hiddenElementClass);
button.classList.remove(config.openedMenuClass);
- button.setAttribute('aria-expanded', false);
+ button.setAttribute(config.ariaButtonAttribute, false);
document.documentElement.classList.remove(config.noScrollClass);
});
@@ -254,8 +270,8 @@ window.addEventListener('scroll', function (e) {
menuWrapper.classList.toggle(config.hiddenElementClass);
menuOverlay.classList.toggle(config.hiddenElementClass);
button.classList.toggle(config.openedMenuClass);
- button.setAttribute('aria-expanded', button.classList.contains(config.openedMenuClass));
- document.documentElement.classList.add(config.noScrollClass);
+ button.setAttribute(config.ariaButtonAttribute, button.classList.contains(config.openedMenuClass));
+ document.documentElement.classList.toggle(config.noScrollClass);
});
}
@@ -299,6 +315,9 @@ window.addEventListener('scroll', function (e) {
submenu.removeAttribute('style');
submenu.classList.remove(config.openedMenuClass);
}, config.animationSpeed);
+
+ content.setAttribute('aria-hidden', true);
+ content.parentNode.firstElementChild.setAttribute('aria-expanded', false);
} else {
var height = content.clientHeight;
submenu.classList.add(config.openedMenuClass);
@@ -311,6 +330,9 @@ window.addEventListener('scroll', function (e) {
setTimeout(function () {
submenu.removeAttribute('style');
}, config.animationSpeed);
+
+ content.setAttribute('aria-hidden', false);
+ content.parentNode.firstElementChild.setAttribute('aria-expanded', true);
}
});
@@ -331,6 +353,7 @@ window.addEventListener('scroll', function (e) {
this.setAttribute('data-last-click', currentTime);
} else if (lastClick + config.doubleClickTime > currentTime) {
e.stopPropagation();
+ closeMenu(this, true);
}
});
}
@@ -338,6 +361,79 @@ window.addEventListener('scroll', function (e) {
}
}
+ /**
+ * Set aria-* attributes according to the current activity state
+ */
+ function initAriaAttributes () {
+ var allAriaElements = document.querySelectorAll(config.wrapperSelector + ' ' + '*[aria-hidden]');
+
+ for (var i = 0; i < allAriaElements.length; i++) {
+ var ariaElement = allAriaElements[i];
+
+ if (
+ ariaElement.parentNode.classList.contains('active') ||
+ ariaElement.parentNode.classList.contains('active-parent')
+ ) {
+ ariaElement.setAttribute('aria-hidden', 'false');
+ ariaElement.parentNode.firstElementChild.setAttribute('aria-expanded', true);
+ } else {
+ ariaElement.setAttribute('aria-hidden', 'true');
+ ariaElement.parentNode.firstElementChild.setAttribute('aria-expanded', false);
+ }
+ }
+ }
+
+ /**
+ * Close menu on click link
+ */
+ function initClosingMenuOnClickLink () {
+ var links = document.querySelectorAll(config.menuSelector + ' a');
+
+ for (var i = 0; i < links.length; i++) {
+ if (links[i].parentNode.classList.contains(config.parentItemClass)) {
+ continue;
+ }
+
+ links[i].addEventListener('click', function (e) {
+ closeMenu(this, false);
+ });
+ }
+ }
+
+ /**
+ * Close menu
+ */
+ function closeMenu (clickedLink, forceClose) {
+ if (forceClose === false) {
+ if (clickedLink.parentNode.classList.contains(config.parentItemClass)) {
+ return;
+ }
+ }
+
+ var relatedContainer = document.querySelector(config.relatedContainerForOverlayMenuSelector);
+ var button = document.querySelector(config.buttonSelector);
+ var menuWrapper = document.querySelector('.' + config.mobileMenuOverlayClass);
+
+ if (!menuWrapper) {
+ menuWrapper = document.querySelector('.' + config.mobileMenuSidebarClass);
+ }
+
+ menuWrapper.classList.add(config.hiddenElementClass);
+ button.classList.remove(config.openedMenuClass);
+ button.setAttribute(config.ariaButtonAttribute, false);
+ document.documentElement.classList.remove(config.noScrollClass);
+
+ if (relatedContainer) {
+ relatedContainer.classList.remove(config.relatedContainerForOverlayMenuClass);
+ }
+
+ var menuOverlay = document.querySelector('.' + config.mobileMenuSidebarOverlayClass);
+
+ if (menuOverlay) {
+ menuOverlay.classList.add(config.hiddenElementClass);
+ }
+ }
+
/**
* Run menu scripts
*/
diff --git a/app/default-files/default-themes/simple/assets/js/scripts.min.js b/app/default-files/default-themes/simple/assets/js/scripts.min.js
index b2b4c3f32..8afba75ca 100755
--- a/app/default-files/default-themes/simple/assets/js/scripts.min.js
+++ b/app/default-files/default-themes/simple/assets/js/scripts.min.js
@@ -1,31 +1 @@
-var new_scroll_position=0;var last_scroll_position;var header=document.getElementById("js-header");var stickyMenu=document.getElementById("js-navbar-menu");window.addEventListener('scroll',function(e){last_scroll_position=window.scrollY;if(new_scroll_position40){header.classList.remove("is-visible");header.classList.add("is-hidden");}else if(new_scroll_position>last_scroll_position){header.classList.remove("is-hidden");header.classList.add("is-visible");if(stickyMenu){stickyMenu.classList.add("is-sticky");}}
-if(last_scroll_position<1){header.classList.remove("is-visible");if(stickyMenu){stickyMenu.classList.remove("is-sticky");}}
-new_scroll_position=last_scroll_position;});(function(menuConfig){var defaultConfig={mobileMenuMode:'overlay',animationSpeed:300,submenuWidth:300,doubleClickTime:500,mobileMenuExpandableSubmenus:false,wrapperSelector:'.navbar',buttonSelector:'.navbar__toggle',menuSelector:'.navbar__menu',submenuSelector:'.navbar__submenu',mobileMenuSidebarLogoSelector:null,relatedContainerForOverlayMenuSelector:null,separatorItemClass:'is-separator',parentItemClass:'has-submenu',submenuLeftPositionClass:'is-left-submenu',submenuRightPositionClass:'is-right-submenu',mobileMenuOverlayClass:'navbar_mobile_overlay',mobileMenuSubmenuWrapperClass:'navbar__submenu_wrapper',mobileMenuSidebarClass:'navbar_mobile_sidebar',mobileMenuSidebarOverlayClass:'navbar_mobile_sidebar__overlay',hiddenElementClass:'is-hidden',openedMenuClass:'is-active',noScrollClass:'no-scroll',relatedContainerForOverlayMenuClass:'is-visible'};var config={};Object.keys(defaultConfig).forEach(function(key){config[key]=defaultConfig[key];});if(typeof menuConfig==='object'){Object.keys(menuConfig).forEach(function(key){config[key]=menuConfig[key];});}
-function init(){if(!document.querySelectorAll(config.wrapperSelector).length){return;}
-initSubmenuPositions();if(config.mobileMenuMode==='overlay'){initMobileMenuOverlay();}else if(config.mobileMenuMode==='sidebar'){initMobileMenuSidebar();}};function initSubmenuPositions(){var submenuParents=document.querySelectorAll(config.wrapperSelector+' .'+config.parentItemClass);for(var i=0;icurrentTime){e.stopPropagation();}});}}}}
-init();})(window.publiiThemeMenuConfig);var comments=document.getElementById("js-comments");if(comments){comments.addEventListener("click",function(){comments.classList.toggle("is-hidden");var container=document.getElementById("js-comments__inner");container.classList.toggle("is-visible");});}
-var comments=document.getElementById("js-comments");if(comments){comments.addEventListener("click",function(){comments.classList.toggle("is-hidden");var container=document.getElementById("js-comments__inner");container.classList.toggle("is-visible");});}
-var searchButton=document.querySelector(".js-search-btn");searchOverlay=document.querySelector(".js-search-overlay");searchClose=document.querySelector(".js-search-close");searchInput=document.querySelector(".js-search-input");if(searchButton){searchButton.addEventListener("click",function(){searchOverlay.classList.add("expanded");setTimeout(function(){searchInput.focus();},60);});searchClose.addEventListener("click",function(){searchOverlay.classList.remove('expanded');});}
-(function(){let shareButton=document.querySelector('.js-post__share-button');let sharePopup=document.querySelector('.js-post__share-popup');if(shareButton){sharePopup.addEventListener('click',function(e){e.stopPropagation();});shareButton.addEventListener('click',function(e){e.preventDefault();e.stopPropagation();sharePopup.classList.toggle('is-visible');});document.body.addEventListener('click',function(){sharePopup.classList.remove('is-visible');});}
-var Config={Link:".js-share",Width:500,Height:500};var slink=document.querySelectorAll(Config.Link);for(var a=0;aoffset)?addClass(backTop,'footer__bttop--show'):removeClass(backTop,'footer__bttop--show','footer__bttop--fade-out');(windowTop>offsetOpacity)&&addClass(backTop,'footer__bttop--fade-out');scrolling=false;}
-function scrollTop(duration){var start=window.scrollY||document.documentElement.scrollTop,currentTime=null;var animateScroll=function(timestamp){if(!currentTime)currentTime=timestamp;var progress=timestamp-currentTime;var val=Math.max(Math.easeInOutQuad(progress,start,-start,duration),0);window.scrollTo(0,val);if(progress1)addClass(el,classList.slice(1).join(' '));}
-function removeClass(el,className){var classList=className.split(' ');if(el.classList)el.classList.remove(classList[0]);else if(hasClass(el,classList[0])){var reg=new RegExp('(\\s|^)'+classList[0]+'(\\s|$)');el.className=el.className.replace(reg,' ');}
-if(classList.length>1)removeClass(el,classList.slice(1).join(' '));}})();
\ No newline at end of file
+var new_scroll_position=0;var last_scroll_position;var header=document.getElementById("js-header");var stickyMenu=document.getElementById("js-navbar-menu");window.addEventListener("scroll",function(a){last_scroll_position=window.scrollY;if(new_scroll_position40){header.classList.remove("is-visible");header.classList.add("is-hidden")}else{if(new_scroll_position>last_scroll_position){header.classList.remove("is-hidden");header.classList.add("is-visible");if(stickyMenu){stickyMenu.classList.add("is-sticky")}}}if(last_scroll_position<1){header.classList.remove("is-visible");if(stickyMenu){stickyMenu.classList.remove("is-sticky")}}new_scroll_position=last_scroll_position});(function(e){var d={mobileMenuMode:"overlay",animationSpeed:300,submenuWidth:300,doubleClickTime:500,mobileMenuExpandableSubmenus:false,isHoverMenu:true,wrapperSelector:".navbar",buttonSelector:".navbar__toggle",menuSelector:".navbar__menu",submenuSelector:".navbar__submenu",mobileMenuSidebarLogoSelector:null,mobileMenuSidebarLogoUrl:null,relatedContainerForOverlayMenuSelector:null,ariaButtonAttribute:"aria-haspopup",separatorItemClass:"is-separator",parentItemClass:"has-submenu",submenuLeftPositionClass:"is-left-submenu",submenuRightPositionClass:"is-right-submenu",mobileMenuOverlayClass:"navbar_mobile_overlay",mobileMenuSubmenuWrapperClass:"navbar__submenu_wrapper",mobileMenuSidebarClass:"navbar_mobile_sidebar",mobileMenuSidebarOverlayClass:"navbar_mobile_sidebar__overlay",hiddenElementClass:"is-hidden",openedMenuClass:"is-active",noScrollClass:"no-scroll",relatedContainerForOverlayMenuClass:"is-visible"};var b={};Object.keys(d).forEach(function(m){b[m]=d[m]});if(typeof e==="object"){Object.keys(e).forEach(function(m){b[m]=e[m]})}function l(){if(!document.querySelectorAll(b.wrapperSelector).length){return}c();if(b.mobileMenuMode==="overlay"){j()}else{if(b.mobileMenuMode==="sidebar"){i()}}k();if(!b.isHoverMenu){f()}}function c(){var m=document.querySelectorAll(b.wrapperSelector+" ."+b.parentItemClass);for(var o=0;o'}}m+=document.querySelector(b.menuSelector).outerHTML;o.innerHTML=m;var p=document.createElement("div");p.classList.add(b.mobileMenuSidebarOverlayClass);p.classList.add(b.hiddenElementClass);document.body.appendChild(p);document.body.appendChild(o);if(b.mobileMenuExpandableSubmenus){h(o);a(o)}o.addEventListener("click",function(q){q.stopPropagation()});p.addEventListener("click",function(){o.classList.add(b.hiddenElementClass);p.classList.add(b.hiddenElementClass);n.classList.remove(b.openedMenuClass);n.setAttribute(b.ariaButtonAttribute,false);document.documentElement.classList.remove(b.noScrollClass)});var n=document.querySelector(b.buttonSelector);n.addEventListener("click",function(){o.classList.toggle(b.hiddenElementClass);p.classList.toggle(b.hiddenElementClass);n.classList.toggle(b.openedMenuClass);n.setAttribute(b.ariaButtonAttribute,n.classList.contains(b.openedMenuClass));document.documentElement.classList.toggle(b.noScrollClass)})}function h(o){var m=o.querySelectorAll(b.submenuSelector);for(var n=0;ns){t.stopPropagation();g(this,true)}}}})}}}}function f(){var n=document.querySelectorAll(b.wrapperSelector+" *[aria-hidden]");for(var o=0;oe)?h(b,"footer__bttop--show"):j(b,"footer__bttop--show","footer__bttop--fade-out");(k>a)&&h(b,"footer__bttop--fade-out");g=false}function d(m){var n=window.scrollY||document.documentElement.scrollTop,l=null;var k=function(p){if(!l){l=p}var o=p-l;var q=Math.max(Math.easeInOutQuad(o,n,-n,m),0);window.scrollTo(0,q);if(o1){h(l,m.slice(1).join(" "))}}function j(m,l){var n=l.split(" ");if(m.classList){m.classList.remove(n[0])}else{if(f(m,n[0])){var k=new RegExp("(\\s|^)"+n[0]+"(\\s|$)");m.className=m.className.replace(k," ")}}if(n.length>1){j(m,n.slice(1).join(" "))}}})();
\ No newline at end of file
diff --git a/app/default-files/default-themes/simple/config.json b/app/default-files/default-themes/simple/config.json
index b008adb8c..ac561b286 100755
--- a/app/default-files/default-themes/simple/config.json
+++ b/app/default-files/default-themes/simple/config.json
@@ -1,6 +1,6 @@
{
"name": "Simple",
- "version": "2.2.2.0",
+ "version": "2.2.3.0",
"author": "TidyCustoms ",
"menus": {
"mainMenu": "Main menu"
diff --git a/app/default-files/default-themes/simple/partials/disqus.hbs b/app/default-files/default-themes/simple/partials/disqus.hbs
index 6fc3c5a78..f8b55b5e3 100755
--- a/app/default-files/default-themes/simple/partials/disqus.hbs
+++ b/app/default-files/default-themes/simple/partials/disqus.hbs
@@ -3,7 +3,6 @@
var disqus_config = function () {
this.page.url = '{{url}}';
this.page.identifier = '{{id}}';
- this.page.title = ' {{#if title}}{{title}}{{else}}{{@website.name}}{{/if}}';
};
var disqus_loaded = false;
diff --git a/app/package-lock.json b/app/package-lock.json
index 0597cdcea..02da4aace 100644
--- a/app/package-lock.json
+++ b/app/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "Publii",
- "version": "0.36.0",
+ "version": "0.36.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -3832,7 +3832,7 @@
"integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ=="
},
"publii-block-editor": {
- "version": "github:dziudek/publii-block-editor#51f5d3549dfca5e22fc73fabcdadd8201b41b6ae",
+ "version": "github:dziudek/publii-block-editor#177159cad96e9858f8e2d7437a6bbe52b1b93407",
"from": "github:dziudek/publii-block-editor#master",
"requires": {
"prismjs": "^1.17.1",
diff --git a/app/package.json b/app/package.json
index 663f2a85a..afb4557b1 100644
--- a/app/package.json
+++ b/app/package.json
@@ -1,7 +1,7 @@
{
"productName": "Publii",
"name": "Publii",
- "version": "0.36.0",
+ "version": "0.36.1",
"description": "Static Site CMS",
"main": "main.js",
"scripts": {
diff --git a/app/src/components/AppSettings.vue b/app/src/components/AppSettings.vue
index 4fd019711..89773d238 100644
--- a/app/src/components/AppSettings.vue
+++ b/app/src/components/AppSettings.vue
@@ -16,6 +16,16 @@
+
+
+
+
@@ -211,7 +221,7 @@
@@ -385,6 +369,14 @@ export default {
}
}
+@media (min-width: 1800px) {
+ .post-editor-form #post-title {
+ margin: 0 auto 2.6rem;
+ max-width: calc(100% - 880px);
+ width: 100%;
+ }
+}
+
/*
* Special styles for win & linux
*/
diff --git a/app/src/components/Posts.vue b/app/src/components/Posts.vue
index 374f476aa..b84f0c693 100644
--- a/app/src/components/Posts.vue
+++ b/app/src/components/Posts.vue
@@ -391,7 +391,7 @@
class="empty-state post">
-
+
WYSIWYG editor
This editor provides a familiar word-processing experience, with additional tools for users that want to control every aspect of their page content.
-
+
Block editor
A modern and intuitive editor with shortkey and markdown support to make blogging easy, with no need to worry about HTML or other code elements.
-
+
Markdown editor
This editor supports Markdown syntax as shorthand for producing content quickly; great for extensive, no-frills projects such as documentation.
The "file://" protocol is useful only if you are using manual deployment method for the intranet websites.
The "dat://" and the "ipfs://" protocol is useful only if you have plans to use your website on P2P networks. Read more about dat:// and IPFS
Note: while using "//" as protocol, some features like Open Graph tags, sharing buttons etc. cannot work properly.
-
-
-
- Use relative URLs
-
-
- Note: while using relative URLs, some features like Open Graph tags, sharing buttons etc. cannot work properly.
-
-
-
+
+
+
+ Use FTP with SSL/TLS
+
+
+
-1) {
this.httpProtocolSelected = 'https';
@@ -1287,11 +1275,7 @@ export default {
}
},
toggleDomainName () {
- if (this.deploymentSettings.relativeUrls) {
- this.domain = './';
- } else {
- this.domain = '';
- }
+ this.domain = '';
},
getDeploymentMethodName (method) {
switch (method) {
@@ -1362,6 +1346,13 @@ export default {
}
return deploymentSettings;
+ },
+ toggleFtpDeploymentMethod () {
+ if (this.deploymentMethodSelected === 'ftp+tls') {
+ this.deploymentMethodSelected = 'ftp';
+ } else {
+ this.deploymentMethodSelected = 'ftp+tls';
+ }
}
}
}
diff --git a/app/src/components/Settings.vue b/app/src/components/Settings.vue
index fcda16d96..8d3104b7c 100644
--- a/app/src/components/Settings.vue
+++ b/app/src/components/Settings.vue
@@ -1168,7 +1168,7 @@
- Enable this option if you want to use native lady loading that lazy loads images, videos and iframes.
+ Enable this option if you want to use native lazy loading that lazy loads images, videos and iframes.
diff --git a/app/src/components/TopBarDropDown.vue b/app/src/components/TopBarDropDown.vue
index b4d7b2317..bc361d452 100644
--- a/app/src/components/TopBarDropDown.vue
+++ b/app/src/components/TopBarDropDown.vue
@@ -18,8 +18,8 @@
path="/app-themes" />
+ path="/app-settings"
+ label="Change application theme" />