mvasigh / sveltekit-mdsvex-blog Goto Github PK
View Code? Open in Web Editor NEWA minimalistic blog template built with SvelteKit and MDsveX
Home Page: https://sveltekit-mdsvex-blog.netlify.app
License: MIT License
A minimalistic blog template built with SvelteKit and MDsveX
Home Page: https://sveltekit-mdsvex-blog.netlify.app
License: MIT License
Right now, this template is set up to load all blog posts' metadata and contents at once into the browser's memory:
sveltekit-mdsvex-blog/src/routes/posts/__layout.svelte
Lines 4 to 12 in 4cde064
This can be avoided by doing the same work in an endpoint instead: https://github.com/babichjacob/university-website/blob/84b5e7ff44550910550a3c809ccb9f1402df301b/src/routes/blog/index.json.ts#L6-L23
and fetching from that in the layout (or wherever it's needed, like to show the most recent 3 posts on the website's homepage and all posts on the website's /blog
route): https://github.com/babichjacob/university-website/blob/84b5e7ff44550910550a3c809ccb9f1402df301b/src/routes/blog/index.svelte#L3
If you'll make a link from one post to another - the page won't be updated, only it's metadata (frontmatter). That's because component
definition in /src/routes/blog/[slug]/+page.svelte
is not reactive and doesn't update when data.component is changed after navigation to another post while the page component itself isn't changed. I've fixed that by adding $:
to the component definition, but probably there is a better way to do that:
$: component = data.component as unknown as C;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.