feat: backup blog posts and fix WordPress caption shortcodes in markdown files
This commit is contained in:
@@ -129,7 +129,7 @@ import MyComponent from '../../components/MyComponent';
|
||||
|
||||
_MyComponent_ renders the markdown to html and then injects it into the div.
|
||||
|
||||
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 _<slot/>_ tag. Using this method, however, allows you to access the content and further manipulate it before it gets inserted into the html.
|
||||
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 _<slot/>_ tag. Using this method, however, allows you to access the content and further manipulate it before it gets inserted into the html.
|
||||
|
||||
This allows a great deal of flexibility in component design.
|
||||
|
||||
@@ -165,10 +165,10 @@ Some things to note, here:
|
||||
be a string...)
|
||||
</DListItem>
|
||||
<DListItem dt="There are several <em>Fragment</em> children">
|
||||
Furthermore, these <Fragment/> elements each have a _slot="(value)"_ specifier.
|
||||
Furthermore, these <Fragment/> elements each have a _slot="(value)"_ specifier.
|
||||
</DListItem>
|
||||
|
||||
The latter seems odd, because <Fragment/> is a built-in component over which you have no control, and doesn't have a provision for rendering slots, <em>per se</em>.
|
||||
The latter seems odd, because <Fragment/> is a built-in component over which you have no control, and doesn't have a provision for rendering slots, <em>per se</em>.
|
||||
|
||||
The answer lies in a paragraph in the _Astro_ docs, slots section, which states:
|
||||
|
||||
@@ -180,7 +180,7 @@ That's pretty concise and a bit of a head-scratcher to read, but basically what
|
||||
1. you can reference a slot from a child element of that component and,
|
||||
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.
|
||||
|
||||
So, in the example above, the _CallToAction_ component defines the _subtitle_ slot, and the following _<Fragment slot="subtitle">_ populates the slot with the following content:
|
||||
So, in the example above, the _CallToAction_ component defines the _subtitle_ slot, and the following _<Fragment slot="subtitle">_ populates the slot with the following content:
|
||||
|
||||
```astro
|
||||
<Fragment slot="subtitle">
|
||||
|
||||
Reference in New Issue
Block a user