Announcing v1.5.0

Welcome to the all-new Routify blog. For our first post, we’re very happy to announce that 1.5 is finally ready. Among the highlights in this version are: - support for meta tags - Dynamic basepaths - node api - CLI enhancements - A unified __index.html (starter template) - spassr server (starter template) - Netlify + Github integration (starter template) ### **Meta tags and Open Graph** Set meta tags and Open Graph data directly from Routify, in a single line. For example this code... import { metatags} from "@sveltech/routify"; $: metatags.title = ‘My app - home’; will output the following: My app - home You can read more about meta tags [here](/guide/metadata). ### **Dynamic basepaths** Basepaths can now be set from anywhere within your app. Basepaths are strings but will be converted to RegExp’s internally. To prerender multiple basepaths add a basepath argument to your exporter. routify export --basepath mybase ### **Updated CLI** The init command now accepts `--branch --no-example --no-install and --start-dev`. If you are already used to Routify, this way you can get a starter template with a minimal amount of files. ### **Auto-generated navigation with Layout and Page helpers** With the new layout and page helpers you can read a file’s metadata or access its adjacent nodes. Here’s an example of creating automatic navigation with a layout helper:
    {#each $layout.children as { path, title }}
  • {title}
  • {/each}
You can also add extra links to the navigation by adding meta children to a layout. Here’s an example from this very website’s root layout, where we link to Github, Discord and Twitter. These meta children can be accessed in **$layout.children**. Read more about Automatic Navigation here **TODO** ### **Query string support** $params now accepts query strings. `$url(‘./blog/:id’, {id: 123, theme: ‘dark’}` ****becomes `blog/123?theme=dark` console.log($params) // **{id: 123, theme: ‘dark’}** ### Want to try it? Follow along with our updated [guide](/guide/installation).

Kommentarer

Populære opslag fra denne blog