Giter Club home page Giter Club logo

deno-blog-starter's Introduction

Deno Blog Starter ๐Ÿ’Œ

Blog CLI and static blog project-starter in Deno.

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 --allow-read --allow-write --allow-net https://deno.land/x/dbs/mod.ts

  • Required Permissions:
    • --allow-read: The program needs to read your markdown files.
    • --allow-write: The program needs to generate new files.
    • --allow-net: The program needs this permission to preview the site in the browser.
Create Blog Post โœจ

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.
---

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.

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

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 ๐Ÿ’…

This operation currently only works when you are using this project as a template.

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.ts file.

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...

  1. A template/starter repository on GitHub.
  2. A TypeScript module on deno.land/x.
  3. 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-starter project (such as documentation).


Deploy with Vercel

Created with ๐Ÿ’Œ by EthanThatOneKid

deno-blog-starter's People

Contributors

ethanthatonekid avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.