Vaultex ships with over 70 syntax highlighting themes via highlight.js, all bundled locally. The active theme is set in themes/vaultex/_config.yml under highlight. This post shows off code blocks across a variety of languages.
JavaScript
Modern JavaScript — async/await, destructuring, optional chaining:
SELECT p.id, p.title, p.slug, p.published_at, COUNT(DISTINCT t.id) AS tag_count, COUNT(DISTINCT c.id) AS comment_count, AVG(v.duration_seconds) AS avg_read_time FROM posts p LEFTJOIN post_tags pt ON pt.post_id = p.id LEFTJOIN tags t ON t.id = pt.tag_id LEFTJOIN comments c ON c.post_id = p.id AND c.approved =TRUE LEFTJOIN visits v ON v.post_id = p.id WHERE p.published_at < NOW() AND p.deleted_at ISNULL GROUPBY p.id, p.title, p.slug, p.published_at HAVINGCOUNT(DISTINCT t.id) >0 ORDERBY p.published_at DESC LIMIT 20;
type Post struct { ID int`json:"id"` Title string`json:"title"` Slug string`json:"slug"` PublishedAt time.Time `json:"published_at"` Tags []string`json:"tags"` }
funcmain() { http.HandleFunc("/api/posts", postsHandler) fmt.Println("Listening on :8080") http.ListenAndServe(":8080", nil) }
The active highlight theme can be changed by editing highlight in the Vaultex _config.yml. Options include github-dark, monokai, nord, dracula, tokyo-night-dark, and dozens more.
Vaultex
Version 1.0
Theme repository
View the source code, report issues, and contribute to the theme on GitHub.