Skip to content

Commit 9e7f8b0

Browse files
authored
Merge branch 'main' into ccjsonschema
2 parents 3542234 + de54a73 commit 9e7f8b0

146 files changed

Lines changed: 7879 additions & 711 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/welcome-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
If they spot any broken links you will see some error messages on this PR.
2727
Don’t hesitate to ask any questions if you’re not sure what these mean!
2828
29-
2. In a few minutes, you’ll be able to see a preview of your changes on Vercel 🥳
29+
2. In a few minutes, you’ll be able to see a preview of your changes on Netlify 🥳.
3030
3131
3. One or more of our maintainers will take a look and may ask you to make changes.
3232
We try to be responsive, but don’t worry if this takes a few days.

astro.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export default defineConfig({
3232
TableOfContents: './src/components/starlight/TableOfContents.astro',
3333
PageSidebar: './src/components/starlight/PageSidebar.astro',
3434
Pagination: './src/components/starlight/Pagination.astro',
35+
Footer: './src/components/starlight/Footer.astro',
3536
SiteTitle: './src/components/starlight/SiteTitle.astro',
3637
Search: './src/components/starlight/Search.astro',
3738
Sidebar: './src/components/starlight/Sidebar.astro',

config/sidebar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type StarlightSidebarConfig = NonNullable<Parameters<typeof starlight>[0]['sideb
2222

2323
/** Generate a Starlight sidebar config object from our existing `nav.ts` files. */
2424
export function makeSidebar(): StarlightSidebarConfig {
25-
let currentSubGroup: Extract<StarlightSidebarConfig[number], { items: any }>;
25+
let currentSubGroup: Extract<StarlightSidebarConfig[number], { items: StarlightSidebarConfig }>;
2626
return navTranslations.en.reduce((sidebar, item) => {
2727
if ('header' in item) {
2828
const newGroup = {

public/logos/craft-cms.svg

Lines changed: 13 additions & 0 deletions
Loading

src/components/BackendGuidesNav.astro

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,9 @@ import CardsNav from './NavGrid/CardsNav.astro';
88
const lang = getLanguageFromURL(Astro.url.pathname);
99
const enPages = englishPages.filter(isBackendEntry);
1010
11-
/** Array of services we have good content for and want to show first in the list. */
12-
const showFirst = ['Firebase'];
13-
// Reverse the array to make our logic simpler later.
14-
showFirst.reverse();
15-
1611
const links = enPages
1712
.sort((a, b) => {
18-
// Sort services in the `showFirst` array first.
19-
const aPriority = showFirst.indexOf(a.data.service);
20-
const bPriority = showFirst.indexOf(b.data.service);
21-
if (aPriority !== -1 || bPriority !== -1) return aPriority > bPriority ? -1 : 1;
22-
// Sort full guides before stubs.
23-
if (a.data.stub && !b.data.stub) return 1;
24-
if (!a.data.stub && b.data.stub) return -1;
25-
// If they’re both stubs, or neither stubs, sort alphabetically.
13+
// Sort alphabetically.
2614
return a.data.service.toLowerCase() > b.data.service.toLowerCase() ? 1 : -1;
2715
})
2816
.map((page) => {

src/components/CMSGuidesNav.astro

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,9 @@ import CardsNav from './NavGrid/CardsNav.astro';
88
const lang = getLanguageFromURL(Astro.url.pathname);
99
const enPages = englishPages.filter(isCmsEntry);
1010
11-
/** Array of services we have good content for and want to show first in the list. */
12-
const showFirst = ['Storyblok', 'Contentful', 'ButterCMS'];
13-
// Reverse the array to make our logic simpler later.
14-
showFirst.reverse();
15-
1611
const links = enPages
1712
.sort((a, b) => {
18-
// Sort services in the `showFirst` array first.
19-
const aPriority = showFirst.indexOf(a.data.service);
20-
const bPriority = showFirst.indexOf(b.data.service);
21-
if (aPriority !== -1 || bPriority !== -1) return aPriority > bPriority ? -1 : 1;
22-
// Sort full guides before stubs.
23-
if (a.data.stub && !b.data.stub) return 1;
24-
if (!a.data.stub && b.data.stub) return -1;
25-
// If they’re both stubs, or neither stubs, sort alphabetically.
13+
// Sort alphabetically.
2614
return a.data.service.toLowerCase() > b.data.service.toLowerCase() ? 1 : -1;
2715
})
2816
.map((page) => {

src/components/FooterLinks.astro

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
import { Icon } from '@astrojs/starlight/components';
3+
import FeedbackButton from '../components/tutorial/FeedbackButton.astro';
4+
import { useTranslations } from '~/i18n/util';
5+
import { getLanguageFromURL } from '~/util';
6+
7+
const t = useTranslations(Astro);
8+
const lang = getLanguageFromURL(Astro.url.pathname);
9+
---
10+
11+
<section class="sl-flex">
12+
<a href={`/${lang}/contribute/`} class="sl-flex">
13+
<Icon name="open-book" size="1.2em" />
14+
{t('rightSidebar.contribute')}
15+
</a>
16+
17+
<FeedbackButton />
18+
19+
<a href="https://community.astro.build" class="sl-flex">
20+
<Icon name="heart" size="1.2em" />
21+
{t('rightSidebar.community')}
22+
</a>
23+
</section>
24+
25+
<style>
26+
section {
27+
justify-content: center;
28+
flex-wrap: wrap;
29+
gap: 0.5rem 1.5rem;
30+
font-size: var(--sl-text-sm);
31+
}
32+
33+
a {
34+
align-items: center;
35+
text-decoration: none;
36+
gap: 0.5rem;
37+
color: var(--sl-color-gray-3);
38+
}
39+
40+
a:hover {
41+
color: var(--sl-color-white);
42+
}
43+
</style>

src/components/LeftSidebar/Sponsors.astro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import UIString from '../UIString.astro';
44

55
<div dir="ltr" lang="en" class="sponsors">
66
<h2 class="sponsors-title"><UIString key="leftSidebar.sponsoredBy" /></h2>
7-
<a href="https://netlify.com/" aria-label="Netlify">
7+
<a
8+
href="https://www.netlify.com/?utm_campaign=Astro-2024&utm_source=astro-referral"
9+
aria-label="Netlify"
10+
>
811
<svg xmlns="http://www.w3.org/2000/svg" width="96" viewBox="0 0 256 105" aria-hidden="true">
912
<path
1013
fill="#32E6E2"

src/components/MigrationGuidesNav.astro

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,9 @@ const lang = getLanguageFromURL(Astro.url.pathname);
99
1010
const enPages = englishPages.filter(isMigrationEntry);
1111
12-
/** Array of frameworks we have good content for and want to show first in the list. */
13-
const showFirst: string[] = [];
14-
// Reverse the array to make our logic simpler later.
15-
showFirst.reverse();
16-
1712
const links = enPages
1813
.sort((a, b) => {
19-
// Sort frameworks in the `showFirst` array first.
20-
const aPriority = showFirst.indexOf(a.data.framework);
21-
const bPriority = showFirst.indexOf(b.data.framework);
22-
if (aPriority !== -1 || bPriority !== -1) return aPriority > bPriority ? -1 : 1;
23-
// Sort full guides before stubs.
24-
if (a.data.stub && !b.data.stub) return 1;
25-
if (!a.data.stub && b.data.stub) return -1;
26-
// If they’re both stubs, or neither stubs, sort alphabetically.
14+
// Sort alphabetically.
2715
return a.data.framework.toLowerCase() > b.data.framework.toLowerCase() ? 1 : -1;
2816
})
2917
.map((page) => {

src/components/starlight/EditLink.astro

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
import { Icon } from '@astrojs/starlight/components';
33
import type { Props } from '@astrojs/starlight/props';
4+
import { useTranslations } from '~/i18n/util';
45
56
const { editUrl, labels, entry, locale, isFallback } = Astro.props;
67
8+
const t = useTranslations(Astro);
79
const githubEditUrl =
810
entry.data.githubURL && (locale === 'en' || isFallback)
911
? `${entry.data.githubURL}${entry.data.hasREADME ? 'README.md' : ''}`
@@ -12,14 +14,24 @@ const githubEditUrl =
1214

1315
{
1416
editUrl && (
15-
<a href={githubEditUrl} class="sl-flex">
16-
<Icon name="pencil" size="1.2em" />
17-
{labels['page.editLink']}
18-
</a>
17+
<div class="sl-flex">
18+
<a href={githubEditUrl} class="sl-flex">
19+
<Icon name="pencil" size="1.2em" />
20+
{labels['page.editLink']}
21+
</a>
22+
<a href="https://contribute.docs.astro.build/guides/i18n/" class="sl-flex">
23+
<Icon name="translate" size="1.2em" /> {t('rightSidebar.translatePage')}
24+
</a>
25+
</div>
1926
)
2027
}
2128

2229
<style>
30+
div {
31+
flex-wrap: wrap;
32+
gap: 0.5rem 1.5rem;
33+
font-size: var(--sl-text-sm);
34+
}
2335
a {
2436
gap: 0.5rem;
2537
align-items: center;

0 commit comments

Comments
 (0)