Skip to content

Commit d7e461c

Browse files
committed
feat(launch): replace option logoSrc, logoAlt with logoSmall TemplateResult
1 parent a12adf2 commit d7e461c

File tree

5 files changed

+50
-6
lines changed

5 files changed

+50
-6
lines changed

.changeset/silent-seals-begin.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@rocket/launch': patch
3+
---
4+
5+
Replace Layout Options `logoSrc` and `logoAlt` strings with a `logoSmall` TemplateResult
6+
7+
```diff
8+
- logoSrc: '/icon.svg',
9+
- logoAlt: 'Rocket Logo',
10+
+ logoSmall: html`
11+
+ <img src="resolve:@rocket/launch/assets/rocket-logo-light.svg" alt="Rocket" width="250" height="67.87" />
12+
+ `,
13+
```
Lines changed: 12 additions & 0 deletions
Loading

packages/launch/src/LayoutMain.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,17 @@ export class LayoutMain extends Layout {
4545
headerDarkBackground: false,
4646
dsdPending: true,
4747
siteName: 'Rocket',
48-
logoSrc: '/icon.svg',
49-
logoAlt: 'Rocket Logo',
48+
logoSmall: html`
49+
<picture>
50+
<!-- <source srcset="resolve:@rocket/launch/assets/rocket-logo-dark.svg" media="(prefers-color-scheme: dark)"> -->
51+
<img
52+
src="resolve:@rocket/launch/assets/rocket-logo-light.svg"
53+
alt="Rocket Logo"
54+
width="250"
55+
height="67.87"
56+
/>
57+
</picture>
58+
`,
5059
gitSiteUrl: 'https://github.com/modernweb-dev/rocket',
5160
gitBranch: 'next',
5261
description: 'A static site generator for modern web development',
@@ -147,7 +156,7 @@ export class LayoutMain extends Layout {
147156

148157
header__10: html`
149158
<a class="logo-link" href="/" slot="logo">
150-
<img src="/icon.svg" alt="${this.options.logoAlt}" />
159+
${this.options.logoSmall}
151160
<span>${this.options.siteName}</span>
152161
</a>
153162
`,
@@ -171,7 +180,7 @@ export class LayoutMain extends Layout {
171180

172181
drawer__10: html`
173182
<a class="logo-link" href="/">
174-
<img src="${this.options.logoSrc}" alt="${this.options.logoAlt}" />
183+
${this.options.logoSmall}
175184
<span>${this.options.siteName}</span>
176185
</a>
177186
`,

packages/launch/types/layout.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ export interface LayoutSidebarOptions extends LayoutOptions {
77
[key: TemplateValueKey<'drawer'>]: TemplateValue;
88

99
siteName: string;
10-
logoSrc: string;
11-
logoAlt: string;
10+
logoSmall: TemplateValue;
1211
gitSiteUrl: string;
1312
gitBranch: string;
1413
description: string;

site/src/layouts/layoutData.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ export const layoutData = {
1919
// head__42: html` <link rel="stylesheet" href="resolve:root/src/assets/styles.css" /> `,
2020
header__40: search,
2121
drawer__30: search,
22+
logoSmall: html`
23+
<picture>
24+
<!-- <source srcset="resolve:#src/assets/rocket-logo-dark.svg" media="(prefers-color-scheme: dark)"> -->
25+
<img
26+
src="resolve:#src/assets/rocket-logo-light.svg"
27+
alt="Rocket Logo"
28+
width="250"
29+
height="67.87"
30+
/>
31+
</picture>
32+
`,
2233
footerMenu: [
2334
{
2435
name: 'Discover',

0 commit comments

Comments
 (0)