package
0.30.2
Repository: https://github.com/caio/hugo.git
Documentation: pkg.go.dev

# Functions

AddContextRoot adds the context root to an URL if it's not already set.
BytesToHTML converts bytes to type template.HTML.
CompareVersion compares the given version string or number against the running Hugo version.
Deprecated informs about a deprecation, but only once for a given set of arguments' values.
DiffStringSlices returns the difference between two string slices.
DirExists checks if a path exists and is a directory.
Emojify "emojifies" the input source.
Exists checks if a file or directory exists.
Ext takes a path and returns the extension, including the delmiter, i.e.
ExtractRootPaths extracts the root paths from the supplied list of paths.
ExtractTOC extracts Table of Contents from content.
FileContains checks if a file contains a specified string.
FileContainsAny checks if a file contains any of the specified strings.
Filename takes a path, strips out the extension, and returns the name of the file.
FindAvailablePort returns an available and valid TCP port.
FindCWD returns the current working directory from where the Hugo executable is run.
FirstUpper returns a string with the first character as upper case.
GetDottedRelativePath expects a relative path starting after the content directory.
GetRealPath returns the real file path for the given path, whether it is a symlink or not.
GetRelativePath returns the relative path of a given path.
GetTempDir returns a temporary directory with the given sub path.
GetTitleFunc returns a func that can be used to transform a string to title case.
GuessSection returns the section given a source path.
GuessType attempts to guess the type of file from a given string.
HasAsciidoc returns whether Asciidoc is installed on this computer.
HasAsciidoctor returns whether Asciidoctor is installed on this computer.
HasRst returns whether rst2html is installed on this computer.
HasStringsPrefix tests whether the string slice s begins with prefix slice s.
HasStringsSuffix tests whether the string slice s ends with suffix slice s.
InitLoggers sets up the global distinct loggers.
InStringArray checks if a string is an element of a slice of strings and returns a boolean value.
IsAbsURL determines whether the given path points to an absolute URL.
IsDir checks if a given path is a directory.
IsEmpty checks if a given path is empty.
IsWhitespace determines if the given rune is whitespace.
MakePermalink combines base URL with content path to create full URL paths.
MakeTitle converts the path given to a suitable title, trimming whitespace and replacing hyphens with whitespace.
Md5String takes a string and returns its MD5 hash.
MustParseHugoVersion parses a version string and panics if any error occurs.
NewContentSpec returns a ContentSpec initialized with the appropriate fields from the given config.Provider.
NewDefaultLanguage creates the default language for a config.Provider.
NewDistinctErrorLogger creates a new DistinctLogger that logs ERRORs.
NewDistinctFeedbackLogger creates a new DistinctLogger that can be used to give feedback to the user while not spamming with duplicates.
NewDistinctWarnLogger creates a new DistinctLogger that logs WARNs.
NewLanguage creates a new language.
NewLanguages creates a sorted list of languages.
NewPathSpec creats a new PathSpec from the given filesystems and Language.
NormalizeHugoFlags facilitates transitions of Hugo command-line flags, e.g.
ParseHugoVersion parses a version string.
PathPrep prepares the path using the uglify setting to create paths on either the form /section/name/index.html or /section/name.html.
PrettifyPath is the same as PrettifyURLPath but for file paths.
PrettifyURL takes a URL string and returns a semantic, clean URL.
PrettifyURLPath takes a URL path to a content and converts it to enable pretty URLs.
ReaderContains reports whether subslice is within r.
ReaderToBytes takes an io.Reader argument, reads from it and returns bytes.
ReaderToString is the same as ReaderToBytes, but returns a string.
ReplaceExtension takes a path and an extension, strips the old extension and returns the path with the new extension.
SafeWriteToDisk is the same as WriteToDisk but it also checks to see if file/directory already exists.
SanitizeURL sanitizes the input URL string.
SanitizeURLKeepTrailingSlash is the same as SanitizeURL, but will keep any trailing slash.
SliceToLower goes through the source slice and lowers all values.
StripHTML accepts a string, strips out all HTML tags and returns it.
SymbolicWalk is like filepath.Walk, but it supports the root being a symbolic link.
ToLowerMap makes all the keys in the given map lower cased and will do so recursively.
TotalWords counts instance of one or more consecutive white space characters, as defined by unicode.IsSpace, in s.
Uglify does the opposite of PrettifyURLPath().
UniqueStrings returns a new slice with any duplicates removed.
WriteToDisk writes content to disk.

# Constants

FilePathSeparator as defined by os.Separator.

# Variables

CurrentHugoVersion represents the current build version.
DistinctErrorLog can be used to avoid spamming the logs with errors.
DistinctFeedbackLog can be used to avoid spamming the logs with info messages.
DistinctWarnLog can be used to avoid spamming the logs with warnings.
ErrThemeUndefined is returned when a theme has not be defined by the user.
ErrWalkRootTooShort is returned when the root specified for a file walk is shorter than 4 characters.
SummaryDivider denotes where content summarization should end.

# Structs

A BaseURL in Hugo is normally on the form scheme://path, but the form scheme: is also valid (mailto:[email protected]).
Blackfriday holds configuration values for Blackfriday rendering.
ContentSpec provides functionality to render markdown content.
DistinctLogger ignores duplicate log statements.
HugoHTMLRenderer wraps a blackfriday.Renderer, typically a blackfriday.Html Enabling Hugo to customise the rendering experience.
HugoMmarkHTMLRenderer wraps a mmark.Renderer, typically a mmark.html, enabling Hugo to customise the rendering experience.
HugoVersion represents the Hugo build version.
Language manages specific-language configuration.
PathSpec holds methods that decides how paths in URLs and files in Hugo should look like.
RenderingContext holds contextual information, like content and configuration, for a given content rendering.

# Type aliases

Languages is a sortable list of languages.