ppath

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package ppath handles pages paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasePath

func BasePath(path string) string

BasePath returns a path that will take the given path all the way to the root using sequences of "..".

func Breadcrumbs(u string, root string) string

Breadcrumbs returns breadcrumbs (context about the parent directories of the given URL). The breadcrumb parts are links. It also takes the given name user-friendly name for the root directory.

func Draft

func Draft(p string) bool

Draft returns whether the given path is a draft page that should be ignored in released builds, which is the case if the path starts with a dash.

func Format

func Format(path string) string

Format formats the given path into a correct pages path by removing all `{digit(s)}-` prefixes at the start of path segments, which are used for ordering files and folders and thus should not be displayed.

func Label

func Label(u string, backup string) string

Label returns a user friendly label for the given page URL, with the given backup name if the URL is blank.

Types

type PreRenderData

type PreRenderData struct {

	// Description contains the automatic page descriptions for each page URL.
	Description map[string]string

	// HTML contains the pre-rendered HTML for each page URL.
	HTML map[string]string
}

PreRenderData contains the data printed in JSON by a pages app run with the generatehtml tag.

Jump to

Keyboard shortcuts

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