SiteSpec in dsl.
This commit is contained in:
parent
60f4c1415f
commit
ef9e5669e3
@ -48,6 +48,7 @@ class GspPartRenderer implements PartRenderer {
|
|||||||
targetPath
|
targetPath
|
||||||
),
|
),
|
||||||
path: path,
|
path: path,
|
||||||
|
siteSpec: siteSpec,
|
||||||
tagBuilder: new DynamicTagBuilder(),
|
tagBuilder: new DynamicTagBuilder(),
|
||||||
targetPath: targetPath,
|
targetPath: targetPath,
|
||||||
text: text,
|
text: text,
|
||||||
|
@ -41,6 +41,7 @@ class GspSpecialPageRenderer implements SpecialPageRenderer {
|
|||||||
targetPath
|
targetPath
|
||||||
),
|
),
|
||||||
path: specialPage.path,
|
path: specialPage.path,
|
||||||
|
siteSpec: siteSpec,
|
||||||
tagBuilder: new DynamicTagBuilder(),
|
tagBuilder: new DynamicTagBuilder(),
|
||||||
targetPath: targetPath,
|
targetPath: targetPath,
|
||||||
texts: new EmbeddableTextsCollection(texts, globals, diagnostics.&addAll),
|
texts: new EmbeddableTextsCollection(texts, globals, diagnostics.&addAll),
|
||||||
|
@ -42,6 +42,7 @@ class GspTemplateRenderer implements TemplateRenderer {
|
|||||||
globals: globals,
|
globals: globals,
|
||||||
parts: new EmbeddablePartsMap(parts, siteSpec, globals, onDiagnostics, embeddableText, text.path, targetPath),
|
parts: new EmbeddablePartsMap(parts, siteSpec, globals, onDiagnostics, embeddableText, text.path, targetPath),
|
||||||
path: text.path,
|
path: text.path,
|
||||||
|
siteSpec: siteSpec,
|
||||||
tagBuilder: new DynamicTagBuilder(),
|
tagBuilder: new DynamicTagBuilder(),
|
||||||
targetPath: targetPath,
|
targetPath: targetPath,
|
||||||
text: embeddableText,
|
text: embeddableText,
|
||||||
|
@ -171,4 +171,21 @@ class GspPartRendererTests {
|
|||||||
assertEquals('test/test.html', r.v2)
|
assertEquals('test/test.html', r.v2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void siteSpecBaseUrlAvailable() {
|
||||||
|
def part = new Part('', null, '<%= siteSpec.baseUrl %>')
|
||||||
|
def r = this.renderer.render(
|
||||||
|
part,
|
||||||
|
[:],
|
||||||
|
new SiteSpec('', 'https://test.com'),
|
||||||
|
[:],
|
||||||
|
null,
|
||||||
|
[part],
|
||||||
|
'',
|
||||||
|
''
|
||||||
|
)
|
||||||
|
assertEmptyDiagnostics(r)
|
||||||
|
assertEquals('https://test.com', r.v2)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -200,4 +200,23 @@ class GspSpecialPageRendererTests {
|
|||||||
assertEquals('test.html', r.v2)
|
assertEquals('test.html', r.v2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void siteSpecBaseUrlAvailable() {
|
||||||
|
def specialPage = new SpecialPage(
|
||||||
|
'<%= siteSpec.baseUrl %>',
|
||||||
|
'',
|
||||||
|
null
|
||||||
|
)
|
||||||
|
def r = this.renderer.render(
|
||||||
|
specialPage,
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
new SiteSpec('', 'https://test.com'),
|
||||||
|
[:],
|
||||||
|
''
|
||||||
|
)
|
||||||
|
assertEmptyDiagnostics(r)
|
||||||
|
assertEquals('https://test.com', r.v2)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -229,4 +229,20 @@ class GspTemplateRendererTests {
|
|||||||
assertEquals('test.html', r.v2)
|
assertEquals('test.html', r.v2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void siteSpecBaseUrlAvailable() {
|
||||||
|
def template = new Template('<%= siteSpec.baseUrl %>', null, null)
|
||||||
|
def r = this.renderer.render(
|
||||||
|
template,
|
||||||
|
new FrontMatter(null, [:]),
|
||||||
|
blankText(),
|
||||||
|
[],
|
||||||
|
new SiteSpec('', 'https://test.com'),
|
||||||
|
[:],
|
||||||
|
'test.html'
|
||||||
|
)
|
||||||
|
assertEmptyDiagnostics(r)
|
||||||
|
assertEquals('https://test.com', r.v2)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user