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 π±βπ
π‘ For a simple tutorial, check out the Getting Started document.
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/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, orsplendor. Themodeststylesheet 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.
π‘ To integrate your custom stylesheet, update the
styles/YOUR_STYLE_TITLE.tsfile.
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);Project Fundamentals π¨βπ»
This project isβ¦
- A template/starter repository on GitHub.
- A TypeScript module on
deno.land/x. - And a CLI (command-line interface).
Final thoughts: This project is not limited to blogging; any directory of loosely organized markdown files will work seamlessly with the
deno-blog-starterproject (such as documentation).
Created with π¦ by EthanThatOneKid