Skip to content

Commit

Permalink
docs(*): rearrange folder structure in storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
clukhei committed Oct 25, 2024
1 parent db78817 commit aa9f36a
Show file tree
Hide file tree
Showing 20 changed files with 114 additions and 23 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/sync-to-gist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Sync to Gist
on:
push:
branches:
- '3.0.0-alpha'
- 'lab'
jobs:
Root-Gist:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Gist Repo Sync
uses: pentatonicfunk/[email protected]
with:
gist_token: ${{ secrets.GIST_TOKEN }}
gist_id: 425e29332ec837d9ea4bbe90ff8d4a37
source_path: ./src/themes/root.css
3 changes: 2 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ module.exports = {
viteConfigPath: "./.storybook/storybookVite.config.js"
}
}
}
},
staticDirs: ["./static"]
};
4 changes: 3 additions & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export const parameters = {
storySort: {
order: [
"Getting Started",
["Introduction", "Installation", "Imports", "Usage", "Frameworks"],
["Introduction", "Installation", "Imports"],
"Usage",
"Frameworks",
"Troubleshooting",
"Components",
"Patterns",
Expand Down
27 changes: 27 additions & 0 deletions .storybook/static/good-seo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions .storybook/static/poor-seo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed .storybook/static/seo.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/Status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Status
11 changes: 6 additions & 5 deletions docs/WebComponents.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ We are monitoring and evaluating these libraries to help recommend a solution fo

Read more about the <a href="https://web.dev/articles/declarative-shadow-dom" target="_blank">declarative shadow dom </a>.

#### Search Engine Optimisation
### Search Engine Optimisation

Its a myth in 2024 that search engine crawlers like Google and Bing cannot unravel a javascript application. They can , and this means client side rendering does not mean poor SEO! That said, one may argue that it is faster for search engine crawlers to index a pre-rendered HTML page from the SSR apps without running javascript.

As such while constructing our web components, we keep it in mind to make SEO critical information to be part of the light DOM. SEO critical information are usually the textual content you would want to appear in the search engine searches.
Its a myth in 2024 that search engine crawlers like Google and Bing cannot unravel a javascript application. They can , and this means client side rendering does not mean poor SEO!

While constructing our web components, we keep it in mind to make SEO critical information to be part of the light DOM. SEO critical information are usually the textual content or links you would want to be crawled.

We do it by first separating our SEO critical components from non-SEO critical components (because why would one need a progress bar or a spinner or a datepicker to be crawled?)

Expand Down Expand Up @@ -78,7 +77,9 @@ HTML content rendered from the light DOM are available in the HTML that is pre-r
As a developer user, it is also important to be mindful of using the right HTML tags for SEO.
For example, using an anchor tag for links, header tags for header contents.

<img href="./static/seo.png" />
<img src="/poor-seo.svg" alt="poorly optimised for seo" />
<br/>
<img src="/good-seo.svg" alt="better optimised for seo" />

Readings
- https://dev.to/stuffbreaker/seo-and-web-components-2023-edition-3l6i
Expand Down
1 change: 0 additions & 1 deletion scripts/generateStories.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const groupedComponents = groupBy(components, (k, v) => {

for (const [key, value] of Object.entries(groupedComponents)) {
const allMembers = value.map(i => i.members).flat().filter(member => !(member.privacy && member.privacy === 'private'))
if (key==="Radio")console.log(value)
const methodsMeta = methodsTable(value);
const summary = value.filter(i => i.summary).map(i => i.summary).join('<br/>')
const args = allMembers.filter(member => member.kind === 'field');
Expand Down
6 changes: 0 additions & 6 deletions stories/getting-started/Extendable.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion stories/getting-started/Frameworks/Angular.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, Markdown } from "@storybook/blocks";
import Angular from "../../../docs/Angular.md?raw";

<Meta title="Getting Started/Frameworks/Angular" />
<Meta title="Frameworks/Angular" />

<Markdown>{Angular}</Markdown>
2 changes: 1 addition & 1 deletion stories/getting-started/Frameworks/Next.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Meta, Markdown } from "@storybook/blocks";
import NextDocs from "../../../docs/Next.md?raw";

<Meta title="Getting Started/Frameworks/NextJS" />
<Meta title="Frameworks/NextJS" />

<Markdown>{NextDocs}</Markdown>

2 changes: 1 addition & 1 deletion stories/getting-started/Frameworks/React.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, Markdown } from "@storybook/blocks";
import ReactDocs from "../../../docs/React.md?raw";

<Meta title="Getting Started/Frameworks/React" />
<Meta title="Frameworks/React" />

<Markdown>{ReactDocs}</Markdown>
2 changes: 1 addition & 1 deletion stories/getting-started/Frameworks/Vue.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, Markdown } from "@storybook/blocks";
import Vue from "../../../docs/Vue.md?raw";

<Meta title="Getting Started/Frameworks/Vue" />
<Meta title="Frameworks/Vue" />

<Markdown>{Vue}</Markdown>
2 changes: 1 addition & 1 deletion stories/getting-started/Usage/Attributes.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, Markdown } from "@storybook/blocks";
import AttributeAndProperties from '../../../docs/Attributes.md?raw';

<Meta title="Getting Started/Usage/Attribute and Properties" />
<Meta title="Usage/Attribute and Properties" />

<Markdown>{AttributeAndProperties}</Markdown>
2 changes: 1 addition & 1 deletion stories/getting-started/Usage/Events.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, Markdown } from '@storybook/blocks';
import Events from '../../../docs/Events.md?raw';

<Meta title="Getting Started/Usage/Events" />
<Meta title="Usage/Events" />

<Markdown>{Events}</Markdown>
6 changes: 6 additions & 0 deletions stories/getting-started/Usage/Extendable.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Meta, Markdown } from '@storybook/blocks';
import Extendable from '../../../docs/Extendable.md?raw';

<Meta title="Usage/Extending the library" />

<Markdown>{Extendable}</Markdown>
2 changes: 1 addition & 1 deletion stories/getting-started/Usage/ScopedElements.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Meta, Markdown } from "@storybook/blocks";
import ScopedElements from "../../../docs/ScopedElements.md?raw";
import { getCustomElements } from "@storybook/web-components";

<Meta title="Getting Started/Usage/Scoped Elements" />
<Meta title="Usage/Scoped Elements" />

<Markdown>{ScopedElements}</Markdown>

Expand Down
2 changes: 1 addition & 1 deletion stories/getting-started/Usage/Slots.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, Markdown } from '@storybook/blocks';
import Slots from '../../../docs/Slots.md?raw';

<Meta title="Getting Started/Usage/Slots" />
<Meta title="Usage/Slots" />

<Markdown>{Slots}</Markdown>
2 changes: 1 addition & 1 deletion stories/getting-started/Usage/Stylings.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, Markdown } from "@storybook/blocks";
import Stylings from '../../../docs/Stylings.md?raw';

<Meta title="Getting Started/Usage/Stylings" />
<Meta title="Usage/Styles and Theming" />

<Markdown>{Stylings}</Markdown>

0 comments on commit aa9f36a

Please sign in to comment.