press

command module
v0.0.0-...-325d976 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

README

=======================================================================
PRESS: README

-----------------------------
Motivation & Overview
-----------------------------

Building websites that are unique is fun, and it is still useful to
craft HTML directly when putting together web content. But some
automation is handy to make maintaining even small websites manageable.

'press' is a simple utility written in Go for applying templates to HTML
content. This allows the user to keep a single file for components such
as the page metadata and footer, and apply that template to multiple
content files, filling in elements of the template appropriately.

This project is a work-in-progress, and is currently very limited in
scope and functionality.

-----------------------------
Usage
-----------------------------

When invoked at the command line, 'press' takes arguments for which
content should be templatized, in the following fashion:

    press -t template1.html -c page_content.html > output.html

The idea is that the tool can be used in scripts to aid in generating
basic static websites, reducing duplication and increasing
maintainability.  Still, this is a simple project. If you're looking
for something full-featured to build your blog or static site, or
are not keen to write raw HTML, try Hugo.

For a list of supported command line arguments, run:

	press -h

This repository also includes a sample website project with a script
utilizing 'press' to illustrate how it can be employed. To give an
idea, here is how you might want to organize your site's 'src/'
directory for use with 'press'.

	sample/src
	├── content
	│   ├── about.html
	│   ├── code.html
	│   └── index.html
	└── templates
	    └── pages.html

Read and execute the file 'sample/generate.sh' to see this in action.

-----------------------------
Build/Install
-----------------------------

Assuming that you have Go installed on your system, installation should
be as simple as:

	go install github.com/benghancock/press

If you already have the repository locally and want to just install
from the root directory, leaving out the package name in the above
command should be sufficient. You'll want to ensure that your Go
executables directory is in your PATH, e.g.:

	export PATH=$PATH:$HOME/go/bin

That should allow you to run 'press' at the command line as usual.

// END

Documentation

Overview

press is a utility for applying simple HTML templates to content

Jump to

Keyboard shortcuts

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