Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 1.06 KB

README.md

File metadata and controls

32 lines (22 loc) · 1.06 KB

sapper-markdown-image-lazyload

A Sapper template that uses Markdown to store blog posts.

It's code for this post: 在Svelte Sapper应用中实现延迟加载Markdown文件内的图片.

Usage

Install dependencies

yarn

For development

yarn dev

Open your browser on http://localhost:3000

Or Visit directly to http://localhost:3000/blog/sample-post-with-images. Press F12 on network TAB to see how the image loads.

What's different compared to the official Sapper template?

Instead of persisting blog posts in a JSON file at src/routes/blog/_posts.js, this template here uses Markdown files in src/posts.

Credit & Links