Documentation
¶
Index ¶
- Constants
- Variables
- func AddFileInfoToError(err error, fi fs.FileMetaInfo, fs afero.Fs) error
- func CheckCascadePattern(m PageMatcher)
- func CreateShortcodePlaceholder(sid string, id uint64, ordinal int) string
- func DecodeCascadeConfig(in any) (map[PageMatcher]maps.Params, error)
- func GetKindAny(s string) string
- func GetKindMain(s string) string
- func GetParam(p maps.Params, key string, stringToLower bool) any
- func GetParamToLower(m maps.Params, key string) any
- func GetPluralCount(v any) any
- func IsBranch(kind string) bool
- func IsDeprecatedAndReplacedWith(s string) string
- func NewPageInfo(name, kind, dir string, sections []string, buf *bytes.Buffer) contenthub.PageInfo
- func NewZeroFile() contenthub.File
- func Param(r contenthub.ResourceParamsProvider, fallback maps.Params, key any) (any, error)
- func PosFromInput(filename string, input []byte, offset int) text.Position
- func PutPagePathBuilder(b *PagePathBuilder)
- func SetupDefaultContentTypes()
- func SortByDefault(pages contenthub.Pages)
- func SortByLanguage(pages contenthub.Pages)
- func SortByWeight(pages contenthub.Pages)
- func UniqueStringsReuse(s []string) []string
- type BundleType
- type Cascade
- type ContentSummary
- type ContentTypes
- func (t ContentTypes) FromTypes(types media.Types) ContentTypes
- func (t ContentTypes) IsContentFile(filename string) bool
- func (t ContentTypes) IsContentSuffix(suffix string) bool
- func (t ContentTypes) IsHTMLSuffix(suffix string) bool
- func (t ContentTypes) IsIndexContentFile(filename string) bool
- func (t ContentTypes) Types() media.Types
- type ConverterProvider
- type ConverterRegistry
- type File
- func (fi *File) BaseFileName() string
- func (fi *File) ContentBaseName() string
- func (fi *File) Dir() string
- func (fi *File) Ext() string
- func (fi *File) FileInfo() fs.FileMetaInfo
- func (fi *File) Filename() string
- func (fi *File) IsZero() bool
- func (fi *File) LogicalName() string
- func (fi *File) Open() (io.ReadSeekCloser, error)
- func (fi *File) Opener() io.OpenReadSeekCloser
- func (fi *File) PageFile() contenthub.File
- func (fi *File) Path() string
- func (fi *File) Paths() *paths.Path
- func (fi *File) RelPath() string
- func (fi *File) Section() string
- func (fi *File) ShiftToResource()
- func (fi *File) String() string
- func (fi *File) TranslationBaseName() string
- func (fi *File) Type() string
- func (fi *File) UniqueID() string
- type FileManager
- type FragmentKeyword
- type FrontMatter
- type FrontMatterParser
- type HtmlSummary
- type Identity
- type IndexConfig
- func (cfg IndexConfig) ApplyFilter() bool
- func (cfg IndexConfig) CardinalityThreshold() int
- func (cfg IndexConfig) Name() string
- func (cfg IndexConfig) Pattern() string
- func (cfg IndexConfig) ToKeywords(v any) ([]contenthub.Keyword, error)
- func (cfg IndexConfig) ToLower() bool
- func (cfg IndexConfig) Type() string
- func (cfg IndexConfig) Weight() int
- type IntCount
- type ItemHandler
- type IterHandler
- type LayoutDescriptor
- type LayoutHandler
- type LayoutLooker
- type PageContentReplacement
- type PageGroup
- type PageMatcher
- type PageMatcherParamsConfig
- type PagePathBuilder
- func (p *PagePathBuilder) Add(el ...string)
- func (p *PagePathBuilder) ConcatLast(s string)
- func (p *PagePathBuilder) IsHtmlIndex() bool
- func (p *PagePathBuilder) Last() string
- func (p *PagePathBuilder) Link() string
- func (p *PagePathBuilder) LinkDir() string
- func (p *PagePathBuilder) Path(upperOffset int) string
- func (p *PagePathBuilder) PathDir() string
- func (p *PagePathBuilder) PathDirBase() string
- func (p *PagePathBuilder) PathFile() string
- func (p *PagePathBuilder) Prepend(el ...string)
- func (p *PagePathBuilder) Sanitize()
- type Pager
- func (p *Pager) First() contenthub.Pager
- func (p *Pager) HasNext() bool
- func (p *Pager) HasPrev() bool
- func (p *Pager) Last() contenthub.Pager
- func (p *Pager) Next() contenthub.Pager
- func (p *Pager) NumberOfElements() int
- func (p *Pager) PageNumber() int
- func (p *Pager) Pages() contenthub.Pages
- func (p *Pager) Prev() contenthub.Pager
- func (p *Pager) URL() string
- type Paginator
- type PaginatorEmpty
- type SearchOpts
- type Shortcode
- type ShortcodeParser
- type ShortcodeRenderFunc
- type ShortcodeRenderer
- type SourceHandlers
- type SourceParseInfo
- type StringKeyword
- type Target
- type TocConfig
- type WhatChanged
Constants ¶
const ( KindPage = "page" KindHome = "home" KindSection = "section" // Note that before Hugo 0.73 these were confusingly named // taxonomy (now: term) // taxonomyTerm (now: taxonomy) KindTaxonomy = "taxonomy" KindTerm = "term" // The following are (currently) temporary nodes, // i.e. nodes we create just to render in isolation. KindRSS = "rss" KindSitemap = "sitemap" KindSitemapIndex = "sitemapindex" KindRobotsTXT = "robotstxt" KindStatus404 = "404" )
const ( TypeBasic = "basic" TypeFragments = "fragments" )
const ShortcodePlaceholderPrefix = "HAHAHUGOSHORTCODE"
Variables ¶
var ( // This is all the kinds we can expect to find in .Site.Pages. AllKindsInPages []string // This is all the kinds, including the temporary ones. AllKinds []string )
var DefaultTocConfig = TocConfig{ StartLevel: 2, EndLevel: 3, Ordered: false, }
DefaultTocConfig is the default ToC configuration.
var MDProvider contenthub.ProviderProvider = provide{}
MDProvider is the package entry point.
var (
NilPage *nopPage
)
var TocShortcodePlaceholder = CreateShortcodePlaceholder("TOC", 0, 0)
var ZeroShortcode = prerenderedShortcode{}
Functions ¶
func AddFileInfoToError ¶
AddFileInfoToError adds file info to the given error.
func CheckCascadePattern ¶
func CheckCascadePattern(m PageMatcher)
func DecodeCascadeConfig ¶
func DecodeCascadeConfig(in any) (map[PageMatcher]maps.Params, error)
func GetKindAny ¶
GetKindAny gets the page kind given a string, empty if not found.
func GetKindMain ¶
GetKindMain gets the page kind given a string, empty if not found. Note that this will not return any temporary kinds (e.g. robotstxt).
func GetPluralCount ¶
func IsDeprecatedAndReplacedWith ¶
IsDeprecatedAndReplacedWith returns the new kind if the given kind is deprecated.
func NewPageInfo ¶
func NewZeroFile ¶
func NewZeroFile() contenthub.File
func Param ¶
func Param(r contenthub.ResourceParamsProvider, fallback maps.Params, key any) (any, error)
func PutPagePathBuilder ¶
func PutPagePathBuilder(b *PagePathBuilder)
func SetupDefaultContentTypes ¶
func SetupDefaultContentTypes()
func SortByDefault ¶
func SortByDefault(pages contenthub.Pages)
SortByDefault sorts pages by the default sort.
func SortByLanguage ¶
func SortByLanguage(pages contenthub.Pages)
func UniqueStringsReuse ¶
UniqueStringsReuse returns a slice with any duplicates removed. It will modify the input slice.
Types ¶
type BundleType ¶
type BundleType int
const ( // BundleTypeFile A generic resource, e.g. a JSON file. BundleTypeFile BundleType = iota // BundleTypeContentResource All below are content files. // A resource of a content type with front matter. // A single file but not leaf BundleTypeContentResource // BundleTypeContentSingle E.g. /blog/my-post.md BundleTypeContentSingle // BundleTypeLeaf Leaf bundles, e.g. /blog/my-post/index.md BundleTypeLeaf // BundleTypeBranch Branch bundles, e.g. /blog/_index.md BundleTypeBranch )
func (BundleType) IsBranchBundle ¶
func (b BundleType) IsBranchBundle() bool
func (BundleType) IsBundle ¶
func (b BundleType) IsBundle() bool
func (BundleType) IsContent ¶
func (b BundleType) IsContent() bool
IsContent returns true if the path is a content file (e.g. mypost.md). Note that this will also return true for content files in a bundle.
func (BundleType) IsContentResource ¶
func (b BundleType) IsContentResource() bool
func (BundleType) IsLeafBundle ¶
func (b BundleType) IsLeafBundle() bool
type ContentSummary ¶
type ContentSummary struct {
Content template.HTML
Summary template.HTML
SummaryTruncated bool
TableOfContentsHTML template.HTML
WordCount int
ReadingTime int
MarkdownResult markdown.Result
}
func NewEmptyContentSummary ¶
func NewEmptyContentSummary() ContentSummary
func (*ContentSummary) ExtractSummary ¶
func (c *ContentSummary) ExtractSummary(input []byte, mt media.Type)
func (*ContentSummary) IsSummaryEmpty ¶
func (c *ContentSummary) IsSummaryEmpty() bool
type ContentTypes ¶
type ContentTypes struct {
HTML media.Type
Markdown media.Type
AsciiDoc media.Type
Pandoc media.Type
ReStructuredText media.Type
EmacsOrgMode media.Type
// contains filtered or unexported fields
}
ContentTypes holds the media types that are considered content in Hugo.
var DefaultContentTypes ContentTypes
func (ContentTypes) FromTypes ¶
func (t ContentTypes) FromTypes(types media.Types) ContentTypes
FromTypes creates a new ContentTypes updated with the values from the given Types.
func (ContentTypes) IsContentFile ¶
func (t ContentTypes) IsContentFile(filename string) bool
IsContentFile returns whether the given filename is a content file.
func (ContentTypes) IsContentSuffix ¶
func (t ContentTypes) IsContentSuffix(suffix string) bool
func (ContentTypes) IsHTMLSuffix ¶
func (t ContentTypes) IsHTMLSuffix(suffix string) bool
IsHTMLSuffix returns whether the given suffix is a HTML media type.
func (ContentTypes) IsIndexContentFile ¶
func (t ContentTypes) IsIndexContentFile(filename string) bool
IsIndexContentFile returns whether the given filename is an index content file.
func (ContentTypes) Types ¶
func (t ContentTypes) Types() media.Types
Types is a slice of media types.
type ConverterProvider ¶
type ConverterProvider struct {
// contains filtered or unexported fields
}
func (ConverterProvider) Name ¶
func (n ConverterProvider) Name() string
func (ConverterProvider) New ¶
func (n ConverterProvider) New(ctx markdown.DocumentContext) (contenthub.Converter, error)
type ConverterRegistry ¶
type ConverterRegistry struct {
// Maps name (md, markdown, goldmark etc.) to a converter provider.
// Note that this is also used for aliasing, so the same converter
// may be registered multiple times.
// All names are lower case.
Converters map[string]contenthub.ConverterProvider
}
func (*ConverterRegistry) Get ¶
func (r *ConverterRegistry) Get(name string) contenthub.ConverterProvider
type File ¶
type File struct {
fs.FileMetaInfo
BundleType
// contains filtered or unexported fields
}
File describes a source file.
func NewFileInfo ¶
func NewFileInfo(fi fs.FileMetaInfo) (*File, error)
func (*File) BaseFileName ¶
BaseFileName returns a file's name without extension (e.g. "page.sv").
func (*File) ContentBaseName ¶
ContentBaseName is a either TranslationBaseName or name of containing folder if file is a bundle.
func (*File) Dir ¶
Dir gets the name of the directory that contains this file. The directory is relative to the content root.
func (*File) FileInfo ¶
func (fi *File) FileInfo() fs.FileMetaInfo
FileInfo returns a file's underlying os.FileInfo.
func (*File) LogicalName ¶
LogicalName returns a file's name and extension (e.g. "page.sv.md").
func (*File) Opener ¶
func (fi *File) Opener() io.OpenReadSeekCloser
func (*File) PageFile ¶
func (fi *File) PageFile() contenthub.File
func (*File) RelPath ¶
RelPath Paths gets the relative path including file name and extension. The directory is relative to the content root.
func (*File) ShiftToResource ¶
func (fi *File) ShiftToResource()
func (*File) TranslationBaseName ¶
TranslationBaseName returns a file's translation base name without the language segment (e.g. "page").
type FileManager ¶
type FileManager struct {
// contains filtered or unexported fields
}
func NewFsManager ¶
func NewFsManager(fis []fs.FileMetaInfo) *FileManager
func (*FileManager) GetLeaf ¶
func (f *FileManager) GetLeaf() *File
type FragmentKeyword ¶
type FragmentKeyword string
FragmentKeyword represents a document fragment.
func (FragmentKeyword) String ¶
func (f FragmentKeyword) String() string
type FrontMatter ¶
type FrontMatter struct {
*Cascade
Path string
Lang string
Kind string
Title string
Weight int
Date time.Time
Terms map[string][]string
Params maps.Params
}
func NewFrontMatter ¶
func NewFrontMatter() *FrontMatter
type FrontMatterParser ¶
type FrontMatterParser struct {
Params maps.Params
LangSvc contenthub.LangService
TaxonomySvc contenthub.TaxonomyService
}
func (*FrontMatterParser) Parse ¶
func (b *FrontMatterParser) Parse() (*FrontMatter, error)
type HtmlSummary ¶
type HtmlSummary struct {
SummaryLowHigh types.LowHigh[string]
SummaryEndTag types.LowHigh[string]
WrapperStart types.LowHigh[string]
WrapperEnd types.LowHigh[string]
Divider types.LowHigh[string]
// contains filtered or unexported fields
}
func (*HtmlSummary) Content ¶
func (s *HtmlSummary) Content() string
func (*HtmlSummary) ContentWithoutSummary ¶
func (s *HtmlSummary) ContentWithoutSummary() string
func (*HtmlSummary) Summary ¶
func (s *HtmlSummary) Summary() string
func (*HtmlSummary) Truncated ¶
func (s *HtmlSummary) Truncated() bool
type Identity ¶
func (Identity) IdentifierBase ¶
func (Identity) PageIdentity ¶
func (i Identity) PageIdentity() contenthub.PageIdentity
func (Identity) PageLanguage ¶
func (Identity) PageLanguageIndex ¶
type IndexConfig ¶
type IndexConfig struct {
// The index name. This directly maps to a field or Param name.
IndexName string
// The index type.
IndexType string
// Enable to apply a type specific filter to the results.
// This is currently only used for the "fragments" type.
IndexApplyFilter bool
// Contextual pattern used to convert the Param value into a string.
// Currently only used for dates. Can be used to, say, bump posts in the same
// time frame when searching for related documents.
// For dates it follows Go's time.Format patterns, i.e.
// "2006" for YYYY and "200601" for YYYYMM.
IndexPattern string
// This field's weight when doing multi-index searches. Higher is "better".
IndexWeight int
// A percentage (0-100) used to remove common keywords from the index.
// As an example, setting this to 50 will remove all keywords that are
// used in more than 50% of the documents in the index.
IndexCardinalityThreshold int
// Will lower case all string values in and queries tothis index.
// May get better accurate results, but at a slight performance cost.
IndexToLower bool
}
IndexConfig configures an index.
func (IndexConfig) ApplyFilter ¶
func (cfg IndexConfig) ApplyFilter() bool
func (IndexConfig) CardinalityThreshold ¶
func (cfg IndexConfig) CardinalityThreshold() int
func (IndexConfig) Name ¶
func (cfg IndexConfig) Name() string
func (IndexConfig) Pattern ¶
func (cfg IndexConfig) Pattern() string
func (IndexConfig) ToKeywords ¶
func (cfg IndexConfig) ToKeywords(v any) ([]contenthub.Keyword, error)
ToKeywords returns a Keyword slice of the given input.
func (IndexConfig) ToLower ¶
func (cfg IndexConfig) ToLower() bool
func (IndexConfig) Type ¶
func (cfg IndexConfig) Type() string
func (IndexConfig) Weight ¶
func (cfg IndexConfig) Weight() int
type ItemHandler ¶
type ItemHandler func(item pageparser.Item) error
type IterHandler ¶
type IterHandler func(item pageparser.Item, iter *pageparser.Iterator) error
type LayoutDescriptor ¶
type LayoutDescriptor struct {
Type string
Section string
// E.g. "page", but also used for the _markup render kinds, e.g. "render-images".
Kind string
// Comma-separated list of kind variants, e.g. "go,json" as variants which would find "render-codeblock-go.html"
KindVariants string
Lang string
Layout string
// LayoutOverride indicates what we should only look for the above layout.
LayoutOverride bool
RenderingHook bool
Baseof bool
FormatName string
Extension string
}
LayoutDescriptor describes how a layout should be chosen. This is typically built from a Page.
type LayoutHandler ¶
type LayoutHandler struct {
// contains filtered or unexported fields
}
LayoutHandler calculates the layout template to use to render a given output type.
func NewLayoutHandler ¶
func NewLayoutHandler() *LayoutHandler
NewLayoutHandler creates a new LayoutHandler.
func (*LayoutHandler) For ¶
func (l *LayoutHandler) For(d LayoutDescriptor) ([]string, error)
For returns a layout for the given LayoutDescriptor and options. Layouts are rendered and cached internally.
type LayoutLooker ¶
type LayoutLooker struct {
// contains filtered or unexported fields
}
func NewLayoutLooker ¶
func NewLayoutLooker(names []string, bnames []string) *LayoutLooker
func (*LayoutLooker) BaseNames ¶
func (l *LayoutLooker) BaseNames() []string
func (*LayoutLooker) Names ¶
func (l *LayoutLooker) Names() []string
type PageContentReplacement ¶
type PageContentReplacement struct {
Val []byte
Source pageparser.Item
}
type PageGroup ¶
type PageGroup struct {
// contains filtered or unexported fields
}
func (*PageGroup) Append ¶
func (p *PageGroup) Append(page contenthub.Page) contenthub.Pages
func (*PageGroup) Pages ¶
func (p *PageGroup) Pages() contenthub.Pages
type PageMatcher ¶
type PageMatcher struct {
// A Glob pattern matching the content path below /content.
// Expects Unix-styled slashes.
// Note that this is the virtual path, so it starts at the mount root
// with a leading "/".
Path string
// A Glob pattern matching the Page's Kind(s), e.g. "{home,section}"
Kind string
// A Glob pattern matching the Page's language, e.g. "{en,sv}".
Lang string
// A Glob pattern matching the Page's Environment, e.g. "{production,development}".
Environment string
}
A PageMatcher can be used to match a Page with Glob patterns. Note that the pattern matching is case insensitive.
func (PageMatcher) Matches ¶
func (m PageMatcher) Matches(p contenthub.Page) bool
Matches returns whether p matches this matcher.
type PageMatcherParamsConfig ¶
type PageMatcherParamsConfig struct {
// Apply Params to all Pages matching Target.
Params maps.Params
Target PageMatcher
}
type PagePathBuilder ¶
type PagePathBuilder struct {
// Builder state.
IsUgly bool
BaseNameSameAsType bool // Remove it, only sitemap has same basename from both output format and descriptor
NoSubResources bool
FullSuffix string // File suffix including any ".".
PrefixPath string
LinkUpperOffset int
// contains filtered or unexported fields
}
PagePathBuilder When adding state here, remember to update putPagePathBuilder.
func GetPagePathBuilder ¶
func GetPagePathBuilder(format output.Format) *PagePathBuilder
func (*PagePathBuilder) Add ¶
func (p *PagePathBuilder) Add(el ...string)
func (*PagePathBuilder) ConcatLast ¶
func (p *PagePathBuilder) ConcatLast(s string)
func (*PagePathBuilder) IsHtmlIndex ¶
func (p *PagePathBuilder) IsHtmlIndex() bool
func (*PagePathBuilder) Last ¶
func (p *PagePathBuilder) Last() string
func (*PagePathBuilder) Link ¶
func (p *PagePathBuilder) Link() string
func (*PagePathBuilder) LinkDir ¶
func (p *PagePathBuilder) LinkDir() string
func (*PagePathBuilder) Path ¶
func (p *PagePathBuilder) Path(upperOffset int) string
func (*PagePathBuilder) PathDir ¶
func (p *PagePathBuilder) PathDir() string
func (*PagePathBuilder) PathDirBase ¶
func (p *PagePathBuilder) PathDirBase() string
func (*PagePathBuilder) PathFile ¶
func (p *PagePathBuilder) PathFile() string
func (*PagePathBuilder) Prepend ¶
func (p *PagePathBuilder) Prepend(el ...string)
func (*PagePathBuilder) Sanitize ¶
func (p *PagePathBuilder) Sanitize()
type Pager ¶
type Pager struct {
*Paginator
// contains filtered or unexported fields
}
func (*Pager) First ¶
func (p *Pager) First() contenthub.Pager
func (*Pager) Last ¶
func (p *Pager) Last() contenthub.Pager
func (*Pager) Next ¶
func (p *Pager) Next() contenthub.Pager
Next returns the pager for the next page.
func (*Pager) NumberOfElements ¶
func (*Pager) PageNumber ¶
func (*Pager) Pages ¶
func (p *Pager) Pages() contenthub.Pages
func (*Pager) Prev ¶
func (p *Pager) Prev() contenthub.Pager
Prev returns the pager for the previous page.
type Paginator ¶
type Paginator struct {
// contains filtered or unexported fields
}
func NewPaginatorFromPageGroups ¶
func NewPaginatorFromPageGroups(pageGroups contenthub.PageGroups, size int, base string) (*Paginator, error)
func NewPaginatorFromPages ¶
func (*Paginator) Pagers ¶
func (p *Paginator) Pagers() contenthub.Pagers
func (*Paginator) TotalPages ¶
type PaginatorEmpty ¶
type PaginatorEmpty func() error
func (PaginatorEmpty) Current ¶
func (f PaginatorEmpty) Current() contenthub.Pager
func (PaginatorEmpty) Paginate ¶
func (f PaginatorEmpty) Paginate(groups contenthub.PageGroups) (contenthub.Pager, error)
func (PaginatorEmpty) Paginator ¶
func (f PaginatorEmpty) Paginator() (contenthub.Pager, error)
func (PaginatorEmpty) SetCurrent ¶
func (f PaginatorEmpty) SetCurrent(current contenthub.Pager)
type SearchOpts ¶
type SearchOpts struct {
// The Document to search for related content for.
Document contenthub.Document
// The keywords to search for.
NamedSlices []types.KeyValues
// The indices to search in.
Indices []string
// Fragments holds a a list of special keywords that is used
// for indices configured as type "fragments".
// This will match the fragment identifiers of the documents.
Fragments []string
}
SearchOpts holds the options for a related search.
type Shortcode ¶
type Shortcode struct {
Name string
Ordinal int
Indentation string // indentation from source.
Inner []any // string or nested shortcode
IsInline bool // inline shortcode. Any inner will be a Go template.
// If set, the rendered shortcode is sent as part of the surrounding content
// to Goldmark and similar.
// Before Hug0 0.55 we didn't send any shortcode output to the markup
// renderer, and this flag told Hugo to process the {{ .Inner }} content
// separately.
// The old behavior can be had by starting your shortcode template with:
// {{ $_hugo_config := `{ "version": 1 }`}}
DoMarkup bool
IsClosing bool // whether a closing tag was provided
Info template.Info // One of the output formats (arbitrary)
Templs []template.Preparer // All output formats
Params any // map or array
Pos int // the position in bytes in the source file
Length int // the length in bytes in the source file
// the placeholder in the source when passed to Goldmark etc.
// This also identifies the rendered shortcode.
Placeholder string
}
func (Shortcode) InsertPlaceholder ¶
func (Shortcode) NeedsInner ¶
type ShortcodeParser ¶
type ShortcodeParser struct {
// contains filtered or unexported fields
}
func NewShortcodeParser ¶
func NewShortcodeParser(source []byte, pid uint64, tmplSvc contenthub.Template) *ShortcodeParser
func (*ShortcodeParser) ParseItem ¶
func (s *ShortcodeParser) ParseItem(it pageparser.Item, pt *pageparser.Iterator) (*Shortcode, error)
type ShortcodeRenderFunc ¶
func (ShortcodeRenderFunc) RenderShortcode ¶
func (ShortcodeRenderFunc) RenderShortcodeString ¶
type ShortcodeRenderer ¶
type ShortcodeRenderer interface {
RenderShortcode(context.Context) ([]byte, bool, error)
RenderShortcodeString(context.Context) (string, bool, error)
}
ShortcodeRenderer is typically used to delay rendering of inner shortcodes marked with placeholders in the content.
func NewPrerenderedShortcode ¶
func NewPrerenderedShortcode(s string, hasVariants bool) ShortcodeRenderer
type SourceHandlers ¶
type SourceHandlers interface {
FrontMatterHandler() ItemHandler
SummaryHandler() IterHandler
BytesHandler() ItemHandler
ShortcodeHandler() IterHandler
}
type SourceParseInfo ¶
type SourceParseInfo struct {
Source []byte
// Items from the page parser.
// These maps directly to the source
ItemsStep1 pageparser.Items
Handlers SourceHandlers
// contains filtered or unexported fields
}
func NewSourceParseInfo ¶
func NewSourceParseInfo(source []byte, handlers SourceHandlers) (*SourceParseInfo, error)
func (*SourceParseInfo) Handle ¶
func (s *SourceParseInfo) Handle() error
func (*SourceParseInfo) IsEmpty ¶
func (s *SourceParseInfo) IsEmpty() bool
func (*SourceParseInfo) Parse ¶
func (s *SourceParseInfo) Parse() error
type StringKeyword ¶
type StringKeyword string
StringKeyword is a string search keyword.
func (StringKeyword) String ¶
func (s StringKeyword) String() string
type Target ¶
type Target struct {
Prefix string
// Where to store the file on disk relative to the publish dir. OS slashes.
FilePath string
// The directory to write sub-resources of the above.
SubResourceBaseTarget string
Format output.Format
}
func (*Target) TargetFileBase ¶
func (*Target) TargetFilePath ¶
func (*Target) TargetFormat ¶
func (*Target) TargetPrefix ¶
func (*Target) TargetSubResourceDir ¶
type TocConfig ¶
type TocConfig struct {
// Heading start level to include in the table of contents, starting
// at h1 (inclusive).
// <docsmeta>{ "identifiers": ["h1"] }</docsmeta>
StartLevel int
// Heading end level, inclusive, to include in the table of contents.
// Default is 3, a value of -1 will include everything.
EndLevel int
// Whether to produce a ordered list or not.
Ordered bool
}
type WhatChanged ¶
type WhatChanged struct {
IdentitySet identity.Identities
// contains filtered or unexported fields
}
func (*WhatChanged) Add ¶
func (w *WhatChanged) Add(ids ...identity.Identity)
func (*WhatChanged) Changes ¶
func (w *WhatChanged) Changes() []identity.Identity
Source Files
¶
- bundle.go
- cascade.go
- changes.go
- content.go
- contentreplacement.go
- contenttypes.go
- converter.go
- fileerr.go
- fileinfo.go
- frontmatter.go
- fsmanager.go
- i18n.go
- identity.go
- kind.go
- layout.go
- looker.go
- markdown.go
- matcher.go
- pagegroup.go
- pageinfo.go
- pagenop.go
- pager.go
- paginator.go
- paginatorempty.go
- param.go
- parseinfo.go
- scparser.go
- searchops.go
- shortcode.go
- sort.go
- summary.go
- target.go
- zero_file.autogen.go