Skip to content

Commit

Permalink
feat(launch): replace option logoSrc, logoAlt with logoSmall Template…
Browse files Browse the repository at this point in the history
…Result
  • Loading branch information
daKmoR committed Aug 21, 2022
1 parent a12adf2 commit d7e461c
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 6 deletions.
13 changes: 13 additions & 0 deletions .changeset/silent-seals-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@rocket/launch': patch
---

Replace Layout Options `logoSrc` and `logoAlt` strings with a `logoSmall` TemplateResult

```diff
- logoSrc: '/icon.svg',
- logoAlt: 'Rocket Logo',
+ logoSmall: html`
+ <img src="resolve:@rocket/launch/assets/rocket-logo-light.svg" alt="Rocket" width="250" height="67.87" />
+ `,
```
12 changes: 12 additions & 0 deletions packages/launch/assets/rocket-logo-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 13 additions & 4 deletions packages/launch/src/LayoutMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,17 @@ export class LayoutMain extends Layout {
headerDarkBackground: false,
dsdPending: true,
siteName: 'Rocket',
logoSrc: '/icon.svg',
logoAlt: 'Rocket Logo',
logoSmall: html`
<picture>
<!-- <source srcset="resolve:@rocket/launch/assets/rocket-logo-dark.svg" media="(prefers-color-scheme: dark)"> -->
<img
src="resolve:@rocket/launch/assets/rocket-logo-light.svg"
alt="Rocket Logo"
width="250"
height="67.87"
/>
</picture>
`,
gitSiteUrl: 'https://github.com/modernweb-dev/rocket',
gitBranch: 'next',
description: 'A static site generator for modern web development',
Expand Down Expand Up @@ -147,7 +156,7 @@ export class LayoutMain extends Layout {

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

drawer__10: html`
<a class="logo-link" href="/">
<img src="${this.options.logoSrc}" alt="${this.options.logoAlt}" />
${this.options.logoSmall}
<span>${this.options.siteName}</span>
</a>
`,
Expand Down
3 changes: 1 addition & 2 deletions packages/launch/types/layout.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ export interface LayoutSidebarOptions extends LayoutOptions {
[key: TemplateValueKey<'drawer'>]: TemplateValue;

siteName: string;
logoSrc: string;
logoAlt: string;
logoSmall: TemplateValue;
gitSiteUrl: string;
gitBranch: string;
description: string;
Expand Down
11 changes: 11 additions & 0 deletions site/src/layouts/layoutData.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ export const layoutData = {
// head__42: html` <link rel="stylesheet" href="resolve:root/src/assets/styles.css" /> `,
header__40: search,
drawer__30: search,
logoSmall: html`
<picture>
<!-- <source srcset="resolve:#src/assets/rocket-logo-dark.svg" media="(prefers-color-scheme: dark)"> -->
<img
src="resolve:#src/assets/rocket-logo-light.svg"
alt="Rocket Logo"
width="250"
height="67.87"
/>
</picture>
`,
footerMenu: [
{
name: 'Discover',
Expand Down

0 comments on commit d7e461c

Please sign in to comment.