2019-01-02 06:33:26 -05:00
|
|
|
// Copyright 2019 The Hugo Authors. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
// Package page contains the core interfaces and types for the Page resource,
|
|
|
|
// a core component in Hugo.
|
|
|
|
package page
|
|
|
|
|
|
|
|
import (
|
2022-10-26 04:09:38 -04:00
|
|
|
"bytes"
|
2023-02-11 10:20:24 -05:00
|
|
|
"context"
|
2019-01-02 06:33:26 -05:00
|
|
|
"html/template"
|
|
|
|
"time"
|
|
|
|
|
2020-09-07 09:07:10 -04:00
|
|
|
"github.com/gohugoio/hugo/identity"
|
2022-10-26 04:09:38 -04:00
|
|
|
"github.com/gohugoio/hugo/markup/converter"
|
2023-02-11 10:20:24 -05:00
|
|
|
"github.com/gohugoio/hugo/markup/tableofcontents"
|
2020-09-07 09:07:10 -04:00
|
|
|
|
2019-09-10 05:26:34 -04:00
|
|
|
"github.com/gohugoio/hugo/hugofs/files"
|
2020-09-07 09:07:10 -04:00
|
|
|
"github.com/gohugoio/hugo/tpl"
|
2019-09-10 05:26:34 -04:00
|
|
|
|
Add Hugo Modules
This commit implements Hugo Modules.
This is a broad subject, but some keywords include:
* A new `module` configuration section where you can import almost anything. You can configure both your own file mounts nd the file mounts of the modules you import. This is the new recommended way of configuring what you earlier put in `configDir`, `staticDir` etc. And it also allows you to mount folders in non-Hugo-projects, e.g. the `SCSS` folder in the Bootstrap GitHub project.
* A module consists of a set of mounts to the standard 7 component types in Hugo: `static`, `content`, `layouts`, `data`, `assets`, `i18n`, and `archetypes`. Yes, Theme Components can now include content, which should be very useful, especially in bigger multilingual projects.
* Modules not in your local file cache will be downloaded automatically and even "hot replaced" while the server is running.
* Hugo Modules supports and encourages semver versioned modules, and uses the minimal version selection algorithm to resolve versions.
* A new set of CLI commands are provided to manage all of this: `hugo mod init`, `hugo mod get`, `hugo mod graph`, `hugo mod tidy`, and `hugo mod vendor`.
All of the above is backed by Go Modules.
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940
Fixes #6074
Fixes #6082
Fixes #6092
2019-05-03 03:16:58 -04:00
|
|
|
"github.com/gohugoio/hugo/hugofs"
|
|
|
|
|
2019-01-02 06:33:26 -05:00
|
|
|
"github.com/gohugoio/hugo/navigation"
|
|
|
|
|
|
|
|
"github.com/gohugoio/hugo/common/hugo"
|
|
|
|
"github.com/gohugoio/hugo/common/maps"
|
|
|
|
"github.com/gohugoio/hugo/source"
|
|
|
|
|
|
|
|
"github.com/gohugoio/hugo/config"
|
|
|
|
"github.com/gohugoio/hugo/langs"
|
|
|
|
"github.com/gohugoio/hugo/media"
|
|
|
|
"github.com/gohugoio/hugo/related"
|
|
|
|
"github.com/gohugoio/hugo/resources/resource"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2022-10-26 04:09:38 -04:00
|
|
|
NopPage Page = new(nopPage)
|
|
|
|
NopContentRenderer ContentRenderer = new(nopContentRenderer)
|
|
|
|
NopCPageContentRenderer = struct {
|
|
|
|
OutputFormatPageContentProvider
|
|
|
|
ContentRenderer
|
|
|
|
}{
|
|
|
|
NopPage,
|
|
|
|
NopContentRenderer,
|
|
|
|
}
|
2019-01-02 06:33:26 -05:00
|
|
|
NilPage *nopPage
|
|
|
|
)
|
|
|
|
|
|
|
|
// PageNop implements Page, but does nothing.
|
|
|
|
type nopPage int
|
|
|
|
|
2022-03-24 03:12:51 -04:00
|
|
|
func (p *nopPage) Err() resource.ResourceError {
|
2021-12-09 10:57:05 -05:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-01-02 06:33:26 -05:00
|
|
|
func (p *nopPage) Aliases() []string {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
func (p *nopPage) Sitemap() config.SitemapConfig {
|
|
|
|
return config.SitemapConfig{}
|
2019-01-02 06:33:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Layout() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) RSSLink() template.URL {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Author() Author {
|
|
|
|
return Author{}
|
|
|
|
}
|
2020-12-02 07:23:25 -05:00
|
|
|
|
2019-01-02 06:33:26 -05:00
|
|
|
func (p *nopPage) Authors() AuthorList {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) AllTranslations() Pages {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) LanguagePrefix() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) AlternativeOutputFormats() OutputFormats {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) BaseFileName() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2019-09-10 05:26:34 -04:00
|
|
|
func (p *nopPage) BundleType() files.ContentClass {
|
2019-01-02 06:33:26 -05:00
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2023-02-11 10:20:24 -05:00
|
|
|
func (p *nopPage) Content(context.Context) (any, error) {
|
2019-01-02 06:33:26 -05:00
|
|
|
return "", nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) ContentBaseName() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) CurrentSection() Page {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (p *nopPage) Data() any {
|
2019-01-02 06:33:26 -05:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Date() (t time.Time) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Description() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (p *nopPage) RefFrom(argsm map[string]any, source any) (string, error) {
|
2019-01-02 06:33:26 -05:00
|
|
|
return "", nil
|
|
|
|
}
|
2020-12-02 07:23:25 -05:00
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (p *nopPage) RelRefFrom(argsm map[string]any, source any) (string, error) {
|
2019-01-02 06:33:26 -05:00
|
|
|
return "", nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Dir() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Draft() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (p *nopPage) Eq(other any) bool {
|
2019-01-02 06:33:26 -05:00
|
|
|
return p == other
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) ExpiryDate() (t time.Time) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Ext() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Extension() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
var nilFile *source.FileInfo
|
|
|
|
|
|
|
|
func (p *nopPage) File() source.File {
|
|
|
|
return nilFile
|
|
|
|
}
|
|
|
|
|
Add Hugo Modules
This commit implements Hugo Modules.
This is a broad subject, but some keywords include:
* A new `module` configuration section where you can import almost anything. You can configure both your own file mounts nd the file mounts of the modules you import. This is the new recommended way of configuring what you earlier put in `configDir`, `staticDir` etc. And it also allows you to mount folders in non-Hugo-projects, e.g. the `SCSS` folder in the Bootstrap GitHub project.
* A module consists of a set of mounts to the standard 7 component types in Hugo: `static`, `content`, `layouts`, `data`, `assets`, `i18n`, and `archetypes`. Yes, Theme Components can now include content, which should be very useful, especially in bigger multilingual projects.
* Modules not in your local file cache will be downloaded automatically and even "hot replaced" while the server is running.
* Hugo Modules supports and encourages semver versioned modules, and uses the minimal version selection algorithm to resolve versions.
* A new set of CLI commands are provided to manage all of this: `hugo mod init`, `hugo mod get`, `hugo mod graph`, `hugo mod tidy`, and `hugo mod vendor`.
All of the above is backed by Go Modules.
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940
Fixes #6074
Fixes #6082
Fixes #6092
2019-05-03 03:16:58 -04:00
|
|
|
func (p *nopPage) FileInfo() hugofs.FileMetaInfo {
|
2019-01-02 06:33:26 -05:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Filename() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) FirstSection() Page {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-02-11 10:20:24 -05:00
|
|
|
func (p *nopPage) FuzzyWordCount(context.Context) int {
|
2019-01-02 06:33:26 -05:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) GetPage(ref string) (Page, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2020-09-07 09:07:10 -04:00
|
|
|
func (p *nopPage) GetPageWithTemplateInfo(info tpl.Info, ref string) (Page, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (p *nopPage) GetParam(key string) any {
|
2019-01-02 06:33:26 -05:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-02-19 03:16:27 -05:00
|
|
|
func (p *nopPage) GetTerms(taxonomy string) Pages {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-12-30 03:20:58 -05:00
|
|
|
func (p *nopPage) GitInfo() source.GitInfo {
|
|
|
|
return source.GitInfo{}
|
2019-01-02 06:33:26 -05:00
|
|
|
}
|
|
|
|
|
2022-02-27 13:40:07 -05:00
|
|
|
func (p *nopPage) CodeOwners() []string {
|
2022-02-18 15:28:02 -05:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-01-02 06:33:26 -05:00
|
|
|
func (p *nopPage) HasMenuCurrent(menuID string, me *navigation.MenuEntry) bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) HasShortcode(name string) bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
func (p *nopPage) Hugo() (h hugo.HugoInfo) {
|
2019-01-02 06:33:26 -05:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (p *nopPage) InSection(other any) (bool, error) {
|
2019-01-02 06:33:26 -05:00
|
|
|
return false, nil
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (p *nopPage) IsAncestor(other any) (bool, error) {
|
2019-01-02 06:33:26 -05:00
|
|
|
return false, nil
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (p *nopPage) IsDescendant(other any) (bool, error) {
|
2019-01-02 06:33:26 -05:00
|
|
|
return false, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) IsDraft() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) IsHome() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) IsMenuCurrent(menuID string, inme *navigation.MenuEntry) bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) IsNode() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) IsPage() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) IsSection() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) IsTranslated() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Keywords() []string {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Kind() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Lang() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Language() *langs.Language {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Lastmod() (t time.Time) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2023-02-11 10:20:24 -05:00
|
|
|
func (p *nopPage) Len(context.Context) int {
|
2019-01-02 06:33:26 -05:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) LinkTitle() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) LogicalName() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) MediaType() (m media.Type) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Menus() (m navigation.PageMenus) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Name() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Next() Page {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) OutputFormats() OutputFormats {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Pages() Pages {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-08-03 11:27:40 -04:00
|
|
|
func (p *nopPage) RegularPages() Pages {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-03-16 06:37:57 -04:00
|
|
|
func (p *nopPage) RegularPagesRecursive() Pages {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (p *nopPage) Paginate(seq any, options ...any) (*Pager, error) {
|
2019-01-02 06:33:26 -05:00
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (p *nopPage) Paginator(options ...any) (*Pager, error) {
|
2019-01-02 06:33:26 -05:00
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (p *nopPage) Param(key any) (any, error) {
|
2019-01-02 06:33:26 -05:00
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2019-11-21 15:59:38 -05:00
|
|
|
func (p *nopPage) Params() maps.Params {
|
2019-01-02 06:33:26 -05:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-03-25 02:54:10 -04:00
|
|
|
func (p *nopPage) Page() Page {
|
|
|
|
return p
|
|
|
|
}
|
|
|
|
|
2019-01-02 06:33:26 -05:00
|
|
|
func (p *nopPage) Parent() Page {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-11-29 23:02:57 -05:00
|
|
|
func (p *nopPage) Ancestors() Pages {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-01-02 06:33:26 -05:00
|
|
|
func (p *nopPage) Path() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2022-01-04 07:07:10 -05:00
|
|
|
func (p *nopPage) Pathc() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2019-01-02 06:33:26 -05:00
|
|
|
func (p *nopPage) Permalink() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2023-02-11 10:20:24 -05:00
|
|
|
func (p *nopPage) Plain(context.Context) string {
|
2019-01-02 06:33:26 -05:00
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2023-02-11 10:20:24 -05:00
|
|
|
func (p *nopPage) PlainWords(context.Context) []string {
|
2019-01-02 06:33:26 -05:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Prev() Page {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) PublishDate() (t time.Time) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) PrevInSection() Page {
|
|
|
|
return nil
|
|
|
|
}
|
2020-12-02 07:23:25 -05:00
|
|
|
|
2019-01-02 06:33:26 -05:00
|
|
|
func (p *nopPage) NextInSection() Page {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) PrevPage() Page {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) NextPage() Page {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) RawContent() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2023-08-01 12:12:36 -04:00
|
|
|
func (p *nopPage) RenderShortcodes(ctx context.Context) (template.HTML, error) {
|
|
|
|
return "", nil
|
|
|
|
}
|
|
|
|
|
2023-02-11 10:20:24 -05:00
|
|
|
func (p *nopPage) ReadingTime(context.Context) int {
|
2019-01-02 06:33:26 -05:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (p *nopPage) Ref(argsm map[string]any) (string, error) {
|
2019-01-02 06:33:26 -05:00
|
|
|
return "", nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) RelPermalink() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (p *nopPage) RelRef(argsm map[string]any) (string, error) {
|
2019-01-02 06:33:26 -05:00
|
|
|
return "", nil
|
|
|
|
}
|
|
|
|
|
2023-02-11 10:20:24 -05:00
|
|
|
func (p *nopPage) Render(ctx context.Context, layout ...string) (template.HTML, error) {
|
2019-11-27 07:42:36 -05:00
|
|
|
return "", nil
|
|
|
|
}
|
|
|
|
|
2023-02-11 10:20:24 -05:00
|
|
|
func (p *nopPage) RenderString(ctx context.Context, args ...any) (template.HTML, error) {
|
2019-11-27 07:42:36 -05:00
|
|
|
return "", nil
|
2019-01-02 06:33:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) ResourceType() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Resources() resource.Resources {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Scratch() *maps.Scratch {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-02-22 08:42:33 -05:00
|
|
|
func (p *nopPage) Store() *maps.Scratch {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-01-02 06:33:26 -05:00
|
|
|
func (p *nopPage) RelatedKeywords(cfg related.IndexConfig) ([]related.Keyword, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Section() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Sections() Pages {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) SectionsEntries() []string {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) SectionsPath() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Site() Site {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Sites() Sites {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Slug() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) String() string {
|
|
|
|
return "nopPage"
|
|
|
|
}
|
|
|
|
|
2023-02-11 10:20:24 -05:00
|
|
|
func (p *nopPage) Summary(context.Context) template.HTML {
|
2019-01-02 06:33:26 -05:00
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2023-02-11 10:20:24 -05:00
|
|
|
func (p *nopPage) TableOfContents(context.Context) template.HTML {
|
2019-01-02 06:33:26 -05:00
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Title() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) TranslationBaseName() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) TranslationKey() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Translations() Pages {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-02-11 10:20:24 -05:00
|
|
|
func (p *nopPage) Truncated(context.Context) bool {
|
2019-01-02 06:33:26 -05:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Type() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) URL() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) UniqueID() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *nopPage) Weight() int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2023-02-11 10:20:24 -05:00
|
|
|
func (p *nopPage) WordCount(context.Context) int {
|
2019-01-02 06:33:26 -05:00
|
|
|
return 0
|
|
|
|
}
|
2020-09-07 09:07:10 -04:00
|
|
|
|
|
|
|
func (p *nopPage) GetIdentity() identity.Identity {
|
|
|
|
return identity.NewPathIdentity("content", "foo/bar.md")
|
|
|
|
}
|
2022-10-26 04:09:38 -04:00
|
|
|
|
2023-02-11 10:20:24 -05:00
|
|
|
func (p *nopPage) Fragments(context.Context) *tableofcontents.Fragments {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (p *nopPage) HeadingsFiltered(context.Context) tableofcontents.Headings {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-10-26 04:09:38 -04:00
|
|
|
type nopContentRenderer int
|
|
|
|
|
2023-02-24 01:23:10 -05:00
|
|
|
func (r *nopContentRenderer) ParseAndRenderContent(ctx context.Context, content []byte, renderTOC bool) (converter.ResultRender, error) {
|
2022-10-26 04:09:38 -04:00
|
|
|
b := &bytes.Buffer{}
|
|
|
|
return b, nil
|
|
|
|
}
|
2023-02-24 01:23:10 -05:00
|
|
|
|
|
|
|
func (r *nopContentRenderer) ParseContent(ctx context.Context, content []byte) (converter.ResultParse, bool, error) {
|
|
|
|
return nil, false, nil
|
|
|
|
}
|
|
|
|
func (r *nopContentRenderer) RenderContent(ctx context.Context, content []byte, doc any) (converter.ResultRender, bool, error) {
|
|
|
|
return nil, false, nil
|
|
|
|
}
|