Skip to content
/ blog Public
forked from denoland/deno_blog

Forking Deno Blog for experimentation

Notifications You must be signed in to change notification settings

savager/blog

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blog

Minimal boilerplate blogging. All you need is one boilerplate JavaScript file that has 2 lines of code:

import blog from "https://deno.land/x/blog/blog.tsx";

blog();

Getting started

To initialize your own blog you can run following script:

$ deno run https://deno.land/x/blog/init.ts ./directory/for/blog/

This command will setup a blog with a "Hello world" post so you can start writing right away.

Start local server with live reload:

$ deno task dev

To ensure the best development experience, make sure to follow Set up your environment from the Deno Manual.

Configuration

You can customize your blog as follows:

import blog, { ga, redirects } from "https://deno.land/x/blog/blog.tsx";

blog({
  author: "Dino",
  title: "My Blog",
  description: "The blog description.",
  picture: "avatar.png",
  links: [
    { title: "Email", url: "mailto:[email protected]" },
    { title: "GitHub", url: "https://github.com/denobot" },
    { title: "Twitter", url: "https://twitter.com/denobot" },
  ],
  middlewares: [
    ga("UA-XXXXXXXX-X"),
    redirects({
      "/foo": "/my_post",
      // you can skip leading slashes too
      "bar": "my_post2",
    }),
  ],
});

Preview

Customize the header and footer

By default, we render the header and footer with builtin template using the blog settings. You can customize them as follows:

/** @jsx h */

import blog, { h } from "https://deno.land/x/blog/blog.tsx";

blog({
  title: "My Blog",
  header: <header>Your custom header</header>,
  footer: <footer>Your custom footer</footer>,
});

Hosting with Deno Deploy

Self hosting

You can also self-host the blog, in such case run:

$ deno task serve

TODO(bartlomieju): allow specyfing port and hostname?

About

Forking Deno Blog for experimentation

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%