Giter Site home page Giter Site logo

svelteland / svelte-kit-blog-demo Goto Github PK

View Code? Open in Web Editor NEW
168.0 5.0 60.0 633 KB

A demo of a markdown based blog with SvelteKit, deployed to Github Pages.

Home Page: https://svelteland.github.io/svelte-kit-blog-demo/

HTML 3.42% SCSS 5.84% Svelte 56.64% JavaScript 34.10%
sveltekit demo blog

svelte-kit-blog-demo's Issues

Installing svelte kit 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

Can't make dynamic routes

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

Confusing errors when frontmatter is missing

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>";
        }

Blog performance limited by process()

Playing around with my own local build I found that:

let content = runner.stringify(runner.runSync(tree));

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.