Skip to content

Commit 2381a12

Browse files
committed
Replace onwidget with arthelokyo
1 parent ed3cc87 commit 2381a12

File tree

15 files changed

+29
-201
lines changed

15 files changed

+29
-201
lines changed

src/components/widgets/Announcement.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<a
1616
target="_blank"
1717
rel="noopener"
18-
class="ltr:ml-auto rtl:mr-auto w-[5.6rem] h-[1.25rem] ml-auto bg-contain inline-block bg-[url(https://img.shields.io/github/stars/onwidget/astrowind.svg?style=social&label=Stars&maxAge=86400)]"
18+
class="ltr:ml-auto rtl:mr-auto w-[5.6rem] h-[1.25rem] ml-auto bg-contain inline-block bg-[url(https://img.shields.io/github/stars/arthelokyo/astrowind.svg?style=social&label=Stars&maxAge=86400)]"
1919
title="If you like AstroWind, give us a star."
2020
href="https://github.com/arthelokyo/astrowind"
2121
>

src/data/post/astrowind-template-in-depth.mdx

Lines changed: 11 additions & 183 deletions
Original file line numberDiff line numberDiff line change
@@ -12,196 +12,24 @@ metadata:
1212
canonical: https://astrowind.vercel.app/astrowind-template-in-depth
1313
---
1414

15-
import DListItem from '~/components/ui/DListItem.astro';
16-
import ToggleTheme from '~/components/common/ToggleTheme.astro';
15+
## Mauris velit laoreet vitae cursus augue
1716

18-
## Overview
17+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. **Pellentesque** euismod, nibh ac aliquam aliquam, dui nulla ultrices erat, sit amet dictum nisl ex id nunc. Sed malesuada, orci vitae tempus euismod, nunc erat semper nisi, in aliquet nibh nisl eget nulla. Donec eget ipsum vitae nibh blandit consequat. Donec facilisis, nibh id aliquam fermentum, mi lorem molestie nisl, id posuere nisi nisi at nulla.
1918

20-
It can be a somewhat daunting task trying to get a handle on _AstroWind_ internals, and particularly various points of usage.
19+
Duis euismod, nulla sit amet mattis euismod, nibh nunc rhoncus nibh, id interdum nunc nisl id lorem. Donec id nunc quis nulla aliquam cursus. Integer vitae nunc nunc. Sed sed nulla vitae nibh interdum gravida. Sed a nunc nibh.
2120

22-
This page outlines and clarifies some of the techniques found in _AstroWind_. Use it as a guide for further modification, or an instructional for techniques to use in your own endeavors.
21+
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer euismod, nunc eu lobortis mattis, lectus sem sagittis nunc, id laoreet nunc metus id lectus. Sed consectetur, urna at euismod consectetur, nunc nisi bibendum nibh, ut rhoncus nibh nunc vel mi.
2322

24-
## Styling
23+
Nam eget nunc massa. Nulla facilisi. Sed a ligula vel nunc porta sollicitudin. **Pellentesque** vel mauris vitae nibh varius feugiat. Fusce eget nunc id ligula bibendum venenatis.
2524

26-
As the name suggests, _AstroWind_ relies on _TailWind_ for styling. Furthermore, _AstroWind_ defines custom low level style settings which are incorporated into _TailWind_ seamlessly, and which provides consistency for higher level styling constructs, as well as enabling dark mode.
25+
### Nisi rutrum eros euismod
2726

28-
The styling mechanism consists of the following files (all paths are prefixed with `/src/` ):
27+
Maecenas eget justo sed nibh consequat vulputate. Sed euismod neque vel nunc rhoncus, nec tincidunt nisl laoreet. Sed euismod justo id nulla varius, id cursus nibh tincidunt. Sed euismod est et nunc consectetur, id tempus nibh euismod.
2928

30-
<DListItem dt="assets/styles/tailwind.css">
31-
This file is essentially an extension of _TailWind's_ base.css. High-level component styles are defined here. Note
32-
also styling on elements selected by 'attribute' selectors at the bottom of the files, particularly those selected by
33-
'data' attributes.
34-
</DListItem>
35-
<DListItem dt="components/CustomStyles.astro">
36-
Defines custom colors and fonts. For these to take effect in the 'base.css' file, they need to be loaded in the html
37-
header section. See next.
38-
</DListItem>
39-
<DListItem dt="layouts/Layout.astro">
40-
This layout is used for all of the pages rendered by _AstroWind_. The contents of _tailwind.css_ and
41-
_CustomStyles.astro_ component, described above, is injected into the html header.
42-
</DListItem>
29+
In hac habitasse platea dictumst. Integer euismod, nunc eu lobortis mattis, lectus sem sagittis nunc, id laoreet nunc metus id lectus. Aenean sagittis, ligula vel blandit aliquam, nisl nunc euismod elit, nec tincidunt lectus nunc vitae nunc. Sed euismod justo id nulla varius, id cursus nibh tincidunt. Sed euismod est et nunc consectetur, id tempus nibh euismod.
4330

44-
### Dark Mode
31+
### Nisi rutrum eros euismod
4532

46-
_Dark Mode_ is triggered by the little 'sunlight' icon:<ToggleTheme/>in the page header. It is defined in the _components/common/ToggleTheme.astro_, but the event is attached and the action defined in _components/common/BasicScripts.astro_ in the following snippet:
33+
Quisque euismod lectus ac nunc dictum, id eleifend nunc euismod. Sed euismod, nunc eu lobortis mattis, lectus sem sagittis nunc, id laoreet nunc metus id lectus. Sed consectetur, urna at euismod consectetur, nunc nisi bibendum nibh, ut rhoncus nibh nunc vel mi.
4734

48-
```javascript
49-
attachEvent('[data-aw-toggle-color-scheme]', 'click', function () {
50-
if (defaultTheme.endsWith(':only')) {
51-
return;
52-
}
53-
document.documentElement.classList.toggle('dark');
54-
localStorage.theme = document.documentElement.classList.contains('dark') ? 'dark' : 'light';
55-
});
56-
```
57-
58-
Note that this is a client event. _BasicScripts.astro_ defines several other client-side functionality as well as this one.
59-
60-
## Advanced Slot Usage
61-
62-
_slots_ are part of the component implementation, which is a common concept among many frameworks, including _Astrojs_. The typical slot definition in a component looks like this:
63-
64-
```astro
65-
---
66-
// (file: MyComponent.astro)
67-
const { title } = Astro.props;
68-
export interface Props {
69-
title: string;
70-
}
71-
---
72-
73-
<div>
74-
<h2>{title}</h2>
75-
<slot />
76-
<!-- slot contents injected here -->
77-
<div></div>
78-
</div>
79-
```
80-
81-
And in usage elsewhere:
82-
83-
```astro
84-
import MyComponent from "~/components/MyComponent"; ...
85-
<MyComponent someArg="A Slot example">
86-
<p>This content will be displayed in the slot</p>
87-
</MyComponent>
88-
```
89-
90-
### Alternate usage
91-
92-
There's another way we can use slots, useful particularly when a component can have markdown content is as follows (study carefully...):
93-
94-
```astro
95-
---
96-
// (file: MyComponent.astro)
97-
98-
const { title } = Astro.props;
99-
export interface Props {
100-
title: string;
101-
}
102-
const content: string = await Astro.props.render('default');
103-
---
104-
105-
// renders the html to the 'content' variable
106-
<div>
107-
<h2>{title}</h2>
108-
<div set:html={content} />
109-
<!-- slot contents injected here -->
110-
<div></div>
111-
</div>
112-
```
113-
114-
Whoa!! What's going on here?
115-
116-
Notice there is no slot definition in the html portion of the component. Instead, what we do is have _Astro_ render the slot content (here, the 'default' content, but you can also render named slots) into a variable, and then use that content in a _div_ (for instance).
117-
118-
So, if the usage is in a markdown file, like so:
119-
120-
```mdx
121-
import MyComponent from '../../components/MyComponent';
122-
123-
# Using the above component in a .mdx file (that can take components)
124-
125-
{' '}
126-
127-
<MyComponent title="This is a slot implementor">### Here is some markdown content - With a bullet item.</MyComponent>
128-
```
129-
130-
_MyComponent_ renders the markdown to html and then injects it into the div.
131-
132-
This actually has a big advantage -- consider that with the normal usage you don't have access to the slot contents: _Astro_ just plops the content into the _&lt;slot/&gt;_ tag. Using this method, however, allows you to access the content and further manipulate it before it gets inserted into the html.
133-
134-
This allows a great deal of flexibility in component design.
135-
136-
### Yet Another Step
137-
138-
Now, we get to the techniques used in _AstroWind_, we'll use the _pages/index.astro_ file to illustrate.
139-
140-
You'll note that the index file imports a lot of components, each one roughly analogous to a panel in the index page. Each of these components, in turn, is instantiated sequentially throughout the page. But, you'll notice that some of them use this kind of construct (we'll use the last section, _CallToAction_, as it is most illustrative of the technique):
141-
142-
```astro
143-
<CallToAction
144-
callToAction={{
145-
text: 'Get template',
146-
href: 'https://github.com/onwidget/astrowind',
147-
icon: 'tabler:download',
148-
}}
149-
>
150-
<Fragment slot="title">
151-
Astro + <br class="block sm:hidden" /><span class="sm:whitespace-nowrap">Tailwind CSS</span>
152-
</Fragment>
153-
154-
<Fragment slot="subtitle">
155-
Be very surprised by these huge fake numbers you are seeing on this page. <br class="hidden md:inline" />Don't waste
156-
more time! :P
157-
</Fragment>
158-
</CallToAction>
159-
```
160-
161-
Some things to note, here:
162-
163-
<DListItem dt="The <em>callToAction</em> argument">
164-
This argument is actually being passed a javascript object -- not a string. (However, in the TS definition, it could
165-
be a string...)
166-
</DListItem>
167-
<DListItem dt="There are several <em>Fragment</em> children">
168-
Furthermore, these &lt;Fragment/&gt; elements each have a _slot="(value)"_ specifier.
169-
</DListItem>
170-
171-
The latter seems odd, because &lt;Fragment/&gt; is a built-in component over which you have no control, and doesn't have a provision for rendering slots, <em>per se</em>.
172-
173-
The answer lies in a paragraph in the _Astro_ docs, slots section, which states:
174-
175-
> Use a `slot="my-slot"` attribute on the child element that you want to pass through to a matching slot `name="my-slot" />` placeholder in your component.
176-
177-
That's pretty concise and a bit of a head-scratcher to read, but basically what it says is that:
178-
179-
1. Given a component that defines a slot:
180-
1. you can reference a slot from a child element of that component and,
181-
1. provide content to the parent component's slot from the child by naming the slot in the child with a `slot="<slot-name>"` property assignment, where the _slot-name_ is the parent's slot.
182-
183-
So, in the example above, the _CallToAction_ component defines the _subtitle_ slot, and the following _&lt;Fragment slot="subtitle"&gt;_ populates the slot with the following content:
184-
185-
```astro
186-
<Fragment slot="subtitle">
187-
Be very surprised by these huge fake numbers you are seeing on this page. <br class="hidden md:inline" />Don't waste
188-
more time! :P
189-
</Fragment>
190-
```
191-
192-
And, the _CallToAction_ component defines and renders it thusly:
193-
194-
```astro
195-
---
196-
//...
197-
const { subtitle = await Astro.slots.render('subtitle') } = Astro.props;
198-
---
199-
200-
//...
201-
{subtitle && <p class="text-xl text-muted dark:text-slate-400" set:html={subtitle} />}
202-
//...
203-
```
204-
205-
There's a lot to wrap your head around, here.
206-
207-
Notice first that _subtitle_ is defined as a prop/argument, but it's being processed as a slot. Interestingly, prop args and slots seem to be somewhat interchangeable: if the subtitle was just a string, it would simply take that assignment. The main difference is that if you render them independently, you have to call the render with an _await_ modifier.
35+
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed euismod est et nunc consectetur, id tempus nibh euismod.

src/layouts/LandingLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const { metadata } = Astro.props;
2323
actions={[
2424
{
2525
text: 'Download',
26-
href: 'https://github.com/onwidget/astrowind',
26+
href: 'https://github.com/arthelokyo/astrowind',
2727
},
2828
]}
2929
showToggleTheme

src/pages/homes/mobile-app.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import Button from '~/components/ui/Button.astro';
1515
import Image from '~/components/common/Image.astro';
1616
1717
const appStoreImg = '~/assets/images/app-store.png';
18-
const appStoreDownloadLink = 'https://github.com/onwidget/astrowind';
18+
const appStoreDownloadLink = 'https://github.com/arthelokyo/astrowind';
1919
2020
const googlePlayImg = '~/assets/images/google-play.png';
21-
const googlePlayDownloadLink = 'https://github.com/onwidget/astrowind';
21+
const googlePlayDownloadLink = 'https://github.com/arthelokyo/astrowind';
2222
2323
const metadata = {
2424
title: 'Mobile App Homepage',
@@ -240,7 +240,7 @@ const metadata = {
240240
callToAction={{
241241
target: '_blank',
242242
text: 'Read more testimonials',
243-
href: 'https://github.com/onwidget/astrowind',
243+
href: 'https://github.com/arthelokyo/astrowind',
244244
icon: 'tabler:chevron-right',
245245
}}
246246
/>

src/pages/homes/personal.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const metadata = {
2626
{ text: 'Resume', href: '#resume' },
2727
{ text: 'Porfolio', href: '#porfolio' },
2828
{ text: 'Blog', href: '#blog' },
29-
{ text: 'Github', href: 'https://github.com/onwidget' },
29+
{ text: 'Github', href: 'https://github.com/arthelokyo' },
3030
]}
3131
actions={[
3232
{

src/pages/homes/saas.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const metadata = {
4242
<Hero2
4343
tagline="SaaS Web Demo"
4444
actions={[
45-
{ variant: 'primary', target: '_blank', text: 'Get Started', href: 'https://github.com/onwidget/astrowind' },
45+
{ variant: 'primary', target: '_blank', text: 'Get Started', href: 'https://github.com/arthelokyo/astrowind' },
4646
{ text: 'Learn more', href: '#features' },
4747
]}
4848
image={{

src/pages/homes/startup.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const metadata = {
2828
variant: 'primary',
2929
target: '_blank',
3030
text: 'Get templates',
31-
href: 'https://github.com/onwidget/astrowind',
31+
href: 'https://github.com/arthelokyo/astrowind',
3232
icon: 'tabler:download',
3333
},
3434
{ text: 'Learn more', href: '#features' },
@@ -302,7 +302,7 @@ const metadata = {
302302
variant: 'primary',
303303
target: '_blank',
304304
text: 'Get templates',
305-
href: 'https://github.com/onwidget/astrowind',
305+
href: 'https://github.com/arthelokyo/astrowind',
306306
icon: 'tabler:download',
307307
},
308308
]}

src/pages/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const metadata = {
2626
{
2727
variant: 'primary',
2828
text: 'Get template',
29-
href: 'https://github.com/onwidget/astrowind',
29+
href: 'https://github.com/arthelokyo/astrowind',
3030
target: '_blank',
3131
icon: 'tabler:download',
3232
},
@@ -381,7 +381,7 @@ const metadata = {
381381
{
382382
variant: 'primary',
383383
text: 'Get template',
384-
href: 'https://github.com/onwidget/astrowind',
384+
href: 'https://github.com/arthelokyo/astrowind',
385385
target: '_blank',
386386
icon: 'tabler:download',
387387
},

src/pages/landing/click-through.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const metadata = {
3333
{
3434
variant: 'primary',
3535
text: 'Download Template',
36-
href: 'https://github.com/onwidget/astrowind',
36+
href: 'https://github.com/arthelokyo/astrowind',
3737
icon: 'tabler:download',
3838
},
3939
]}

src/pages/landing/lead-generation.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const metadata = {
3333
{
3434
variant: 'primary',
3535
text: 'Download Template',
36-
href: 'https://github.com/onwidget/astrowind',
36+
href: 'https://github.com/arthelokyo/astrowind',
3737
icon: 'tabler:download',
3838
},
3939
]}

0 commit comments

Comments
 (0)