Utils
Class methods
Glob patterns for markdown, html and pandoc content under a base path
Create the right content file for a source based on its extension kind is used in error messages (e.g. "post", "page")
Find all files with given extension in path, if two files are alternative languages of one another they are grouped together.
Suffix to append to a filename for a given language (empty for the default language, ".#{lang}" otherwise)
Alternate-language links for a generated page. Two output conventions exist (issue #54):
- :file_suffix (default): "<stem>.<lang>.html" / "<stem>.html", used by post and folder index pages (output/posts/index.es.html)
- :dir_suffix: the FIRST directory under output/ carries the language marker (output/tags.es/foo/index.html), used by taxonomies, the archive and galleries roots
Returns one {lang, link, title} hash per other configured language. This is the site-level helper behind translation switcher menus.
The configured output directory with a trailing slash, for building URL prefixes (e.g. "output/", "public/site/")
Process inputs in parallel chunks, returning per-chunk results in order. Errors in a chunk are logged and that chunk is skipped.
Convert path to link, optionally changing extension
path_to_link("output/foo/../bar") # => "/bar"
Filter out files from directories that correspond to disabled features
Plain-text excerpt of an HTML fragment, for meta description tags: strips tags via lexbor, collapses whitespace, and truncates to at most limit characters at a word boundary with an ellipsis.