Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Svelte starter combining Routify v2, MDsveX Markdown, and a GraphQL data layer.
Svelte, Routify, MDsveX demo is a starter template that pairs the Svelte component framework with the Routify v2 file-based router and the MDsveX Markdown preprocessor, all running on the Svite (Svelte + Vite) toolchain and backed by a GraphQL data layer for site metadata.
This template is a demonstration project for building static sites with Svelte, Routify v2, and MDsveX. It takes Svelte components and Markdown files (processed by MDsveX) as input, and returns a routed site with a GraphQL layer that populates metadata into pages. The project includes a site metadata configuration file named app.config.js, and all GraphQL-layer files live in the support directory for modification. The repository itself does not state an author or a description, so its origin is unverified from the page.
yarn install and yarn dev, which start the development server.This template is aimed at developers who want a ready-made starting point for a Svelte project that uses Routify for routing and MDsveX for Markdown content. It is also useful for developers exploring how to integrate a GraphQL data layer into a static site. Because the repository's topics include blog, it can serve as the base for a Markdown-driven blog site.
To begin, install dependencies with yarn install and start the dev server with yarn dev. To query data, define a constant with the name of query in any Svelte or MDsveX file — for example, a GraphQL query for SITE_METADATA that returns the site title — and the data is populated into the variable before further processing. The GraphQL layer itself, located in the support folder, can be modified as needed, though it is explicitly noted as a work-in-progress.
It includes Svelte, Routify v2, MDsveX, Svite, a GraphQL data layer, and an app.config.js file for site metadata. The combination means you get component-based UI, file-based routing, Markdown processing, and a queryable metadata source.
Run yarn install to install dependencies, then yarn dev to start the development server. No other configuration steps are described on the page.
Define a constant named query in a Svelte or MDsveX file, containing a GraphQL query such as one that requests the site title from the meta field. The template populates the constant with the query result before the component renders.
The repository states that the GraphQL Layer is a work-in-progress and will be updated as necessary. Files for it are in the support directory, so you can inspect and modify them.
The getting-started instructions use Yarn exclusively, so Yarn is the package manager expected for installation and development.
