scommon

package
v0.0.0-...-e968299 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AtomAuthorName is the name of the author to include in Atom feeds.
	AtomAuthorName = "Brandur Leach"

	// AtomTag is a stable constant to use in Atom tags.
	AtomTag = "brandur.org"

	// DataDir is where various TOML files for quantified self statistics
	// reside. These are pulled from another project which updates them
	// automatically.
	DataDir = "./data"

	// LayoutsDir is the source directory for view layouts.
	LayoutsDir = "./layouts"

	// MainLayout is the site's main layout in the deprecated ACE templating
	// system. This is no longer used except in a few near retired pages like
	// runs and Twitter.
	MainLayout = LayoutsDir + "/main.ace"

	// NanoglyphsLayout is the layout for a Nanoglyph issue (an email
	// newsletter).
	NanoglyphsLayout = LayoutsDir + "/nanoglyphs.ace"

	// PassagesLayout is the layout for a Passages & Glass issue (an email
	// newsletter).
	PassagesLayout = LayoutsDir + "/passages.ace"

	// TempDir is a temporary directory used to download images that will be
	// processed and such.
	TempDir = "./tmp"

	// TitleSuffix is the suffix to add to the end of page and Atom titles.
	TitleSuffix = " — brandur.org"

	// ViewsDir is the source directory for views.
	ViewsDir = "./views"
)
View Source
const TwitterInfo = template.HTML(`<p>Find me on Twitter at ` +
	`<strong><a href="https://twitter.com/brandur">@brandur</a></strong>.</p>`)

TwitterInfo is some HTML that includes a Twitter link which can be appended to the publishing info of various content.

Variables

HTMLTemplateFuncMap is a function map of template helpers which is the combined version of the maps from ftemplate, mtemplate, and mtemplatemd.

TextTemplateFuncMap is a combined set of template helpers for text templates.

Functions

func ExitWithError

func ExitWithError(err error)

ExitWithError prints the given error to stderr and exits with a status of 1.

func ExtractSlug

func ExtractSlug(source string) string

ExtractSlug gets a slug for the given filename by using its basename stripped of file extension.

func IsDraft

func IsDraft(source string) bool

IsDraft does really simplistic detection on whether the given source is a draft by looking whether the name "drafts" is in its parent directory's name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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