Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
content
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ok1kvk.cz
content
Commits
f46cea96
Verified
Commit
f46cea96
authored
9 years ago
by
Isabella Skořepová
Browse files
Options
Downloads
Patches
Plain Diff
Convert writeFiles job
parent
a915131d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
sitegin/legacy/writeFiles.js
+0
-21
0 additions, 21 deletions
sitegin/legacy/writeFiles.js
sitegin/pipeline.js
+1
-0
1 addition, 0 deletions
sitegin/pipeline.js
sitegin/sitegin.js
+1
-0
1 addition, 0 deletions
sitegin/sitegin.js
sitegin/writeFiles.js
+26
-0
26 additions, 0 deletions
sitegin/writeFiles.js
with
28 additions
and
21 deletions
sitegin/legacy/writeFiles.js
deleted
100644 → 0
+
0
−
21
View file @
a915131d
var
fs
=
require
(
'
fs
'
);
var
path
=
require
(
'
path
'
);
var
mkdirp
=
require
(
'
mkdirp
'
);
var
builddir
=
"
build
"
;
if
(
process
.
argv
[
2
]
!==
"
compileonly
"
)
builddir
=
"
build-debug
"
;
module
.
exports
=
function
()
{
var
out
=
this
;
out
.
fancyname
=
"
output filesystem
"
;
out
.
forEachPage
=
function
(
article
,
cb
)
{
mkdirp
(
path
.
dirname
(
builddir
+
'
/
'
+
article
.
file
+
"
/index.html
"
),
()
=>
{
var
file
=
builddir
+
'
/
'
+
article
.
file
+
"
/index.html
"
;
fs
.
writeFile
(
file
,
article
.
content
,
function
(
err
){
if
(
err
)
throw
err
;
cb
();
});
});
}
}
This diff is collapsed.
Click to expand it.
sitegin/pipeline.js
+
1
−
0
View file @
f46cea96
...
@@ -11,6 +11,7 @@ module.exports = function(jobs) {
...
@@ -11,6 +11,7 @@ module.exports = function(jobs) {
'
markdown
'
,
'
markdown
'
,
'
tags
'
,
'
tags
'
,
'
theme
'
,
'
theme
'
,
'
writeFiles
'
,
'
print
'
'
print
'
);
);
}
}
This diff is collapsed.
Click to expand it.
sitegin/sitegin.js
+
1
−
0
View file @
f46cea96
...
@@ -13,6 +13,7 @@ module.exports = function(config) {
...
@@ -13,6 +13,7 @@ module.exports = function(config) {
[
'
tags
'
,
'
./tags
'
],
[
'
tags
'
,
'
./tags
'
],
[
'
nunjucks
'
,
'
./nunjucks
'
],
[
'
nunjucks
'
,
'
./nunjucks
'
],
[
'
theme
'
,
'
./theme
'
],
[
'
theme
'
,
'
./theme
'
],
[
'
writeFiles
'
,
'
./writeFiles
'
],
[
'
pipeline
'
,
'
./pipeline
'
]
[
'
pipeline
'
,
'
./pipeline
'
]
)
)
...
...
This diff is collapsed.
Click to expand it.
sitegin/writeFiles.js
0 → 100644
+
26
−
0
View file @
f46cea96
var
fs
=
require
(
'
fs
'
);
var
path
=
require
(
'
path
'
);
var
mkdirp
=
require
(
'
mkdirp
'
);
module
.
exports
=
function
(
obj
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
builddir
=
obj
.
config
.
builddir
;
var
todo
=
0
;
var
writeFile
=
function
(
article
)
{
var
filename
=
path
.
join
(
builddir
,
article
.
file
,
"
index.html
"
);
mkdirp
(
path
.
dirname
(
filename
),
function
()
{
fs
.
writeFile
(
filename
,
article
.
content
,
function
(
err
)
{
if
(
err
)
reject
(
err
);
todo
--
;
if
(
todo
<=
0
)
resolve
(
obj
);
});
});
}
obj
.
pages
.
forEach
(
function
(
o
)
{
writeFile
(
o
);
})
obj
.
redirects
.
forEach
(
function
(
o
)
{
writeFile
(
o
);
})
obj
.
tags
.
forEach
(
function
(
o
)
{
writeFile
(
o
);
})
if
(
todo
<=
0
)
resolve
(
obj
);
})
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment