devserver

package
v0.0.0-...-883b603 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package devserver makes it easy to view statically generated websites and automatically rebuild them when source data changes. When combined with the "livejs" plugin, it is possible to have a live preview of your site.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DevServe

func DevServe(builder Builder, port int, sourceDir, targetDir, cacheDir string, watchDirs ...string)

DevServe should be called to start a web server using the provided builder. While the source directory will be watched for changes by default, it is possible to pass in additional directories to watch; modification of these directories will automatically trigger a site rebuild. This function does not return and will continue watching for file changes and serving your website until it is terminated.

Types

type Builder

type Builder interface {
	Build(sourceDir, targetDir, cacheDir string)
}

Builder interface should be implemented by you to contain the required goldsmith chain to generate your website.

Jump to

Keyboard shortcuts

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