Skip to content

Commit 2d9d9bc

Browse files
committed
Fixes #64, #62, #60
1 parent f565a35 commit 2d9d9bc

File tree

5 files changed

+28
-18
lines changed

5 files changed

+28
-18
lines changed

ChangeLog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Version 1.2.9, January 26th, 2014
2+
=================================
3+
4+
- Fixes #64 (crash serving favicon)
5+
- Fixes #62 (missing titles on new and edit)
6+
- Fixes #60 (no sidebar on login page)
7+
18
Version 1.2.8, December 15th, 2014
29
=================================
310

jingo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Jingo, wiki engine
55
* http://github.com/claudioc/jingo
66
*
7-
* Copyright 2014 Claudio Cicali <claudio.cicali@gmail.com>
7+
* Copyright 2015 Claudio Cicali <claudio.cicali@gmail.com>
88
* Released under the MIT license
99
*/
1010
var program = require('commander'),
@@ -18,7 +18,7 @@ var program = require('commander'),
1818

1919
global.Git = require('./lib/gitmech');
2020

21-
program.version('1.2.8')
21+
program.version('1.2.9')
2222
.option('-c, --config <path>', 'Specify the config file')
2323
.option('-#, --hash-string <string>', 'Create an hash for a string')
2424
.option('-l, --local', 'Listen on localhost only')

lib/app.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ module.exports.initialize = function(config) {
104104
if (config.get("application").loggingMode) {
105105
app.use(logger(config.get("application").loggingMode == 1 ? "combined" : "dev", {skip: function() { }}));
106106
}
107-
app.use(favicon("public/favicon.ico"));
107+
app.use(favicon(path.join(__dirname + "/../", 'public', 'favicon.ico')))
108108
app.use(bodyParser.urlencoded({extended: true, limit: "500kb"}));
109109
app.use(methodOverride(function(req, res){
110110
if (req.body && typeof req.body === 'object' && '_method' in req.body) {
@@ -135,21 +135,22 @@ module.exports.initialize = function(config) {
135135
res.locals._style = components.customStyle();
136136
res.locals._script = components.customScript();
137137

138-
if (null === req.url.match(/^\/auth\//) &&
139-
null === req.url.match(/^\/misc\//) &&
140-
null === req.url.match(/^\/login/)) {
141-
components.sidebarAsync().then(function(content) {
142-
res.locals._sidebar = content;
143-
return components.footerAsync();
144-
}).then(function(content) {
145-
res.locals._footer = content;
146-
next();
147-
}).catch(function(e) {
148-
console.log(e);
149-
});
150-
} else {
151-
next();
138+
if ( /^\/auth\//.test(req.url) ||
139+
/^\/misc\//.test(req.url) ||
140+
(/^\/login/.test(req.url) && !config.get('authorization').anonRead)
141+
) {
142+
return next();
152143
}
144+
145+
components.sidebarAsync().then(function(content) {
146+
res.locals._sidebar = content;
147+
return components.footerAsync();
148+
}).then(function(content) {
149+
res.locals._footer = content;
150+
return next();
151+
}).catch(function(e) {
152+
console.log(e);
153+
});
153154
});
154155

155156
app.use(passport.initialize());

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jingo",
3-
"version": "1.2.8",
3+
"version": "1.2.9",
44
"description": "A nodejs based wiki engine (sort of Gollum port)",
55
"author": "Claudio Cicali <claudio.cicali@gmail.com>",
66
"keywords": [

routes/pages.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ function _getPagesNew(req, res) {
6464
delete req.session.formData;
6565

6666
res.render("create", {
67+
title: "Jingo – Create page " + title,
6768
pageTitle: title,
6869
pageName: page ? page.wikiname : ""
6970
});
@@ -257,6 +258,7 @@ function _getPagesEdit(req, res) {
257258
delete req.session.formData;
258259

259260
res.render('edit', {
261+
title: "Jingo – Edit page " + page.title,
260262
page: page,
261263
warning: warning
262264
});

0 commit comments

Comments
 (0)