Skip to main content
Deno 2 is finally here πŸŽ‰οΈ
Learn more

Deno Blog Starter πŸ¦•

Blog CLI and static blog project-starter in Deno.

Blogging πŸ’Œ

Each of your blog posts are represented by a markdown file (file with the .md extension). Your blog posts can have the following frontmatter associated with them:

---
title: Your Title Here
date: Date
description: Your description here.
published: false # Change to true to include this blog-post.
---

The rest of the contents of the blog-post file are written in Markdown.

Usage πŸ±β€πŸ‰

Make sure that you have installed Deno. Then, install deno-blog-starter by executing the following command:

deno install --unstable https://deno.land/x/dbs@1.0.0/mod.ts

Create Blog Post

To create a new blog post, run the following command.

dbs --new-post -t "Your Title" -d "Your description."

πŸ’‘ You can pass your title and description as well, but they are not required.

Or run as an individual script.

deno run --unstable --allow-write --allow-read scripts/new_post.ts -t "Your Title" -d "Your description.".

Or run via the API.
import { newPost } from "https://deno.land/x/dbs/mod.ts";
const title = "Your Title",
  description = "Your description.";
await newPost(title, description);

Generate Blog

To generate the files for your static blog, run the following command:

dbs --build -s "chosen_stylesheet"

You can pass the name of your chosen stylesheet. You may choose between air, modest, retro, or splendor. The modest stylesheet is chosen by default. Or you may create a custom stylesheet.

Or run as an individual script.

deno run --unstable --allow-read --allow-write scripts/build.ts -s YOUR_STYLE_TITLE

Or run via the API.
import { build } from "https://deno.land/x/dbs/mod.ts";
const stylesheetTitle = "modest"; // Replace `modest` with your chosen stylesheet's title.
await build(stylesheetTitle);

Preview Blog

To preview your blog on your machine, run the following command:

dbs --serve

πŸ’‘ Visit http://localhost:8000/ to preview your blog.

πŸ’‘ To see your latest changes, remember to re-generate the site.

Or run as an individual script.

deno run --allow-read --allow-net --unstable scripts/serve.ts

Or run via the API.
import { serve } from "https://deno.land/x/dbs/mod.ts";
await serve();

Add Custom Stylesheet

To add a custom stylesheet, run the following command:

dbs --new-style -t "YOUR_STYLE_TITLE"

πŸ’‘ You may pass the title of your custom stylesheet as well.

Or run as an individual script.

deno run --unstable --allow-read --allow-write scripts/new_style.ts -t "YOUR_STYLE_TITLE"

Or run via the API.
import { newStyle } from "https://deno.land/x/dbs/mod.ts";
const title = "new_stylesheet_title";
await newStyle(undefined, title);

Development πŸ‘¨β€πŸ’»

Goals 🏁

  • Built-in deployment methods…
    • GitHub Pages
    • Netlify
    • Vercel

Created with πŸ’– by EthanThatOneKid