Skip to content

Commit

Permalink
Merge branch 'v.0.39.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
dziudek committed Mar 22, 2022
2 parents d32102f + d956c10 commit 8bba95e
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 29 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.39.0 (build 15465)**
**Current version: 0.39.1 (build 15483)**

## Why Publii?
Unlike static-site generators that are often unwieldy and difficult to use, Publii provides an
Expand Down
2 changes: 1 addition & 1 deletion app/back-end/builddata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"0.39.0","build":15465}
{"version":"0.39.1","build":15483}
16 changes: 14 additions & 2 deletions app/back-end/modules/deploy/google-cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ class GoogleCloud {
return;
}

let keyData = require(keyFilePath);

let gcs = new Storage({
credentials: require(keyFilePath)
projectId: keyData.project_id,
credentials: {
client_email: keyData.client_email,
private_key: keyData.private_key
}
});

this.connection = gcs.bucket(bucketName);
Expand Down Expand Up @@ -268,8 +274,14 @@ class GoogleCloud {
return;
}

let keyData = require(keyFilePath);

let gcs = new Storage({
credentials: require(keyFilePath)
projectId: keyData.project_id,
credentials: {
client_email: keyData.client_email,
private_key: keyData.private_key
}
});

let bucket = gcs.bucket(bucketName);
Expand Down
6 changes: 3 additions & 3 deletions app/back-end/modules/render-html/contexts/post-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class RendererContextPostPreview extends RendererContext {
let postURL = this.siteConfig.domain + '/preview.html';
let preparedText = this.prepareContent(this.renderer.postData.text, this.renderer.postData.id);
let hasCustomExcerpt = false;
let readmoreMatches = preparedText.match(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]{1,}?\/?\>/gmi);
let readmoreMatches = preparedText.match(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]*?\/?\>/gmi);

if (readmoreMatches && readmoreMatches.length) {
hasCustomExcerpt = true;
Expand All @@ -53,7 +53,7 @@ class RendererContextPostPreview extends RendererContext {
slug: this.renderer.postData.slug,
author: this.renderer.cachedItems.authors[this.renderer.postData.author],
url: postURL,
text: preparedText.replace(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]{1,}?\/?\>/gmi, ''),
text: preparedText.replace(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]*?\/?\>/gmi, ''),
excerpt: ContentHelper.prepareExcerpt(this.themeConfig.config.excerptLength, preparedText),
createdAt: this.renderer.postData.creationDate,
modifiedAt: this.renderer.postData.modificationDate,
Expand Down Expand Up @@ -485,7 +485,7 @@ class RendererContextPostPreview extends RendererContext {
preparedText = preparedText.replace(/contentEditable="true"/gi, '');

// Remove read more text
preparedText = preparedText.replace(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]{1,}?\/?\>/gmi, '');
preparedText = preparedText.replace(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]*?\/?\>/gmi, '');

// Remove the last empty paragraph
preparedText = preparedText.replace(/<p>&nbsp;<\/p>\s?$/gmi, '');
Expand Down
4 changes: 2 additions & 2 deletions app/back-end/modules/render-html/helpers/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ class ContentHelper {
*/
static prepareExcerpt(length, text) {
// Detect readmore
let readmoreMatches = text.match(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]{1,}?\/?\>/gmi);
let readmoreMatches = text.match(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]*?\/?\>/gmi);

if(readmoreMatches && readmoreMatches.length) {
text = text.split(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]{1,}?\/?\>/gmi);
text = text.split(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]*?\/?\>/gmi);
text = text[0];
return text;
}
Expand Down
6 changes: 3 additions & 3 deletions app/back-end/modules/render-html/items/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ class PostItem {
let preparedExcerpt = ContentHelper.prepareExcerpt(this.themeConfig.config.excerptLength, preparedText);
preparedExcerpt = ContentHelper.setInternalLinks(preparedExcerpt, this.renderer);
let hasCustomExcerpt = false;
let readmoreMatches = preparedText.match(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]{1,}?\/?\>/gmi);
let readmoreMatches = preparedText.match(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]*?\/?\>/gmi);

if (readmoreMatches && readmoreMatches.length) {
hasCustomExcerpt = true;

// Detect if hide of the custom excerpt is enabled
if (this.renderer.siteConfig.advanced.postUseTextWithoutCustomExcerpt) {
preparedText = preparedText.split(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]{1,}?\/?\>/gmi);
preparedText = preparedText.split(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]*?\/?\>/gmi);
preparedText = preparedText[1];
} else {
preparedText = preparedText.replace(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]{1,}?\/?\>/gmi, '');
preparedText = preparedText.replace(/\<hr\s+id=["']{1}read-more["']{1}[\s\S]*?\/?\>/gmi, '');
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/back-end/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class Site {
return;
}

if(data.type === 'finished') {
if (data.type === 'finished') {
sender.send('app-site-regenerate-thumbnails-success', true);
}
});
Expand Down
13 changes: 11 additions & 2 deletions app/back-end/workers/thumbnails/regenerate.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,22 @@ function regenerateImage (images, fullPath, catalog) {
if (promises[0] === 'NO-RESPONSIVE-IMAGES') {
process.send({
type: 'progress',
value: 100,
value: parseInt((context.totalProgress / context.numberOfImages) * 100, 10),
files: [
{
translation: 'core.images.responsiveImagesDisabled'
}
]
});

finishProcess();
context.totalProgress++;

if (context.totalProgress >= context.numberOfImages) {
finishProcess();
} else {
regenerateImage(images, fullPath, catalog);
}

return;
}

Expand Down Expand Up @@ -213,6 +220,8 @@ function getImageType(context, image, catalog) {
* @private
*/
function finishProcess() {
console.log('Finish process...');

process.send({
type: 'finished'
});
Expand Down
6 changes: 3 additions & 3 deletions app/default-files/default-themes/simple/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ textarea {
color: var(--nav-link-color) !important;
}
.navbar .navbar__toggle {
background: var(--dark);
background: var(--section-bg);
-webkit-box-shadow: none;
box-shadow: none;
border: none;
Expand Down Expand Up @@ -1233,7 +1233,7 @@ textarea {
}

.navbar_mobile_overlay {
background: var(--white);
background: var(--page-bg);
height: calc(100vh - 4.4rem);
left: 0;
opacity: 1;
Expand Down Expand Up @@ -1307,7 +1307,7 @@ textarea {
}

.navbar_mobile_sidebar {
background: var(--white);
background: var(--page-bg);
-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;
Expand Down
2 changes: 1 addition & 1 deletion app/default-files/default-themes/simple/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Simple",
"version": "2.4.0.0",
"version": "2.4.1.0",
"author": "TidyCustoms <https://tidycustoms.net/>",
"menus": {
"mainMenu": "Main menu"
Expand Down
4 changes: 2 additions & 2 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"productName": "Publii",
"name": "Publii",
"version": "0.39.0",
"version": "0.39.1",
"description": "Static Site CMS",
"main": "main.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion app/src/components/LanguagesListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ export default {
return false;
},
isOutdated () {
if (compare(this.languageData.publiiSupport, this.$store.state.app.versionInfo.version) === -1) {
let publiiSupport = this.languageData.publiiSupport.split('.').slice(0, 2).join('.');
let currentMajorVersion = this.$store.state.app.versionInfo.version.split('.').slice(0, 2).join('.');
if (compare(publiiSupport, currentMajorVersion) === -1) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/SyncPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<div class="buttons">
<p-button
v-if="isManual"
type="primary medium quarter-width"
type="primary medium green quarter-width"
:onClick="showFolder">
{{ $t('sync.getWebsiteFiles') }}
</p-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<prism-editor
:class="{ 'publii-block-code': true }"
ref="block"
@paste="pastePlainText"
@focus="updateCurrentBlockID"
@keyup="handleKeyboard($event); debouncedSave()"
:code="content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<prism-editor
:class="{ 'publii-block-html': true, 'is-visible': true }"
ref="block"
@paste="pastePlainText"
@keyup="handleKeyboard($event); debouncedSave()"
@focus="updateCurrentBlockID"
:code="content"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"productName": "Publii",
"name": "Publii",
"version": "0.39.0",
"version": "0.39.1",
"description": "Static Site CMS",
"homepage": "https://getpublii.com",
"author": {
Expand Down

0 comments on commit 8bba95e

Please sign in to comment.