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
454da698
You need to sign in or sign up before continuing.
Commit
454da698
authored
Sep 27, 2019
by
Nick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: git sync untracked
parent
30d800bc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
+15
-9
page.js
server/helpers/page.js
+13
-0
pages.js
server/models/pages.js
+1
-8
storage.js
server/modules/storage/git/storage.js
+1
-1
No files found.
server/helpers/page.js
View file @
454da698
...
@@ -89,5 +89,18 @@ module.exports = {
...
@@ -89,5 +89,18 @@ module.exports = {
}
else
{
}
else
{
return
false
return
false
}
}
},
/**
* Get file extension from content type
*/
getFileExtension
(
contentType
)
{
switch
(
contentType
)
{
case
'markdown'
:
return
'md'
case
'html'
:
return
'html'
default
:
return
'txt'
}
}
}
}
}
server/models/pages.js
View file @
454da698
...
@@ -159,14 +159,7 @@ module.exports = class Page extends Model {
...
@@ -159,14 +159,7 @@ module.exports = class Page extends Model {
* @returns {string} File Extension
* @returns {string} File Extension
*/
*/
getFileExtension
()
{
getFileExtension
()
{
switch
(
this
.
contentType
)
{
return
pageHelper
.
getFileExtension
(
this
.
contentType
)
case
'markdown'
:
return
'md'
case
'html'
:
return
'html'
default
:
return
'txt'
}
}
}
/**
/**
...
...
server/modules/storage/git/storage.js
View file @
454da698
...
@@ -349,7 +349,7 @@ module.exports = {
...
@@ -349,7 +349,7 @@ module.exports = {
new
stream
.
Transform
({
new
stream
.
Transform
({
objectMode
:
true
,
objectMode
:
true
,
transform
:
async
(
page
,
enc
,
cb
)
=>
{
transform
:
async
(
page
,
enc
,
cb
)
=>
{
let
fileName
=
`
${
page
.
path
}
.
${
page
.
getFileExtension
(
)}
`
let
fileName
=
`
${
page
.
path
}
.
${
page
Helper
.
getFileExtension
(
page
.
contentType
)}
`
if
(
WIKI
.
config
.
lang
.
namespacing
&&
WIKI
.
config
.
lang
.
code
!==
page
.
localeCode
)
{
if
(
WIKI
.
config
.
lang
.
namespacing
&&
WIKI
.
config
.
lang
.
code
!==
page
.
localeCode
)
{
fileName
=
`
${
page
.
localeCode
}
/
${
fileName
}
`
fileName
=
`
${
page
.
localeCode
}
/
${
fileName
}
`
}
}
...
...
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