Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a widgets page #544

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/components/widgets/Note.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
---
import { Icon } from 'astro-icon/components';

export interface Props {
note?: string;
icon?: string;
subtitle?: string;
}

const {
note = await Astro.slots.render('note'),
icon = await Astro.slots.render('icon'),
subtitle = await Astro.slots.render('subtitle'),
} = Astro.props;
---

<section class="bg-blue-50 dark:bg-slate-800 not-prose">
<div class="max-w-6xl mx-auto px-4 sm:px-6 py-4 text-md text-center font-medium">
<span class="font-bold">
<Icon name="tabler:info-square" class="w-5 h-5 inline-block align-text-bottom" /> Philosophy:</span
> Simplicity, Best Practices and High Performance
<Icon name={icon || 'tabler:info-square'} class="w-5 h-5 inline-block align-text-bottom" /> {subtitle}:</span
>
{note}
</div>
</section>
9 changes: 9 additions & 0 deletions src/components/widgets/WidgetTitle.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
// WidgetTitle.astro
export interface Props {
title?: string;
}
const { title = await Astro.slots.render('title') } = Astro.props;
---

<p class="font-bold tracking-tighter font-heading text-heading text-4xl pb-3">{title}</p>
2 changes: 1 addition & 1 deletion src/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const headerData = {
},
{
text: 'Widgets',
href: '#',
href: getPermalink('/widgets'),
},
],
actions: [{ text: 'Download', href: 'https://github.com/onwidget/astrowind', target: '_blank' }],
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const metadata = {

<!-- Note Widget ******************* -->

<Note />
<Note subtitle="Philosophy" note="Simplicity, Best Practices and High Performance" />

<!-- Features Widget *************** -->

Expand Down
Loading