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

[Docs Site] format astro files #16839

Open
wants to merge 4 commits into
base: production
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
4 changes: 2 additions & 2 deletions src/components/Details.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ const { header, open } = props.parse(Astro.props);
---

<details open={open}>
<summary set:html={marked.parse(header)} />
<slot />
<summary set:html={marked.parse(header)} />
<slot />
</details>
31 changes: 17 additions & 14 deletions src/components/DirectoryListing.astro
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,21 @@ pages.sort(sortBySidebarOrder);
---

<ul>
{
pages.map((page) => {
const description = descriptions && page.data.description;
const href = page.data.external_link ?? "/" + page.slug + "/";
return (
<li>
<a href={href}>{page.data.title}</a>{description &&
<span>: </span>
<Fragment set:html={marked.parseInline(description)} />
}
</li>
);
})
}
{
pages.map((page) => {
const description = descriptions && page.data.description;
const href = page.data.external_link ?? "/" + page.slug + "/";
return (
<li>
<a href={href}>{page.data.title}</a>
{description && (
<>
<span>: </span>
<Fragment set:html={marked.parseInline(description)} />
</>
)}
</li>
);
})
}
</ul>
3 changes: 2 additions & 1 deletion src/components/GlossaryDefinition.astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ if (prepend) {
general_definition = prepend.concat(general_definition);
}

general_definition = general_definition.charAt(0).toUpperCase() + general_definition.slice(1);
general_definition =
general_definition.charAt(0).toUpperCase() + general_definition.slice(1);
---

<Fragment set:html={marked.parse(general_definition)} />
4 changes: 3 additions & 1 deletion src/components/HomepageHero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ if (image) {
<div class="sl-flex copy">
<div class="sl-flex copy links">
<a class="px-2" href="/products/">Products</a>
<a class="px-2" href="/fundamentals/subscriptions-and-billing/">Subscriptions and billing</a>
<a class="px-2" href="/fundamentals/subscriptions-and-billing/"
>Subscriptions and billing</a
>
<a class="px-2" href="/api/">API</a>
<a class="px-2" href="/changelog/">Changelog</a>
<a class="px-2" href="/glossary/">Glossary</a>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Markdown.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { marked } from "marked";
type Props = z.infer<typeof props>;

const props = z.object({
text: z.string(),
text: z.string(),
});

const { text } = props.parse(Astro.props);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<h2>Response</h2>

<p>The response is a binary PNG file.</p>
<p>The response is a binary PNG file.</p>
6 changes: 3 additions & 3 deletions src/components/overrides/SkipLink.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import type { Props } from '@astrojs/starlight/props';
import Default from '@astrojs/starlight/components/SkipLink.astro';
import type { Props } from "@astrojs/starlight/props";
import Default from "@astrojs/starlight/components/SkipLink.astro";
---

<!-- Keep the default skip link in place -->
<Default {...Astro.props}><slot /></Default>
<Default {...Astro.props}><slot /></Default>
57 changes: 44 additions & 13 deletions src/pages/plans.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,22 @@ import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro";
import { ProductFeatures } from "~/components";
---

<StarlightPage frontmatter={{ title: "Plans", template: "splash", description:
"View the products and features available to you based on your Cloudflare plan."}}>

<p>A feature-level companion to our <a href='https://www.cloudflare.com/plans/'>Plans and Pricing page</a></p>
<p style="font-size:.85em;margin-top:-.25em;">(may not include <a href='#missing-features'>all features</a>)</p>
<StarlightPage
frontmatter={{
title: "Plans",
template: "splash",
description:
"View the products and features available to you based on your Cloudflare plan.",
}}
>
<p>
A feature-level companion to our <a href="https://www.cloudflare.com/plans/"
>Plans and Pricing page</a
>
</p>
<p style="font-size:.85em;margin-top:-.25em;">
(may not include <a href="#missing-features">all features</a>)
</p>

<h2 id="account">Account</h2>
<div class="grid grid-cols-2 *:!mt-0">
Expand Down Expand Up @@ -96,12 +107,32 @@ import { ProductFeatures } from "~/components";

<h2 id="missing-features">Missing features</h2>

<p>This page is meant to be a companion to our <a href='https://www.cloudflare.com/plans/'>Plans and Pricing page</a>, but is not meant to be comprehensive. In the event of any inconsistency between this page and the Plans and Pricing page, the Plans and Pricing page controls.</p>
<p>Refer to the following locations for more information:</p>
<ul>
<li><strong>Developer products</strong>: Refer to the <a href='https://www.cloudflare.com/plans/developer-platform/'>Developer Platform pricing page</a> or individual <a href='/products/'>product docs</a> to learn more about plans and pricing.</li>
<li><strong>Zero Trust products</strong>: Refer to the <a href='https://www.cloudflare.com/plans/zero-trust-services/'>Zero Trust pricing</a> page.</li>
<li><strong>Other products</strong>: Refer to the individual <a href='/products/'>product docs</a> to learn more about plans and pricing.</li>
</ul>

<p>
This page is meant to be a companion to our <a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love the split tags personally, but we can change that in a follow-up PR once we get everything standardized in the first place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw I agree. Splitting them makes sense once you're passing 3+ attributes, but just for content feels arbitrary. Can all be tweaked in future as you said - this is mostly just default prettier rules + tabs: https://github.com/cloudflare/cloudflare-docs/blob/production/.prettierrc.mjs

href="https://www.cloudflare.com/plans/">Plans and Pricing page</a
>, but is not meant to be comprehensive. In the event of any inconsistency
between this page and the Plans and Pricing page, the Plans and Pricing page
controls.
</p>
<p>Refer to the following locations for more information:</p>
<ul>
<li>
<strong>Developer products</strong>: Refer to the <a
href="https://www.cloudflare.com/plans/developer-platform/"
>Developer Platform pricing page</a
> or individual <a href="/products/">product docs</a> to learn more about plans
and pricing.
</li>
<li>
<strong>Zero Trust products</strong>: Refer to the <a
href="https://www.cloudflare.com/plans/zero-trust-services/"
>Zero Trust pricing</a
> page.
</li>
<li>
<strong>Other products</strong>: Refer to the individual <a
href="/products/">product docs</a
> to learn more about plans and pricing.
</li>
</ul>
</StarlightPage>
Loading
Loading