Skip to content

Latest commit

 

History

History
82 lines (56 loc) · 4.37 KB

README.md

File metadata and controls

82 lines (56 loc) · 4.37 KB

servemd

Servemd makes it simple and fast to serve one or more markdown files without the build process required by static site generators. Servemd can be used for quick local viewing or to serve content to thousands of visitors.

Installation

Servemd is distributed as either:

  • An executable with no dependencies
  • A docker image

Executable

Servemd is a single executable with no dependencies. Installation is as simple as downloading the binary for your platform from the release page. Releases are made available for:

  • Mac OS X (x86, x64)
  • Linux (x86, x64, ARMv5, ARMv6, ARMv7, ARMv8)
  • FreeBSD (x86, x64, ARMv5, ARMv6, ARMv7)
  • NetBSD (x86, x64, ARMv5, ARMv6, ARMv7)
  • DragonFly BSD (x64)
  • Windows (x86, x64)

OS X users can install servemd using the Homebrew package manager:

brew tap tantalic/tap
brew install servemd

Docker

The tantalic/servemd image can be pulled from Docker Hub:

docker pull tantalic/servemd

Configuration

Usage: servemd [OPTIONS] [DIR]

Arguments

Environment Variable Argument Description Default Value
DOCUMENT_ROOT [DIR] Directory to serve content from. .

Flags

Environment Variable Flag Description Default Value
HOST -a, --host Host/IP address to listen on All addresses
PORT -p, --port TCP port to listen on 3000
BASIC_AUTH -u, --auth Username and password for HTTP basic authentication. In the form of user1:pass1,user2:pass2 None
X_ROBOTS_TAG -r --x-robots-tag Sets a X-Robots-Tag header. Example: "noindex, nofollow" None
DOCUMENT_EXTENSION -e, --extension Extension used for markdown files .md
DIRECTORY_INDEX -i, --index Filename (without extension) to use for directory indexes index
MARKDOWN_THEME -m, --markdown-theme Theme to use for styling markdown. Can be one of the following built-in themes: clean, github, developer or the path to a custom CSS file to include. clean
TYPEKIT_KIT_ID -t, --typekit-kit-id Kit ID to include webfonts from the Typekit service. For use alongside a custom markdown theme.
CODE_THEME -c, --code-theme Syntax highlighting theme (powered by highlight.js) None

Deploying with Docker

The tantalic/servemd image can be used as a base for deployment. To create an image simply add your content to /app/content and configure via environment variables in your Dockerfile:

FROM tantalic/servemd:latest
MAINTAINER Your Name <[email protected]>

ENV MARKDOWN_THEME developer
ENV CODE_THEME solarized-dark

ADD content /content