Skip to content

Commit

Permalink
Merge pull request #331 from GetPublii/0.33.2-hot-fix
Browse files Browse the repository at this point in the history
0.33.2 hot fix
  • Loading branch information
dziudek authored Feb 18, 2019
2 parents 1b0c61e + dd1315b commit 327c96d
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 34 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.33.1 (build 11516)**
**Current version: 0.33.2 (build 11522)**

## Why Publii?
Unlike static-site generators that are often unwieldy and difficult to use, Publii provides an
Expand Down
6 changes: 3 additions & 3 deletions app/back-end/author.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ class Author extends Model {
}

let authorsSqlQuery = this.db.prepare(`DELETE FROM authors WHERE id = @id`);
let postsSqlQuery = this.db.prepare(`UPDATE posts SET authors = "1" WHERE authors = @id`);
let postsSqlQuery = this.db.prepare(`UPDATE posts SET authors = "1" WHERE authors LIKE @id`);

authorsSqlQuery.run({
id: this.id
id: this.id.toString()
});

postsSqlQuery.run({
id: '"' + this.id + '"'
id: this.id.toString()
});

return {
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.33.1","build":11516,"status":"Beta"}
{"version":"0.33.2","build":11522,"status":"Beta"}
4 changes: 3 additions & 1 deletion app/back-end/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class Image extends Model {
finalHeight = Jimp.AUTO;
}
}

if(finalWidth === 'auto') {
finalWidth = null;

Expand All @@ -271,6 +271,7 @@ class Image extends Model {
reject(err);
}

console.log('JIMP COVER', finalWidth, ' x ', finalHeight);
image.cover(finalWidth, finalHeight)
.quality(imagesQuality)
.write(destinationPath, function() {
Expand Down Expand Up @@ -319,6 +320,7 @@ class Image extends Model {
reject(err);
}

console.log('JIMP SCALE TO FIT', finalWidth, ' x ', finalHeight);
image.scaleToFit(finalWidth, finalHeight)
.quality(imagesQuality)
.write(destinationPath, function() {
Expand Down
27 changes: 21 additions & 6 deletions app/back-end/modules/deploy/ftp.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,19 +476,24 @@ class FTP {
pasvTimeout: 10000
};

fs.writeFileSync(normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test')), 'It is a test file. You can remove it.');
let testFilePath = normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test'));
fs.writeFileSync(testFilePath, 'It is a test file. You can remove it.');
client.connect(connectionParams);

client.on('ready', () => {
waitForTimeout = false;

client.put(
normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test')),
normalizePath(testFilePath),
normalizePath(path.join(deploymentConfig.path, 'publii.test')),
(err) => {
if (err) {
app.mainWindow.webContents.send('app-deploy-test-write-error');
fs.unlinkSync(normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test')));

if (fs.existsSync(testFilePath)) {
fs.unlinkSync(testFilePath);
}

client.destroy();
return;
}
Expand All @@ -498,21 +503,31 @@ class FTP {
(err) => {
if (err) {
app.mainWindow.webContents.send('app-deploy-test-write-error');
fs.unlinkSync(normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test')));

if (fs.existsSync(testFilePath)) {
fs.unlinkSync(testFilePath);
}

client.destroy();
return;
}

app.mainWindow.webContents.send('app-deploy-test-success');
fs.unlinkSync(normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test')));

if (fs.existsSync(testFilePath)) {
fs.unlinkSync(testFilePath);
}

client.destroy();
}
);
}
);
});

fs.unlinkSync(normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test')));
if (fs.existsSync(testFilePath)) {
fs.unlinkSync(testFilePath);
}

client.on('error', function(err) {
if(waitForTimeout) {
Expand Down
36 changes: 29 additions & 7 deletions app/back-end/modules/deploy/sftp.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,18 +366,24 @@ class SFTP {
connectionSettings.privateKey = fs.readFileSync(keyPath);
}

let testFilePath = normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test'));

client.connect(connectionSettings).then(() => {
return client.list('/');
}).then(data => {
fs.writeFileSync(normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test')), 'It is a test file. You can remove it.');
fs.writeFileSync(testFilePath, 'It is a test file. You can remove it.');

client.put(
normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test')),
testFilePath,
normalizePath(path.join(deploymentConfig.path, 'publii.test'))
).then(err => {
if (err) {
app.mainWindow.webContents.send('app-deploy-test-write-error');
fs.unlinkSync(normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test')));

if (fs.existsSync(testFilePath)) {
fs.unlinkSync(testFilePath);
}

client.end();
return;
}
Expand All @@ -387,22 +393,38 @@ class SFTP {
).then(err => {
if (err) {
app.mainWindow.webContents.send('app-deploy-test-write-error');
fs.unlinkSync(normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test')));

if (fs.existsSync(testFilePath)) {
fs.unlinkSync(testFilePath);
}

client.end();
return;
}

app.mainWindow.webContents.send('app-deploy-test-success');
fs.unlinkSync(normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test')));

if (fs.existsSync(testFilePath)) {
fs.unlinkSync(testFilePath);
}

client.end();
}).catch(err => {
app.mainWindow.webContents.send('app-deploy-test-write-error');
fs.unlinkSync(normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test')));

if (fs.existsSync(testFilePath)) {
fs.unlinkSync(testFilePath);
}

client.end();
});
}).catch(err => {
app.mainWindow.webContents.send('app-deploy-test-write-error');
fs.unlinkSync(normalizePath(path.join(app.sitesDir, siteName, 'input', 'publii.test')));

if (fs.existsSync(testFilePath)) {
fs.unlinkSync(testFilePath);
}

client.end();
});

Expand Down
4 changes: 2 additions & 2 deletions app/back-end/modules/render-html/contexts/author.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ class RendererContextAuthor extends RendererContext {
status NOT LIKE "%hidden%" AND
status NOT LIKE "%trashed%" AND
${includeFeaturedPosts}
authors = @authorID
authors LIKE @authorID
ORDER BY
${this.postsOrdering}
LIMIT
@postsNumber
OFFSET
@offset
`).all({
authorID: this.authorID,
authorID: this.authorID.toString(),
postsNumber: this.postsNumber,
offset: this.offset
});
Expand Down
12 changes: 8 additions & 4 deletions app/back-end/modules/render-html/handlebars/helpers/json-ld.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,14 @@ function jsonLDHelper(rendererInstance, Handlebars) {
}

jsonLDObject['description'] = context.data.root.post.excerpt;
jsonLDObject['author'] = {
"@type": "Person",
"name": context.data.root.post.author.name
};

if (context.data.config.post.displayAuthor) {
jsonLDObject['author'] = {
"@type": "Person",
"name": context.data.root.post.author.name
};
}

jsonLDObject['publisher'] = {
"@type": "Organization",
"name": context.data.root.siteOwner.name
Expand Down
4 changes: 2 additions & 2 deletions app/back-end/modules/render-html/renderer-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,11 @@ class RendererContext {
status LIKE "%published%" AND
status NOT LIKE "%hidden%" AND
status NOT LIKE "%trashed%" AND
authors = @authorID
authors LIKE @authorID
ORDER BY
${postsOrdering}
`).all({
authorID: authorID
authorID: authorID.toString()
});

posts = posts.map(post => this.renderer.cachedItems.posts[post.id]);
Expand Down
2 changes: 1 addition & 1 deletion 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.33.1",
"version": "0.33.2",
"description": "Static Site CMS",
"main": "main.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion app/src/components/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@

<p class="about-copyright">
Copyright 2019 <a href="https://tidycustoms.net" target="_blank">TidyCustoms</a>. All rights reserved.<br>
Publli is designed and maintained by core team with cooperation with Dev Zen and is made possible by the <a href="http://electron.atom.io" target="_blank">Electron</a>
Publli is designed and maintained by core team with cooperation with <a href="https://github.com/dziudek" target="_blank">Dev Zen</a> and is made possible by the <a href="http://electron.atom.io" target="_blank">Electron</a>
Open Source project and other <router-link to="/about/credits">Open Source Software</router-link>.
</p>

<p>
<strong>We do not collect any </strong>personal data while you use Publii app; also we do not store, we do not track, we do not allow third parties to collect personally identifiable information about you.
</p>

<p>
<a href="https://getpublii.com/license.html" target="_blank">Licensing information</a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"productName": "Publii",
"name": "Publii",
"version": "0.33.1",
"version": "0.33.2",
"description": "Static Site CMS",
"homepage": "https://getpublii.com",
"author": {
Expand All @@ -17,7 +17,7 @@
"build": "cross-env NODE_ENV=development gulp build",
"start": "electron app/main.js --enable-logging",
"test": "mocha app/js/**/*.spec.js --reporter dot",
"packager:win": "cross-env NODE_ENV=production electron-packager ./app Publii --platform=win32 --arch=x64 --asar.unpack=\"*.+(dylib|node|dll)\" --asar.unpackDir=\"default-files/default-themes/**/*\" --ignore=app/node_modules/electron-* --ignore=app/node_modules/devtron --ignore=app/node_modules/accessibility-developer-tools --ignore=app/node_modules/babel* --ignore=app/node_modules/asn1 --ignore=app/node_modules/postcss* --electron-version=3.1.3 --overwrite --symlinks --app-version=0.33.1 --icon=app/src/assets/installation/icon.ico --app-bundle-id=TidyCustoms --helper-bundle-id=TidyCustoms --version-string.CompanyName=\"TidyCustoms\" --version-string.ProductName=Publii --version-string.FileDescription=Publii --version-string.LegalCopyright=\"Copyright (C) 2018 TidyCustoms. All rights reserved.\" --version-string.ProductVersion=0.33.1 --version-string.FileVersion=0.33.1 --version-string.InternalName=Publii --version-string.OriginalFilename=Publii",
"packager:win": "cross-env NODE_ENV=production electron-packager ./app Publii --platform=win32 --arch=x64 --asar.unpack=\"*.+(dylib|node|dll)\" --asar.unpackDir=\"default-files/default-themes/**/*\" --ignore=app/node_modules/electron-* --ignore=app/node_modules/devtron --ignore=app/node_modules/accessibility-developer-tools --ignore=app/node_modules/babel* --ignore=app/node_modules/asn1 --ignore=app/node_modules/postcss* --electron-version=3.1.3 --overwrite --symlinks --app-version=0.33.2 --icon=app/src/assets/installation/icon.ico --app-bundle-id=TidyCustoms --helper-bundle-id=TidyCustoms --version-string.CompanyName=\"TidyCustoms\" --version-string.ProductName=Publii --version-string.FileDescription=Publii --version-string.LegalCopyright=\"Copyright (C) 2018 TidyCustoms. All rights reserved.\" --version-string.ProductVersion=0.33.2 --version-string.FileVersion=0.33.2 --version-string.InternalName=Publii --version-string.OriginalFilename=Publii",
"packager:osx": "cross-env NODE_ENV=production electron-packager ./app Publii --platform=darwin --arch=x64 --asar.unpack=\"*.+(dylib|node|dll)\" --asar.unpackDir=\"default-files/default-themes/**/*\" --ignore=app/node_modules/electron-* --electron-version=3.1.3 --ignore=app/node_modules/devtron --ignore=app/node_modules/accessibility-developer-tools --ignore=app/node_modules/babel* --ignore=app/node_modules/asn1 --ignore=app/node_modules/postcss* --overwrite --symlinks --icon app/src/assets/installation/icon.icns --osx-sign; electron-osx-flat Publii-darwin-x64/Publii.app",
"packager:linux": "cross-env NODE_ENV=production electron-packager ./app Publii --platform=linux --arch=x64 --asar.unpack=\"*.+(dylib|node|dll)\" --asar.unpackDir=\"default-files/default-themes/**/*\" --ignore=app/node_modules/electron-* --electron-version=3.1.3 --ignore=app/node_modules/devtron --ignore=app/node_modules/accessibility-developer-tools --ignore=app/node_modules/babel* --ignore=app/node_modules/asn1 --ignore=app/node_modules/postcss* --overwrite --symlinks",
"postinstall": "opencollective postinstall",
Expand Down
2 changes: 1 addition & 1 deletion publii.iss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Type: filesandordirs; Name: "{app}\resources";

[Setup]
AppName=Publii
AppVersion=0.33.1
AppVersion=0.33.2
DefaultDirName={pf}\Publii
DefaultGroupName=Publii
UninstallDisplayIcon={app}\Publii.exe
Expand Down

0 comments on commit 327c96d

Please sign in to comment.