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
87d8dea5
Verified
Commit
87d8dea5
authored
8 years ago
by
Isabella Skořepová
Browse files
Options
Downloads
Patches
Plain Diff
Pass baseurl to templates
parent
73db70c7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
sitegin/nunjucks.js
+7
-2
7 additions, 2 deletions
sitegin/nunjucks.js
sitegin/theme.js
+3
-2
3 additions, 2 deletions
sitegin/theme.js
with
11 additions
and
4 deletions
.gitignore
+
1
−
0
View file @
87d8dea5
/node_modules
*.log
/coverage
/build
/build-debug
...
...
This diff is collapsed.
Click to expand it.
sitegin/nunjucks.js
+
7
−
2
View file @
87d8dea5
...
...
@@ -52,7 +52,7 @@ env.addFilter('relURL', function(filename, dir){
var
formats
=
{};
module
.
exports
=
function
(
data
,
type
)
{
module
.
exports
=
function
(
data
,
type
,
config
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
if
(
formats
[
type
])
resolve
(
formats
[
type
]);
else
{
...
...
@@ -99,7 +99,12 @@ module.exports = function(data, type) {
var
promises
=
[];
tmpls
.
forEach
(
function
(
o
)
{
promises
.
push
(
new
Promise
(
function
(
resolve
,
reject
){
o
.
tmpl
.
render
(
data
,
function
(
err
,
val
)
{
var
param
=
Object
.
assign
({},
data
,
{
config
:
Object
.
assign
({},
data
.
config
,
{
baseurl
:
config
?
config
.
options
.
baseurl
:
''
})
})
o
.
tmpl
.
render
(
param
,
function
(
err
,
val
)
{
if
(
err
)
{
//reject(new Error('Error rendering template '+o.file));
reject
(
err
);
...
...
This diff is collapsed.
Click to expand it.
sitegin/theme.js
+
3
−
2
View file @
87d8dea5
var
jobs
=
require
(
'
./jobs
'
);
module
.
exports
=
function
(
obj
)
{
module
.
exports
=
function
(
_obj
)
{
var
obj
=
_obj
;
console
.
log
(
'
Build step: Theme
'
);
return
new
Promise
(
function
(
resolve
,
reject
){
var
todo
=
0
;
...
...
@@ -10,7 +11,7 @@ module.exports = function(obj) {
var
runJob
=
function
(
obj
,
type
)
{
todo
++
;
jobs
.
run
(
'
nunjucks
'
,
obj
,
type
)
jobs
.
run
(
'
nunjucks
'
,
obj
,
type
,
_obj
.
config
)
.
then
(
function
(
data
)
{
if
(
!
obj
.
rendered
)
obj
.
rendered
=
[];
data
.
forEach
(
function
(
o
){
...
...
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