mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
Fix starter template's Tour component (#290)
* Fix starter template's Tour component This component had an extra backtick and also didn't import the Markdown component. * Add a changeset
This commit is contained in:
parent
436a016408
commit
6de740d62f
4 changed files with 12 additions and 3 deletions
5
.changeset/great-queens-guess.md
Normal file
5
.changeset/great-queens-guess.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro-parser': patch
|
||||
---
|
||||
|
||||
Fix for when there's a parser error with unmatched backticks
|
|
@ -105,7 +105,7 @@ export class Parser {
|
|||
}
|
||||
|
||||
error({ code, message }: { code: string; message: string }, index = this.index) {
|
||||
error(message, {
|
||||
error(this.template, message, {
|
||||
name: 'ParseError',
|
||||
code,
|
||||
source: this.template,
|
||||
|
|
|
@ -27,6 +27,7 @@ export class CompileError extends Error {
|
|||
|
||||
/** Throw CompileError */
|
||||
export default function error(
|
||||
code: string,
|
||||
message: string,
|
||||
props: {
|
||||
name: string;
|
||||
|
@ -36,7 +37,7 @@ export default function error(
|
|||
end?: number;
|
||||
}
|
||||
): never {
|
||||
const err = new CompileError({ message, start: props.start, end: props.end, filename: props.filename });
|
||||
const err = new CompileError({ code, message, start: props.start, end: props.end, filename: props.filename });
|
||||
err.name = props.name;
|
||||
|
||||
throw err;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
---
|
||||
import { Markdown } from 'astro/components';
|
||||
---
|
||||
<article>
|
||||
<div class="banner">
|
||||
<p><strong>🧑🚀 Seasoned astronaut?</strong> Delete this file. Have fun!</p>
|
||||
|
@ -20,7 +23,7 @@
|
|||
│ └── pages/
|
||||
│ └── index.astro
|
||||
└── package.json
|
||||
````
|
||||
```
|
||||
|
||||
Astro looks for `.astro` or `.md` files in the `src/pages/` directory.
|
||||
Each page is exposed as a route based on its file name.
|
||||
|
|
Loading…
Reference in a new issue