Skip to content
Merged
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/content/docs/en/tutorial/3-components/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ Since your site will be viewed on different devices, it's time to create a page
---
<div id="main-menu" class="nav-links">
<a href="/">Home</a>
<a href="/about">About</a>
<a href="/blog">Blog</a>
<a href="/about/">About</a>
<a href="/blog/">Blog</a>
</div>
```

Expand Down
14 changes: 7 additions & 7 deletions src/content/docs/en/tutorial/3-components/4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@ Your header is not yet **interactive** because it can't respond to user input, l
Adding a `<script>` tag provides client-side JavaScript to "listen" for a user event and then respond accordingly.

<Steps>
1. Add the following `<script>` tag to `index.astro`, just before the closing `</body>` tag.
1. Add the following `<script>` tag, using Astro's built-in TypeScript support, to `index.astro`, just before the closing `</body>` tag.

```astro title="src/pages/index.astro" ins={2-9}
<Footer />
<script>
const menu = document.querySelector('.menu');

menu.addEventListener('click', () => {
menu?.addEventListener('click', () => {
const isExpanded = menu.getAttribute('aria-expanded') === 'true';
menu.setAttribute('aria-expanded', !isExpanded);
menu.setAttribute('aria-expanded', `${!isExpanded}`);
});
</script>
</body>
Expand All @@ -157,9 +157,9 @@ Instead of writing your JavaScript directly on each page, you can move the conte
```js title="src/scripts/menu.js"
const menu = document.querySelector('.menu');

menu.addEventListener('click', () => {
menu?.addEventListener('click', () => {
const isExpanded = menu.getAttribute('aria-expanded') === 'true';
menu.setAttribute('aria-expanded', !isExpanded);
menu.setAttribute('aria-expanded', `${!isExpanded}`);
});
```

Expand All @@ -170,9 +170,9 @@ Instead of writing your JavaScript directly on each page, you can move the conte
<script>
const menu = document.querySelector('.menu');

menu.addEventListener('click', () => {
menu?.addEventListener('click', () => {
const isExpanded = menu.getAttribute('aria-expanded') === 'true';
menu.setAttribute('aria-expanded', !isExpanded);
menu.setAttribute('aria-expanded', `${!isExpanded}`);
});

import "../scripts/menu.js";
Expand Down
6 changes: 2 additions & 4 deletions src/content/docs/en/tutorial/5-astro-api/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,15 @@ Follow the steps below, then check your work by comparing it to the [final code

1. Copy the `<div class="tags">...</div>` and `<style>...</style>` from `src/pages/tags/index.astro` and reuse it inside `MarkdownPostLayout.astro`:

```astro title="src/layouts/MarkdownPostLayout.astro" ins={13-17, 21-40}
```astro title="src/layouts/MarkdownPostLayout.astro" ins={11-15, 19-37}
---
import BaseLayout from './BaseLayout.astro';
const { frontmatter } = Astro.props;
---
<BaseLayout pageTitle={frontmatter.title}>
<p><em>{frontmatter.description}</em></p>
<p>{frontmatter.pubDate.toString().slice(0,10)}</p>

<p><em>{frontmatter.description}</em></p>
<p>Written by: {frontmatter.author}</p>

<img src={frontmatter.image.url} width="300" alt={frontmatter.image.alt} />

<div class="tags">
Expand Down
14 changes: 9 additions & 5 deletions src/content/docs/en/tutorial/6-islands/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,25 @@ import { CardGrid, LinkCard } from '@astrojs/starlight/components';

There's one more edit to make...

```astro title="src/pages/about.astro" del={5} ins={6}
```astro title="src/pages/about.astro" del={15} ins={16}
---
import BaseLayout from "../layouts/BaseLayout.astro";
const pageTitle = "About Me";
const happy = true;
const finished = false;
const finished = true;
const goal = 3;

const identity = {
firstName: "Sarah",
country: "Canada",
occupation: "Technical Writer",
hobbies: ["photography", "birdwatching", "baseball"],
};

const skills = ["HTML", "CSS", "JavaScript", "React", "Astro", "Writing Docs"];

const happy = true;
const finished = false;
const finished = true;
const goal = 3;

const skillColor = "crimson";
const fontWeight = "bold";
const textCase = "uppercase";
Expand Down