0.2.3 • Published 12 months ago

svekyll-cli v0.2.3

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

Svekyll

  1. Why Svekyll?
  2. Quickstart
  3. Building your blog
  4. Technical Notes

More information is at https://svekyll.com and https://blog.svekyll.com

Why Svekyll?

Svekyll takes the simple conventions of Jekyll and marries them to the incredible power of Svelte.

Read more here: https://svekyll.com

Svekyll achieves perfect lighthouse scores: all 100s

Quickstart

node --version  # Please use at least node 18

# Create a package.json with the right build command
echo '{ "scripts": { "build" : "svekyll-cli build && svekyll-cli finalize" } }' > package.json

# add svekyll-cli
npm add svekyll-cli

# make the posts directory
mkdir -p posts

# Create _config.yml: see https://svekyll.com/Config
echo -e "title: hi\ndescription: my blog" >> _config.yml

# Create a post
echo -e "---\npublished: true\ntitle: First post\n\n---\n\n# My first post\n\nWelcome to Svekyll" >> posts/2023-09-23-hello.md

# Build your blog
npm run build

# Optionally style using a user.css file: https://blog.svekyll.com/2021-11-13-hacking-svekyll-theme
# Or, use a theme in your _config.yml file https://svekyll.com/Theme

# Review your blog (or put up on any webserver as a static site)
cd build && npx http-server # Go to http://localhost:8080.

Read more at https://svekyll.com

Interesting in hosting? Contact chris@extrastatic.com to learn about https://extrastatic.com

Svekyll CLI

The original Svekyll was SvelteKit based. This meant a user had to use an entire full stack JavaScript system when the goal was to create a static blog. This was the wrong approach.

The new Svekyll uses a CLI tool much like the original Jekyll. Your project can be nothing more than a posts directory and a package.json file.

Sample package.json:

{
  "version": "0.0.1",
  "scripts": {
    "build": "svekyll-cli build && svekyll-cli finalize",
    "verify": "svekyll-cli verify"
  },
  "type": "module",
  "dependencies": {
    "svekyll-cli": "0.0.78"
  }
}

And, posts can be something like this:

$ ls -1 posts/
2023-05-26-i-m-a-dad-i-replaced-myself-with-an-llm.md
2023-06-04-expose-any-private-service-using-headscale.md
2023-06-30-why-is-gitlab-source-code-public-and-discourse-community-private-.md
2023-07-20-using-the-llm-tool-inside-docker.md

Each posts is a standard jekyll style post, but you can also add Svelte components using MDSveX.

$ cat posts/2023-07-20-using-the-llm-tool-inside-docker.md 
---
title: "using the LLM tool inside docker"
published: true
date: 2023-07-20
data: 
  a: 1
  b: 2
---

<script>
import MyComponent from './MyComponent.svelte'
</script>

Katarismo uses the excellent llama.cpp project. But, recently I've been reading about the LLM tool from the prolific Simon Willison.

<MyComponent {data}/>

I run NixOS as my \*nix of choice. But, python and nix's immutable file systems approach are like oil and water, so I generally like to run anything with Python inside a docker container.  

This is the Dockerfile I used:
...

Building your blog

Once you have this structure, you can build it like this:

yarn # install svekyll and dependencies
yarn build

Then, look inside the build directory.

Technical Notes on Svekyll CLI

Svekyll CLI eschews the traditional JavaScript build system. Internally, svekyll-cli creates a vite configuration with the right plugins (like tailwind, postcss). It then generates a set of templates inside the root directory. Each of these is a standalone Svelte app, and then svekyll-cli compiles them using vite and svelte and the preprocessor. The result in the build directory is a series of index.html files with the JavaScript compiled, minimized, tree-shaken and inlined. This results in an incredibly fast experience for readers, but without compromises on the experience as you can use the full capabilities of Svelte.

For example, on a blog with four posts, this is the directory structure. This can be put on any static hosting service:

$ tree build/
build/
├── 2023-05-26-i-m-a-dad-i-replaced-myself-with-an-llm
│   └── index.html
├── 2023-06-04-expose-any-private-service-using-headscale
│   └── index.html
├── 2023-06-30-why-is-gitlab-source-code-public-and-discourse-community-private-
│   └── index.html
├── 2023-07-20-using-the-llm-tool-inside-docker
│   └── index.html
├── index.html
├── katarismo.png
├── page
│   └── 0
└── tags
    ├── headscale
    │   └── index.html
    ├── internal
    │   └── index.html
    ├── tailscale
    │   └── index.html
    └── wireguard
        └── index.html
0.2.1

1 year ago

0.2.0

1 year ago

0.2.3

12 months ago

0.2.2

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.3

1 year ago

0.0.111

1 year ago

0.0.110

1 year ago

0.0.109

1 year ago

0.0.108

1 year ago

0.0.106

1 year ago

0.0.107

1 year ago

0.0.105

1 year ago

0.0.104

1 year ago

0.0.103

1 year ago

0.0.102

1 year ago

0.0.101

1 year ago

0.0.100

1 year ago

0.0.99

1 year ago

0.0.98

1 year ago

0.0.95

2 years ago

0.0.96

2 years ago

0.0.97

2 years ago

0.0.94

2 years ago

0.0.88

2 years ago

0.0.89

2 years ago

0.0.89-npx-patch

2 years ago

0.0.90

2 years ago

0.0.91

2 years ago

0.0.92

2 years ago

0.0.93

2 years ago

0.0.84

2 years ago

0.0.40

2 years ago

0.0.85

2 years ago

0.0.41

2 years ago

0.0.86

2 years ago

0.0.42

2 years ago

0.0.87

2 years ago

0.0.43

2 years ago

0.0.44

2 years ago

0.0.45

2 years ago

0.0.46

2 years ago

0.0.47

2 years ago

0.0.80

2 years ago

0.0.81

2 years ago

0.0.82

2 years ago

0.0.83

2 years ago

0.0.73

2 years ago

0.0.74

2 years ago

0.0.75

2 years ago

0.0.76

2 years ago

0.0.77

2 years ago

0.0.78

2 years ago

0.0.79

2 years ago

0.0.70

2 years ago

0.0.71

2 years ago

0.0.72

2 years ago

0.0.62

2 years ago

0.0.63

2 years ago

0.0.64

2 years ago

0.0.65

2 years ago

0.0.66

2 years ago

0.0.67

2 years ago

0.0.68

2 years ago

0.0.69

2 years ago

0.0.60

2 years ago

0.0.61

2 years ago

0.0.59

2 years ago

0.0.51

2 years ago

0.0.52

2 years ago

0.0.53

2 years ago

0.0.54

2 years ago

0.0.55

2 years ago

0.0.56

2 years ago

0.0.57

2 years ago

0.0.58

2 years ago

0.0.50

2 years ago

0.0.48

2 years ago

0.0.49

2 years ago

0.0.33

2 years ago

0.0.32

2 years ago

0.0.31

2 years ago

0.0.30

2 years ago

0.0.29

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago