Skip to content

Commit 8dc7b59

Browse files
authored
Merge pull request #1060 from skyash-dev/docs/multiple-small-fixes
fix: multiple small documentation issues across tutorials and reference
2 parents fc79369 + 9fcc137 commit 8dc7b59

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/components/PageHeader/RootPage.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const borderStyle = isFilterRoute ? "" : "border-b border-sidebar-type-color";
1212
---
1313

1414
<div
15-
class=`content-grid-simple min-h-[350px] h-[50vh] pt-[11.25rem] lg:pt-4xl bg-accent-color text-accent-type-color pb-md px-5 md:px-lg ${borderStyle}`
15+
class=`content-grid-simple min-h-[350px] pt-[11.25rem] lg:pt-4xl bg-accent-color text-accent-type-color pb-md px-5 md:px-lg ${borderStyle}`
1616
>
1717
<h1 class="whitespace-pre-line col-span-full mb-5">{title}</h1>
1818
<p class="text-h3 !mt-0 mb-3xl col-span-2">{subtitle}</p>

src/content/tutorials/en/conditionals-and-interactivity.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ function draw() {
524524

525525
  fill("green");
526526

527-
  rect(0, horizon, 400, 400);
527+
  rect(0, horizon, 400, 200);
528528

529529
}
530530
```

src/content/tutorials/en/repeating-with-loops.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Above `setup()`:
199199
In `draw()`:
200200

201201
- After the code that draws the finish line, declare a new local variable `x` to position all the body segments: `let x = circX;`
202-
- Add a *for loop* using: `for (let i = 0; i < length; i += 1) { }`
202+
- Add a *for loop* using: `for (let i = 0; i < segments; i += 1) { }`
203203
- A *for loop* will repeat the code we write inside the curly brackets multiple times. 
204204
- Move the lines of code that draw the `circle()` into the curly brackets of the *for loop*.
205205
- After the for loop, add: `circX += spacing` 
@@ -936,7 +936,7 @@ function moveCaterpillars() {
936936
  for (let i = 0; i < numCaterpillars; i += 1) {
937937
    //Give each caterpillar a
938938
    //random speed.
939-
    move = random(5, 30);
939+
    let move = random(5, 30);
940940
    caterpillarEnds[i] += move;
941941
}
942942
}
@@ -1001,7 +1001,7 @@ function moveCaterpillars() {
10011001
  for (let i = 0; i < numCaterpillars; i += 1) {
10021002
    //Give each caterpillar a
10031003
    //random speed.
1004-
    move = random(5, 30);
1004+
    let move = random(5, 30);
10051005
10061006
    // Update caterpillars' x-coordinates
10071007
    caterpillarEnds[i] += move;

src/pages/_utils-node.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ export const removeNestedReferencePaths = (route: string): string =>
4545
route.replace(/constants\/|types\//, "")
4646

4747
export const rewriteRelativeLink = (url: string): string => {
48-
let updatedUrl: string;
48+
let updatedUrl: string = url;
4949

50-
if (/^((https?:\/)?)\//.exec(url) || url.startsWith('mailto:')) {
51-
// Leave absolute paths alone
52-
updatedUrl = url;
53-
} else if (url.startsWith('#')) {
54-
// Leave links to headings alone
50+
if (/^(https?:|mailto:|\/\/)/.exec(url)) {
51+
// Skip rewriting for external URLs (http(s), mailto)
52+
return url;
53+
} else if (url.startsWith('#')||url.startsWith('/')) {
54+
// Skip rewriting for heading links and root-relative internal paths
5555
updatedUrl = url;
5656
} else {
5757
// Convert relative paths to '../' (because pages that started as files in the same directory
@@ -81,4 +81,4 @@ export const rewriteRelativeLink = (url: string): string => {
8181
}
8282

8383
return updatedUrl;
84-
};
84+
};

0 commit comments

Comments
 (0)