项目作者: sharu725

项目描述 :
This is an attempt to combine Jekyll and Svelte so that we can use the best of both worlds.
高级语言: JavaScript
项目地址: git://github.com/sharu725/jekyll-svelte.git
创建时间: 2020-12-17T16:18:46Z
项目社区:https://github.com/sharu725/jekyll-svelte

开源协议:MIT License

下载


Jekyll + Svelte

This is an attempt to combine Jekyll and Svelte so that we can use the best of both worlds.

Installation

  1. Clone the repository

  2. Install dependencies npm run setup

  3. Run dev app npm run dev. Site will be served on http://127.0.0.1:4000 with live-reload

  4. Build app npm run build

Adding Svelte components

  1. Create a Svelte component say Example.svelte in /svelte/src/ directory.

  2. Add it to svelte/src/main.js as shown below

  1. import Example from "./Example.svelte";
  2. const exampleDiv = document.querySelector("#example");
  3. // mount the component only if the dom node is present
  4. exampleDiv &&
  5. new Example({
  6. target: exampleDiv,
  7. });
  1. Add html <div id="example"></div> in any page where you want the Example.svelte component to be mounted.

  2. Contribute to the project.

Demo

https://webjeda.com/jekyll-svelte/