Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the generated page template #11385

Closed
ahaywood opened this issue Aug 28, 2024 · 0 comments · Fixed by #11533
Closed

Change the generated page template #11385

ahaywood opened this issue Aug 28, 2024 · 0 comments · Fixed by #11533

Comments

@ahaywood
Copy link
Contributor

ahaywood commented Aug 28, 2024

When you create a brand new page, the template includes a <Link /> to that page.

<p>
        My default route is named <code>upgradeGuide</code>, link to me with `
        <Link to={routes.upgradeGuide()}>UpgradeGuide</Link>`
</p>

If you already created a parameter with the routes.tsx file

<Route path="/upgrade/{slug:string}" page={UpgradeGuideIndividualPage} name="upgradeGuideIndividual" />

Then, the first time you load the page in the browser, you'll get an error because you didn't specify a parameter within the Link Every once in a while this still throws me off.

If it's meant to be read within code, stick <Link to={routes.upgradeGuide()}>UpgradeGuide</Link> in a comment or put it within a <pre> tag.

Image

@ahaywood ahaywood self-assigned this Aug 28, 2024
@ahaywood ahaywood changed the title Fix generated files to adhere to our linting Change the generated page template Aug 28, 2024
Josh-Walker-GM added a commit that referenced this issue Sep 16, 2024
Fixes #11385 

## Feature description

When you create a brand new page, the template includes a `<Link />` to
that page.

```
<p>
        My default route is named <code>upgradeGuide</code>, link to me with `
        <Link to={routes.upgradeGuide()}>UpgradeGuide</Link>`
</p>
```

If you already created a parameter with the routes.tsx file

<Route path="/upgrade/{slug:string}" page={UpgradeGuideIndividualPage}
name="upgradeGuideIndividual" />

Then, the first time you load the page in the browser, you'll get an
error because you didn't specify a parameter within the Link Every once
in a while this still throws me off.

## Analysis and Design

I considered using a `<pre>` tag or a `<code>` tag, but it would still
throw the same error.

## Solution description

I updated all the templates to include the path within a comment.

---------

Co-authored-by: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant