#routepath helper
2 messages · Page 1 of 1 (latest)
Astro uses standard HTML <a> elements to navigate between routes. There is no framework-specific <Link> component provided. To create a link to another page, you would use the standard HTML <a> element with the href attribute set to the desired path.
In your case, if you want to link to a page located at src/pages/cities/[city]/dogs/[...slug].astro, you would construct the href attribute with the appropriate city and slug values. Here's an example:
<a href={`/cities/${city}/dogs/${slug}`}>Go to another page</a>
In this example, city and slug would be variables that you've defined in your Astro component's frontmatter script.
Please note that Astro uses file-based routing to generate your build URLs based on the file layout of your project src/pages/ directory. When you add a file to the src/pages/ directory, a new route is automatically created for you.