generated from onwidget/astrowind
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from GrantBirki/snappy-fix
Snappy Fix - Locations Component
- Loading branch information
Showing
5 changed files
with
116 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Hero configuration on the homepage | ||
|
||
const hero = { | ||
// If the entire hero section should be enabled or not | ||
enabled: true, | ||
|
||
// Hero title with HTML support | ||
title: { | ||
enabled: true, // If the title should be enabled or not | ||
text: `Store Locations`, | ||
}, | ||
|
||
// Hero subtitle with HTML support | ||
subtitle: { | ||
enabled: true, // If the subtitle should be enabled or not | ||
text: `We have two downtown store locations`, | ||
}, | ||
|
||
// First CTA block | ||
callToAction: { | ||
// Enable or disable first CTA | ||
enabled: false, | ||
// CTA text | ||
text: 'Get template', | ||
// CTA link | ||
href: 'https://github.com/grantbirki/astrowind', | ||
// Target html <a> tag | ||
target: '_blank', | ||
// Rel html <a> tag | ||
rel: 'noopener', | ||
// CTA icon | ||
icon: 'tabler:download', | ||
}, | ||
|
||
// Second CTA block (optional) | ||
callToAction2: { | ||
// Enable or disable second CTA | ||
enabled: true, | ||
// CTA text | ||
text: 'Learn more', | ||
// CTA link | ||
href: '#features', | ||
// Target html <a> tag | ||
target: '_blank', | ||
// Rel html <a> tag | ||
rel: 'noopener', | ||
icon: 'tabler:book', | ||
}, | ||
|
||
// Hero image | ||
image: { | ||
// If the image should be enabled or not | ||
enabled: true, | ||
// Image source | ||
src: import('~/assets/images/hero.png'), | ||
// Image alt text | ||
alt: 'AstroWind Hero Image', | ||
}, | ||
}; | ||
|
||
export default hero; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
import { SITE } from '~/config/site/config.js'; | ||
import Layout from '~/layouts/PageLayout.astro'; | ||
import Hero from '~/components/widgets/Hero.astro'; | ||
import Locations from '~/components/widgets/Locations.jsx'; | ||
import hero from '~/config/pages/stores/hero'; | ||
import locations from '~/config/pages/stores/locations'; | ||
const meta = { | ||
title: SITE.title, | ||
description: SITE.description, | ||
dontUseTitleTemplate: true, | ||
}; | ||
--- | ||
|
||
<Layout {meta}> | ||
<!-- Hero Widget ******************* --> | ||
|
||
{ | ||
hero && hero.enabled && ( | ||
<Hero | ||
callToAction={{ | ||
enabled: hero.callToAction.enabled, | ||
text: hero.callToAction.text, | ||
href: hero.callToAction.href, | ||
target: hero.callToAction.target, | ||
rel: hero.callToAction.rel, | ||
icon: hero.callToAction.icon, | ||
}} | ||
> | ||
{hero.title.enabled && <Fragment slot="title" set:html={hero.title.text} />} | ||
|
||
{hero.subtitle.enabled && <Fragment slot="subtitle" set:html={hero.subtitle.text} />} | ||
</Hero> | ||
) | ||
} | ||
<!-- Locations Widget ****************** --> | ||
{ | ||
locations && locations.enabled && locations.locations.length > 0 && ( | ||
<Locations | ||
client:only="react" | ||
highlight={locations.highlight} | ||
title={locations.title} | ||
subtitle={locations.subtitle} | ||
locations={locations.locations} | ||
/> | ||
) | ||
} | ||
</Layout> |