simpleblog

package module
v0.0.0-...-f34a01f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2019 License: BSD-2-Clause-Views Imports: 11 Imported by: 0

README

Simpleblog

This is a simple web application that translates markdown text files into html pages surronded by a go text template.

Features

  • Subdomain support
  • Translates folders and markdown files into navigatable website
  • Aimed at being lightweight and simple

Setup

First, download simpleblog using the go get command:

go get github.com/majiru/simpleblog

Usage

Navigate to a directory you want to use for website and run simpleblog init to create the basic directories.

This will create a directory structure like this:

  • domains
    • localhost
      • source
      • static

Create or copy markdown files into the source directory with their build names( index.md, about_thing.md)

From there you can run simpleblog run to serve the content over http on port 8080, there is a (-port, -p) flag that changes this port.

There is an example directory containing source and static directories with this repo.

Subdomains

If you would like to create other subdomains, simply create a folder of the FQDN in the domains folder. Markdown files should be placed in a similar fashion to the root domain.

An example of a directory tree with a blog subdomain with some content might look like this:

  • domains
    • localhost
      • static
      • source
        • index.md
    • mywebsite.org
      • static
      • source
        • index.md
    • blog.mywebsite.org
      • static
      • source
        • index.md

Note that if you are using some sort of web server between simpleblog and the internet then simpleBlog may not be able to gather the original host request which is needed for subdomains. This can be solved by switching the protocol to FastCGI using the (-protocol -r) flags.

Reasoning

I wanted something like werc and thought it would be fun to build a minimalistic web app.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(port, proto string) error

Serve starts a listener with a given port on the given protocol currently supported are fcgi(fastcgi) and http

func Setup

func Setup()

Setup does a first time initalization of the directories

Types

This section is empty.

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL