Documentation ¶
Index ¶
- Constants
- type BuildStateReseter
- type ContentConvertProvider
- type ContentHub
- type ContentNode
- type ContentProvider
- type Converter
- type ConverterProvider
- type ConverterRegistry
- type File
- type FileProvider
- type FileWithoutOverlap
- type FsService
- type LangService
- type MediaService
- type OrdinalWeightPage
- type Page
- type PageIdentity
- type PageInfo
- type PageMeta
- type PageMetaProvider
- type PageOutput
- type PageSource
- type PageWithoutContent
- type Pages
- type ProviderProvider
- type RawContentProvider
- type Services
- type Taxonomy
- type TaxonomyService
- type Template
- type TemplateDescriptor
- type Title
- type WalkFunc
- type WalkTaxonomyFunc
- type WeightedContentNode
Constants ¶
View Source
const ( KindPage = "page" KindHome = "home" KindSection = "section" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildStateReseter ¶
type BuildStateReseter interface {
ResetBuildState()
}
type ContentConvertProvider ¶
type ContentConvertProvider interface {
GetContentConvertProvider(name string) ConverterProvider
}
type ContentHub ¶
type ContentNode ¶
type ContentNode interface { identity.IdentityProvider identity.ForEeachIdentityProvider stale.Marker BuildStateReseter Path() string IsContentNodeBranch() bool }
type ContentProvider ¶
ContentProvider provides the content related values for a Page.
type Converter ¶
type Converter interface {
Convert(ctx markdown.RenderContext) (markdown.Result, error)
}
Converter wraps the Convert method that converts some markup into another format, e.g. Markdown to HTML.
type ConverterProvider ¶
type ConverterProvider interface { New(ctx markdown.DocumentContext) (Converter, error) Name() string }
ConverterProvider creates converters.
type ConverterRegistry ¶
type ConverterRegistry interface {
Get(name string) ConverterProvider
}
type File ¶
type File interface { FileWithoutOverlap // contains filtered or unexported methods }
File represents a source file. This is a temporary construct until we resolve page.Page conflicts.
type FileProvider ¶
type FileProvider interface {
File() File
}
FileProvider provides the source file.
type FileWithoutOverlap ¶
type FileWithoutOverlap interface { // Filename gets the full path and filename to the file. Filename() string // Dir gets the name of the directory that contains this file. // The directory is relative to the content root. Dir() string // Ext gets the file extension, i.e "myblogpost.md" will return "md". Ext() string // LogicalName is filename and extension of the file. LogicalName() string // BaseFileName is a filename without extension. BaseFileName() string // TranslationBaseName is a filename with no extension, // not even the optional language extension part. TranslationBaseName() string // ContentBaseName is a either TranslationBaseName or name of containing folder // if file is a leaf bundle. ContentBaseName() string // UniqueID is the MD5 hash of the file's path and is for most practical applications, // Hugo content files being one of them, considered to be unique. UniqueID() string FileInfo() fs.FileMetaInfo }
type FsService ¶
type FsService interface { NewFileMetaInfo(filename string) fs.FileMetaInfo LayoutFs() afero.Fs ContentFs() afero.Fs WalkContent(start string, cb fs.WalkCallback, conf fs.WalkwayConfig) error }
type LangService ¶
type MediaService ¶
type OrdinalWeightPage ¶
type Page ¶
type Page interface { RawContentProvider PageSource PageMeta Title() string Kind() string IsHome() bool IsPage() bool IsSection() bool IsAncestor(other Page) bool Eq(other Page) bool Layouts() []string PageOutputs() ([]PageOutput, error) Pages(langIndex int) Pages Terms(langIndex int, taxonomy string) Pages Translations() Pages }
Page is the core interface in Hugo.
type PageIdentity ¶
type PageMetaProvider ¶
type PageMetaProvider interface { // Kind The Page Kind. One of page, home, section, taxonomy, term. Kind() string // SectionsEntries Returns a slice of sections (directories if it's a file) to this // Page. SectionsEntries() []string // Layout The configured layout to use to render this page. Typically set in front matter. Layout() string // Type is a discriminator used to select layouts etc. It is typically set // in front matter, but will fall back to the root section. Type() string Lang() string Path() string }
PageMetaProvider provides page metadata, typically provided via front matter.
type PageOutput ¶
type PageSource ¶
type PageSource interface { PageIdentity() PageIdentity PageFile() File stale.Staler Section() string Paths() *paths.Path Path() string Opener() pio.OpenReadSeekCloser }
type PageWithoutContent ¶
type PageWithoutContent interface { // FileProvider For pages backed by a file. FileProvider PageMetaProvider }
PageWithoutContent is the Page without any of the content methods.
type ProviderProvider ¶
type ProviderProvider interface {
New() (ConverterProvider, error)
}
ProviderProvider creates converter providers.
type RawContentProvider ¶
type RawContentProvider interface { // RawContent returns the raw, unprocessed content of the page excluding any front matter. RawContent() string PureContent() string }
RawContentProvider provides the raw, unprocessed content of the page.
type Services ¶
type Services interface { LangService FsService TaxonomyService MediaService }
type TaxonomyService ¶
type TaxonomyService interface {
Views() []Taxonomy
}
type TemplateDescriptor ¶
type WalkTaxonomyFunc ¶
type WalkTaxonomyFunc func(taxonomy string, term string, page OrdinalWeightPage) error
type WeightedContentNode ¶
type WeightedContentNode interface { ContentNode Weight() int }
Click to show internal directories.
Click to hide internal directories.