Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
f44d0a3c
You need to sign in or sign up before continuing.
Commit
f44d0a3c
authored
Apr 23, 2017
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: URL trailing slashes remove + All pages basepath
parent
db16eb72
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
4 deletions
+46
-4
CHANGELOG.md
CHANGELOG.md
+3
-1
all.js
client/js/pages/all.js
+5
-1
configure.js
configure.js
+6
-0
pages.js
controllers/pages.js
+6
-2
seo.js
middlewares/seo.js
+20
-0
server.js
server.js
+6
-0
No files found.
CHANGELOG.md
View file @
f44d0a3c
...
@@ -8,12 +8,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
...
@@ -8,12 +8,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
-
**Auth**
: Can now specify Read Access by default for all providers (except Local)
-
**Auth**
: Can now specify Read Access by default for all providers (except Local)
-
**View**
: MathML and TeX math equations support
-
**View**
: MathML and TeX math equations support
-
**Configuration Wizard**
: Added Public Access option
-
**Configuration Wizard**
: Added Public Access option
-
**Misc**
: Heroku support
-
**Navigation**
: All Pages section
-
**Navigation**
: All Pages section
-
**UI**
: Beatiful new logo!
-
**UI**
: Beatiful new logo!
### Changed
### Changed
-
**Auth**
: Provider Strategies are now only loaded if enabled
-
**Auth**
: Provider Strategies are now only loaded if enabled
-
**System**
: Updated dependencies
-
**Misc**
: Trailing slashes in URL are now removed
-
**Misc**
: Updated dependencies
-
**UI**
: Footer is now always at the bottom of the page (but not fixed)
-
**UI**
: Footer is now always at the bottom of the page (but not fixed)
### Fixed
### Fixed
...
...
client/js/pages/all.js
View file @
f44d0a3c
...
@@ -32,7 +32,11 @@ module.exports = (alerts, socket) => {
...
@@ -32,7 +32,11 @@ module.exports = (alerts, socket) => {
}
}
},
},
mounted
:
function
()
{
mounted
:
function
()
{
this
.
fetch
(
''
)
let
basePath
=
window
.
location
.
pathname
.
slice
(
0
,
-
4
)
if
(
basePath
.
length
>
1
)
{
basePath
=
basePath
.
slice
(
1
)
}
this
.
fetch
(
basePath
)
}
}
})
})
}
}
...
...
configure.js
View file @
f44d0a3c
...
@@ -351,6 +351,12 @@ module.exports = (port, spinner) => {
...
@@ -351,6 +351,12 @@ module.exports = (port, spinner) => {
})
})
})
})
).
then
(()
=>
{
).
then
(()
=>
{
if
(
process
.
env
.
IS_HEROKU
)
{
return
fs
.
outputJsonAsync
(
'./app/heroku.json'
,
{
configured
:
true
})
}
else
{
return
true
}
}).
then
(()
=>
{
res
.
json
({
ok
:
true
})
res
.
json
({
ok
:
true
})
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
res
.
json
({
ok
:
false
,
error
:
err
.
message
})
res
.
json
({
ok
:
false
,
error
:
err
.
message
})
...
...
controllers/pages.js
View file @
f44d0a3c
...
@@ -137,8 +137,12 @@ router.put('/create/*', (req, res, next) => {
...
@@ -137,8 +137,12 @@ router.put('/create/*', (req, res, next) => {
/**
/**
* View tree view of all pages
* View tree view of all pages
*/
*/
router
.
get
(
'/all'
,
(
req
,
res
,
next
)
=>
{
router
.
use
((
req
,
res
,
next
)
=>
{
res
.
render
(
'pages/all'
)
if
(
_
.
endsWith
(
req
.
url
,
'/all'
))
{
res
.
render
(
'pages/all'
)
}
else
{
next
()
}
})
})
// ==========================================
// ==========================================
...
...
middlewares/seo.js
0 → 100644
View file @
f44d0a3c
'use strict'
const
_
=
require
(
'lodash'
)
/**
* SEO Middleware
*
* @param {Express Request} req Express request object
* @param {Express Response} res Express response object
* @param {Function} next next callback function
* @return {any} void
*/
module
.
exports
=
function
(
req
,
res
,
next
)
{
if
(
req
.
path
.
length
>
1
&&
_
.
endsWith
(
req
.
path
,
'/'
))
{
let
query
=
req
.
url
.
slice
(
req
.
path
.
length
)
||
''
res
.
redirect
(
301
,
req
.
path
.
slice
(
0
,
-
1
)
+
query
)
}
else
{
return
next
()
}
}
server.js
View file @
f44d0a3c
...
@@ -111,6 +111,12 @@ app.use(passport.initialize())
...
@@ -111,6 +111,12 @@ app.use(passport.initialize())
app
.
use
(
passport
.
session
())
app
.
use
(
passport
.
session
())
// ----------------------------------------
// ----------------------------------------
// SEO
// ----------------------------------------
app
.
use
(
mw
.
seo
)
// ----------------------------------------
// Localization Engine
// Localization Engine
// ----------------------------------------
// ----------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment