Skip to content

Commit 55898b6

Browse files
committed
[CM2] Simplify homepage + make its outputPath like all else
1 parent 9dacf64 commit 55898b6

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/compiler/contentModel2/models/homepage.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,21 @@ const models = {
77
function homepage(node) {
88
const settings = Settings.getSettings()
99

10-
const baseEntryProps = models._baseEntry(node, ['index'])
11-
12-
const permalink = settings.permalinkPrefix
13-
14-
const outputPath = join(settings.out, 'index.html')
10+
const baseEntryProps = models._baseEntry(node, ['index', 'homepage', 'home'])
1511

1612
const pageContext = {
1713
title: baseEntryProps.title,
1814
slug: baseEntryProps.slug,
19-
permalink,
20-
outputPath
15+
permalink: settings.permalinkPrefix,
16+
outputPath: settings.out
2117
}
2218

2319
return {
2420
...baseEntryProps,
2521
...pageContext,
2622
attachments: baseEntryProps.attachments.map(a => a({
2723
homepage: pageContext
28-
})),
29-
permalink
24+
}))
3025
}
3126
}
3227

src/compiler/rendering2/views/homepage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const { join } = require('path')
12
const Settings = require('../../../settings')
23
const Debug = require('../../../debug')
34

@@ -10,7 +11,7 @@ const renderHomepage = async (Renderer, contentModel) => {
1011
`pages/homepage/${homepage.contentType}`,
1112
`pages/homepage`
1213
],
13-
outputPath: homepage.outputPath,
14+
outputPath: join(homepage.outputPath, 'index.html'),
1415
content: homepage.content,
1516
data: {
1617
...contentModel,

0 commit comments

Comments
 (0)