github.com/graemephi/kahugo@v0.62.3-0.20211121071557-d78c0423784d/resources/page/page_marshaljson.autogen.go (about) 1 // Copyright 2019 The Hugo Authors. All rights reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // http://www.apache.org/licenses/LICENSE-2.0 7 // 8 // Unless required by applicable law or agreed to in writing, software 9 // distributed under the License is distributed on an "AS IS" BASIS, 10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // See the License for the specific language governing permissions and 12 // limitations under the License. 13 14 // This file is autogenerated. 15 16 package page 17 18 import ( 19 "encoding/json" 20 "github.com/bep/gitmap" 21 "github.com/gohugoio/hugo/common/maps" 22 "github.com/gohugoio/hugo/config" 23 "github.com/gohugoio/hugo/hugofs/files" 24 "github.com/gohugoio/hugo/identity" 25 "github.com/gohugoio/hugo/langs" 26 "github.com/gohugoio/hugo/media" 27 "github.com/gohugoio/hugo/navigation" 28 "github.com/gohugoio/hugo/source" 29 "html/template" 30 "time" 31 ) 32 33 func MarshalPageToJSON(p Page) ([]byte, error) { 34 content, err := p.Content() 35 if err != nil { 36 return nil, err 37 } 38 plain := p.Plain() 39 plainWords := p.PlainWords() 40 summary := p.Summary() 41 truncated := p.Truncated() 42 fuzzyWordCount := p.FuzzyWordCount() 43 wordCount := p.WordCount() 44 readingTime := p.ReadingTime() 45 length := p.Len() 46 tableOfContents := p.TableOfContents() 47 rawContent := p.RawContent() 48 resourceType := p.ResourceType() 49 mediaType := p.MediaType() 50 permalink := p.Permalink() 51 relPermalink := p.RelPermalink() 52 name := p.Name() 53 title := p.Title() 54 params := p.Params() 55 data := p.Data() 56 date := p.Date() 57 lastmod := p.Lastmod() 58 publishDate := p.PublishDate() 59 expiryDate := p.ExpiryDate() 60 aliases := p.Aliases() 61 bundleType := p.BundleType() 62 description := p.Description() 63 draft := p.Draft() 64 isHome := p.IsHome() 65 keywords := p.Keywords() 66 kind := p.Kind() 67 layout := p.Layout() 68 linkTitle := p.LinkTitle() 69 isNode := p.IsNode() 70 isPage := p.IsPage() 71 path := p.Path() 72 slug := p.Slug() 73 lang := p.Lang() 74 isSection := p.IsSection() 75 section := p.Section() 76 sectionsEntries := p.SectionsEntries() 77 sectionsPath := p.SectionsPath() 78 sitemap := p.Sitemap() 79 typ := p.Type() 80 weight := p.Weight() 81 language := p.Language() 82 file := p.File() 83 gitInfo := p.GitInfo() 84 outputFormats := p.OutputFormats() 85 alternativeOutputFormats := p.AlternativeOutputFormats() 86 menus := p.Menus() 87 translationKey := p.TranslationKey() 88 isTranslated := p.IsTranslated() 89 allTranslations := p.AllTranslations() 90 translations := p.Translations() 91 getIdentity := p.GetIdentity() 92 93 s := struct { 94 Content interface{} 95 Plain string 96 PlainWords []string 97 Summary template.HTML 98 Truncated bool 99 FuzzyWordCount int 100 WordCount int 101 ReadingTime int 102 Len int 103 TableOfContents template.HTML 104 RawContent string 105 ResourceType string 106 MediaType media.Type 107 Permalink string 108 RelPermalink string 109 Name string 110 Title string 111 Params maps.Params 112 Data interface{} 113 Date time.Time 114 Lastmod time.Time 115 PublishDate time.Time 116 ExpiryDate time.Time 117 Aliases []string 118 BundleType files.ContentClass 119 Description string 120 Draft bool 121 IsHome bool 122 Keywords []string 123 Kind string 124 Layout string 125 LinkTitle string 126 IsNode bool 127 IsPage bool 128 Path string 129 Slug string 130 Lang string 131 IsSection bool 132 Section string 133 SectionsEntries []string 134 SectionsPath string 135 Sitemap config.Sitemap 136 Type string 137 Weight int 138 Language *langs.Language 139 File source.File 140 GitInfo *gitmap.GitInfo 141 OutputFormats OutputFormats 142 AlternativeOutputFormats OutputFormats 143 Menus navigation.PageMenus 144 TranslationKey string 145 IsTranslated bool 146 AllTranslations Pages 147 Translations Pages 148 GetIdentity identity.Identity 149 }{ 150 Content: content, 151 Plain: plain, 152 PlainWords: plainWords, 153 Summary: summary, 154 Truncated: truncated, 155 FuzzyWordCount: fuzzyWordCount, 156 WordCount: wordCount, 157 ReadingTime: readingTime, 158 Len: length, 159 TableOfContents: tableOfContents, 160 RawContent: rawContent, 161 ResourceType: resourceType, 162 MediaType: mediaType, 163 Permalink: permalink, 164 RelPermalink: relPermalink, 165 Name: name, 166 Title: title, 167 Params: params, 168 Data: data, 169 Date: date, 170 Lastmod: lastmod, 171 PublishDate: publishDate, 172 ExpiryDate: expiryDate, 173 Aliases: aliases, 174 BundleType: bundleType, 175 Description: description, 176 Draft: draft, 177 IsHome: isHome, 178 Keywords: keywords, 179 Kind: kind, 180 Layout: layout, 181 LinkTitle: linkTitle, 182 IsNode: isNode, 183 IsPage: isPage, 184 Path: path, 185 Slug: slug, 186 Lang: lang, 187 IsSection: isSection, 188 Section: section, 189 SectionsEntries: sectionsEntries, 190 SectionsPath: sectionsPath, 191 Sitemap: sitemap, 192 Type: typ, 193 Weight: weight, 194 Language: language, 195 File: file, 196 GitInfo: gitInfo, 197 OutputFormats: outputFormats, 198 AlternativeOutputFormats: alternativeOutputFormats, 199 Menus: menus, 200 TranslationKey: translationKey, 201 IsTranslated: isTranslated, 202 AllTranslations: allTranslations, 203 Translations: translations, 204 GetIdentity: getIdentity, 205 } 206 207 return json.Marshal(&s) 208 }