Skip to content

Commit

Permalink
Merge branch 'main' into feat/data-collections-references
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah11918 authored May 18, 2023
2 parents b6f0e48 + 1aa37e7 commit fc64768
Show file tree
Hide file tree
Showing 45 changed files with 2,002 additions and 173 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pnpm install
pnpm start
```

If you’re copying these instructions, remember to [configure this project as a fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-for-a-fork).
If you’re copying these instructions, remember to [configure this project as a fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-repository-for-a-fork).

```shell
git remote add upstream [email protected]:withastro/docs.git
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"p-retry": "^5.1.1",
"parse-numeric-range": "^1.3.0",
"preact": "^10.10.1",
"prettier": "^2.8.1",
"prettier-plugin-astro": "^0.7.0",
"prettier": "^2.8.8",
"prettier-plugin-astro": "^0.8.0",
"prompts": "^2.4.2",
"rehype": "^12.0.1",
"remark": "^14.0.2",
Expand Down
26 changes: 18 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions src/components/PageContent/PageContent.astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ const title = content.title
.replace('@astrojs/', '<span class="scope">@astrojs/</span><wbr>')
.replaceAll('-', '&#8288;-&#8288;');
const isFallback = !!Astro.params.fallback || undefined;
const outdated =
Astro.params.lang === 'en' || Astro.params.fallback
? false
: await isOutdated(
(
await getEntryBySlug('docs', `${Astro.params.lang}/${Astro.params.slug}`)
)?.id!
);
let outdated: boolean;
if (Astro.params.lang === 'en' || Astro.params.fallback) {
outdated = false;
} else {
const currentEntry = await getEntryBySlug('docs', `${Astro.params.lang}/${Astro.params.slug}`);
outdated = await isOutdated(currentEntry?.id!);
}
const lang = getLanguageFromURL(Astro.url.pathname);
const bcpLang = normalizeLangTag(lang);
const direction = rtlLanguages.has(lang) ? 'rtl' : 'ltr';
Expand Down
5 changes: 3 additions & 2 deletions src/components/RecipeLinks.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import { recipePages } from '~/content';
import { getLanguageFromURL, stripLangFromSlug } from '~/util';
import UIString from './UIString.astro';
export interface Props {
slugs: string[];
Expand All @@ -24,7 +25,7 @@ const recipes = Astro.props.slugs.map((slug) => {
});
const isList = recipes.length > 1;
const noun = isList ? 'recipes' : 'recipe';
const labelKey = isList ? 'recipesLink.plural' : 'recipesLink.singular';
const firstRecipe = recipes[0];
if (!firstRecipe) {
throw new Error('No slugs passed to `<RecipeLinks>` component. Make sure you pass at least one.');
Expand All @@ -34,7 +35,7 @@ if (!firstRecipe) {
<div class="root">
<div class="flex">
<img src="/houston_chef.webp" width="26" alt="" />
<strong>Related {noun}:</strong>
<strong><UIString key={labelKey} /></strong>
{
!isList && (
<a href={`/${firstRecipe.entry.slug}/`}>
Expand Down
8 changes: 4 additions & 4 deletions src/components/tabs/AstroJSXTabs.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import Tabs from './Tabs';
<Fragment slot="tab.1.jsx">JSX</Fragment>
<Fragment slot="tab.2.astro">Astro</Fragment>

<Fragment slot="panel.1.jsx"
><slot name="1.jsx" />
<Fragment slot="panel.1.jsx">
<slot name="1.jsx" />
<slot name="jsx" />
</Fragment>
<Fragment slot="panel.2.astro"
><slot name="2.astro" />
<Fragment slot="panel.2.astro">
<slot name="2.astro" />
<slot name="astro" />
</Fragment>
</Tabs>
8 changes: 4 additions & 4 deletions src/components/tabs/AstroVueTabs.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import Tabs from './Tabs';
<Fragment slot="tab.1.vue">Vue</Fragment>
<Fragment slot="tab.2.astro">Astro</Fragment>

<Fragment slot="panel.1.vue"
><slot name="1.vue" />
<Fragment slot="panel.1.vue">
<slot name="1.vue" />
<slot name="vue" />
</Fragment>
<Fragment slot="panel.2.astro"
><slot name="2.astro" />
<Fragment slot="panel.2.astro">
<slot name="2.astro" />
<slot name="astro" />
</Fragment>
</Tabs>
2 changes: 1 addition & 1 deletion src/components/tutorial/TutorialNav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const tutorialPages = getTutorialPages(pages, lang);
const units = getTutorialUnits(tutorialPages);
const makeUnitId = (index: number) => `${Astro.props.id}__tutorial-unit-nav-panel-${index}`;
const isCurrentUnit = (unit: typeof units[number]) =>
const isCurrentUnit = (unit: (typeof units)[number]) =>
unit.lessons.some((lesson) => currentUrl.endsWith(lesson.slug));
---

Expand Down
8 changes: 8 additions & 0 deletions src/content/docs/en/core-concepts/project-structure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,20 @@ Astro processes, optimizes, and bundles your `src/` files to create the final we

Some files (like Astro components) are not even sent to the browser as written but are instead rendered to static HTML. Other files (like CSS) are sent to the browser but may be optimized or bundled with other CSS files for performance.

### `src/assets`

The [`src/assets`](/en/guides/assets/) directory is the recommended folder to use for storing assets (e.g. images) that are processed by Astro. This is not required, and this is not a special reserved folder.

### `src/components`

**Components** are reusable units of code for your HTML pages. These could be [Astro components](/en/core-concepts/astro-components/), or [UI framework components](/en/core-concepts/framework-components/) like React or Vue. It is common to group and organize all of your project components together in this folder.

This is a common convention in Astro projects, but it is not required. Feel free to organize your components however you like!

### `src/content`

The `src/content/` directory is reserved to store [content collections](/en/guides/content-collections/) and an optional collections configuration file. No other files are allowed inside this folder.

### `src/layouts`

[Layouts](/en/core-concepts/layouts/) are a special kind of component that wrap some content in a larger page layout. These are most often used by [Astro pages](/en/core-concepts/astro-pages/) and [Markdown or MDX pages](/en/guides/markdown-content/) to define the layout of the page.
Expand Down
6 changes: 6 additions & 0 deletions src/content/docs/en/editor-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ In addition to local editors, Astro also runs well on in-browser hosted editors,

See [the project's User Guide](https://ota-meshi.github.io/eslint-plugin-astro/user-guide/) for more information on how to install and set up ESLint for your project.

### Stylelint

[Stylelint](https://stylelint.io/) is a popular linter for CSS. [A community maintained Stylelint configuration](https://github.com/ota-meshi/stylelint-config-html) provides Astro support.

Installation instructions, editor integration, and additional information can be found in the project's README.

### Prettier

[Prettier](https://prettier.io/) is a popular formatter for JavaScript, HTML, CSS, and more. If you're using the [Astro VS Code Extension](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode) or [the Astro language server within another editor](#other-code-editors), code formatting with Prettier is included.
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/guides/backend.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ A backend service is a cloud-based system that helps you build and manage your b
## Why would I use a backend service?

You might want to consider a backend service if your project has complex server-side needs, for example:
- user signups and authentication
- persistant data storage
- user sign-ups and authentication
- persistent data storage
- user-uploaded asset storage
- API generation
- realtime communication
Loading

0 comments on commit fc64768

Please sign in to comment.