svelteland / svelte-kit-blog-demo Goto Github PK
View Code? Open in Web Editor NEWA demo of a markdown based blog with SvelteKit, deployed to Github Pages.
Home Page: https://svelteland.github.io/svelte-kit-blog-demo/
A demo of a markdown based blog with SvelteKit, deployed to Github Pages.
Home Page: https://svelteland.github.io/svelte-kit-blog-demo/
Hi,
First of all I am a web dev beginner, I have some issue trying to install your blog. Can you provide a little document wich explain how to install your blog. thanks
Playing around with my own local build I found that:
svelte-kit-blog-demo/src/lib/markdown.js
Line 30 in f8b7ac2
Takes an incredible amount of time, this negatively impacts the rendering performance when listing out articles as all files under the target folder are processed each time. This is a somewhat bizarre browsing experience as the article list page with less content is considerably slower than visiting an individual article. It's in part dependent on how many nodes are generated as part of the ast from the markdown file. I'm finding pages with heavy usage of code blocks generate an absurd amount of nodes to handle syntax highlighting. This in turn means the runner.runSync(tree)
can easily take seconds long. Not sure if you have an approach in mind, my most immediate thought was to have the backend use a bit of caching.
The counter to this is to avoid or be very specific about code blocks and whether any highlighting is needed. I found
"```txt" to work.
This assumes the website is run off the node adapter.
Just a note that plain .md files error out. To avoid very confusing error messages here's a modification to [slug].svelte
if (!post.metadata || !post.metadata.title || !post.metadata.date) {
post.metadata = {
title: "Error!",
date: "?"
};
post.content = "<p>Missing Frontmatter! Expected at least a title and a date!</p><p>Example:</p><p>---<br>\
title: Some title<br>\
date: 2021-04-03<br>\
excerpt: A short bit of the article<br>\
---</p>";
}
Hello, I've followed your tutorial to make a blog based in markdown posts.
I have same code as your github repo, and I have this error when accessing https://myblog/blog/someSlug
500
Unexpected token < in JSON at position 0
SyntaxError: Unexpected token < in JSON at position 0
I've looked around for a few hours, and I can't figure out what's wrong! Everything works fine in my app except that. Have you encountered this error before? Thanks a lot
Thanks for this starter repo. Any chance it can be updated to reflect the recent changes?
https://svelte.dev/blog/whats-new-in-svelte-june-2021
Namely,
svelte.config.js config files are now loaded in ESM format (.js instead of .cjs).
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.