Gemini digital garden static site generator.
A digital garden is like a personal knowledge-base or wiki. Rather than a blog where you write articles that are tied to a moment in time, a digital garden encourages revisiting pages and changing them as you grow.
gdn expects your digital garden to be written in Gemini text files (with file
.gemini) organized in folders.
gdn renders the digital
Garden into a static HTML site that can be served over HTTP/HTTPS by most web
Gemini is both a network protocol and a text format.
gdn renders your digital
garden to HTML so it can be viewed by a normal web browser on the web.
gdn renders Gemini text formatted files into HTML to produce a static site.
Work in Progress
This is currently a work in progress. Not all features work.
Building and Installing from Source Code
This project has the following dependencies:
- Go the programming language and standard libraries.
- Mage a build tool similar to make, but uses Go.
- git for version control.
You need to install these before building or installing.
Clone this repository using
git and change directory:
git clone https://git.sr.ht/~kiba/gdn cd gdn
Building from Source
build target compiles from source and places the executable in the
mage -v build
Installing from Source
install target compiles from source and places the executable into your
$GOPATH/bin directory via
go install. This must be in your
PATH if you
wish to execute
gdn without specifying the full path of
mage -v install
Contributions are welcome. Please read the CONTRIBUTING.md guide.
This project is licensed by the MIT License. See: LICENSE.
Package gdn provides tools for generating a static website from a source of pages written in the Gemini text and organized in directories.
- func ChExt(path, ext string) string
- func CopyFile(src, dest string) error
- type Branch
- type FileType
- type Leaf
BranchPerm sets the permission for the directories produced when growing.
LeafPerm is the permission to set for the generated file the leaf produces.
var ( // ErrSrcNotSet occurs when the source path is not set. ErrSrcNotSet = errors.New("source path is not set") // ErrDstNotSet occurs when the destinatio path is not set. ErrDstNotSet = errors.New("destination path is not set") // ErrNotScanned occurs when Scan was not called before Grow. ErrNotScanned = errors.New("need to scan tree before growing it") // ErrEmptyTree occurs when Scan results in an empty tree. ErrEmptyTree = errors.New("scan resulted in an empty tree") )
KnownFileTypes is a map of extensions to their FileType.
ChExt takes a path and replaces any file extension that path has with the the given new extension.
Branch represents a directory tree used to generate the pages.
NewTree creates the root of the tree. The input path is the path with all the source files and directories (e.g. Markdown, images, etc). The output path is the destination for the generated site. This returns a single Branch with no Leaves which an be used to Scan the input path to populate the tree.
type FileType uint
FileType represents a high level file type.
func TypeByExtension ¶
TypeByExtension will look up the type by its extension.
Leaf represnts a file. If it is a Markdown file it will be generated into a page.
Dst is the destination file path for the leaf when Grow is executed.