Skip to content

Commit

Permalink
docs: add alert with a link to iconography page
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroedin committed Jan 9, 2025
1 parent 1f764d5 commit 2c2b9f6
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions docs/_includes/layouts/pages/element.11ty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -897,16 +897,24 @@ export default class ElementsPage extends Renderer<Context> {

async #renderPlaygrounds(ctx: Context, entries: FileEntry[]) {
const common = await this.#renderPlaygroundsCommon(ctx, entries);
return entries.map(([filename, config]) => this.#renderPlayground(
filename,
config,
ctx,
common,
entries
.filter(([, config]) => config.inline === filename)
.map(([s]) => s)

));
const { tagName } = ctx;
const iconAlert = (tagName !== 'rh-icon') ? '' : html`<rh-alert state="info">
<h2 slot="header">Looking for the icons?</h2>
<p> Head over to our <a href="/foundations/iconography/">foundations iconography</a> page to explore the full collection.</p>
</rh-alert>
`;
return [
iconAlert,
entries.map(([filename, config]) => this.#renderPlayground(
filename,
config,
ctx,
common,
entries
.filter(([, config]) => config.inline === filename)
.map(([s]) => s)
)),
].join('');
};

#renderPlayground(
Expand Down

0 comments on commit 2c2b9f6

Please sign in to comment.