diff --git a/www/src/pages/blog/astro-019.astro b/www/src/pages/blog/astro-019.astro index 2010efa03..94bf6398a 100644 --- a/www/src/pages/blog/astro-019.astro +++ b/www/src/pages/blog/astro-019.astro @@ -40,11 +40,13 @@ let lang = 'en'; ## File-based routing, inspired by Next.js - Astro has always supported basic file-based routing, where every file in your `pages/` directory becomes a new page at that same URL. Astro 0.19 takes this one step further with support for real file-based route parameters. + Astro has always supported basic file-based routing, where every file in your `pages/` directory becomes a new page at that same URL. Astro 0.19 takes this one step further with support for dynamic URL params in your filename. - Inspired by [Next.js](https://nextjs.org/docs/routing/dynamic-routes) and [SvelteKit](https://kit.svelte.dev/docs#routing-pages), you can now add brackets to your page filename (ex: `src/pages/[slug].astro`) to create a dynamic page that matches many different URLs. With this new syntax, you can add URL params, slugs, pretty URLs, pagination and more to your website. + Inspired by [Next.js](https://nextjs.org/docs/routing/dynamic-routes) and [SvelteKit](https://kit.svelte.dev/docs#routing-pages), you can now add brackets to your page filename (ex: `src/pages/[slug].astro`) to create a dynamic page that matches many different URLs. `[...slug].astro` catch-all syntax is also supported. + + With this new feature you can add support for URL params, slugs, pretty URLs, pagination and more to your website. - To create a dynamic route, create a file in your pages directory like `pages/posts/[slug].astro`. Create a [`getStaticPaths()`](https://docs.astro.build/reference/api-reference#getstaticpaths) function in your frontmatter script and tell Astro exactly what paths to build for that route: + To create a dynamic route, create a file in your pages directory like `pages/posts/[slug].astro`. Create a [`getStaticPaths()`](https://docs.astro.build/reference/api-reference#getstaticpaths) function in your page frontmatter script and tell Astro exactly what paths to build for that route: ```astro --- @@ -62,19 +64,22 @@ let lang = 'en'; ]; } --- - /* your page HTML here! */ + +
## 👋 - Thanks for reading! [Follow us on Twitter](https://twitter.com/astrodotbuild) to stay up to date as we move closer to a v1.0 release. Also, you can check out [our previous release post](https://astro.build/blog/astro-018) for even more updates on Astro. + Thank you for reading! [Follow us on Twitter](https://twitter.com/astrodotbuild) to stay up to date as we move closer to a v1.0 release. Also, you can check out [our previous release post](https://astro.build/blog/astro-018) for even more updates on Astro. And, if you've read this far, you should definitely [join us on Discord.](https://astro.build/chat) ;)It's official! 🎉 @github now supports syntax highlighting for .astro files!
— Astro (@astrodotbuild) August 4, 2021
You can also use code blocks starting with "'''astro" to get proper highlighting in Markdown files, issues, and PR comments! pic.twitter.com/CDiGw66Qw6