Skip to content

Commit 6c7b09c

Browse files
committed
Add wco-home-page
1 parent e447391 commit 6c7b09c

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @license
3+
* Copyright 2022 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import {css} from 'lit';
8+
import {customElement} from 'lit/decorators.js';
9+
import {WCOPage} from './wco-page.js';
10+
import './wco-top-bar.js';
11+
12+
@customElement('wco-home-page')
13+
export class WCOHomePage extends WCOPage {
14+
static styles = [WCOPage.styles, css``];
15+
}
16+
17+
declare global {
18+
interface HTMLElementTagNameMap {
19+
'wco-home-page': WCOHomePage;
20+
}
21+
}

packages/site-client/src/entrypoints/homepage.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66
import 'lit/experimental-hydrate-support.js';
7+
8+
import '../components/wco-home-page.js';
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @license
3+
* Copyright 2022 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
module.exports = {
8+
async render(data) {
9+
const {renderPage, html, unsafeHTML} = await import(
10+
'../../../templates/lib/base.js'
11+
);
12+
await import('@webcomponents/internal-site-client/lib/components/wco-home-page.js');
13+
return [
14+
...renderPage({
15+
...data,
16+
content: html`<wco-home-page>${unsafeHTML(data.content)}</wco-home-page>`,
17+
}),
18+
].join('');
19+
},
20+
};

packages/site-content/site/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
layout: "layouts/base.11ty.cjs"
2+
layout: "layouts/home.11ty.cjs"
33
title: "Web Components"
44
scripts:
55
- "./js/homepage.js"

0 commit comments

Comments
 (0)