| 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/gohugoio/hugo/config" |
| 21 |
"time" |
| 22 |
) |
| 23 |
|
| 24 |
func MarshalPageToJSON(p Page) ([]byte, error) { |
| 25 |
date := p.Date() |
| 26 |
lastmod := p.Lastmod() |
| 27 |
publishDate := p.PublishDate() |
| 28 |
expiryDate := p.ExpiryDate() |
| 29 |
bundleType := p.BundleType() |
| 30 |
description := p.Description() |
| 31 |
draft := p.Draft() |
| 32 |
isHome := p.IsHome() |
| 33 |
keywords := p.Keywords() |
| 34 |
kind := p.Kind() |
| 35 |
layout := p.Layout() |
| 36 |
linkTitle := p.LinkTitle() |
| 37 |
isNode := p.IsNode() |
| 38 |
isBranch := p.IsBranch() |
| 39 |
isPage := p.IsPage() |
| 40 |
path := p.Path() |
| 41 |
slug := p.Slug() |
| 42 |
isSection := p.IsSection() |
| 43 |
section := p.Section() |
| 44 |
sitemap := p.Sitemap() |
| 45 |
typ := p.Type() |
| 46 |
weight := p.Weight() |
| 47 |
|
| 48 |
s := struct { |
| 49 |
Date time.Time |
| 50 |
Lastmod time.Time |
| 51 |
PublishDate time.Time |
| 52 |
ExpiryDate time.Time |
| 53 |
BundleType string |
| 54 |
Description string |
| 55 |
Draft bool |
| 56 |
IsHome bool |
| 57 |
Keywords []string |
| 58 |
Kind string |
| 59 |
Layout string |
| 60 |
LinkTitle string |
| 61 |
IsNode bool |
| 62 |
IsBranch bool |
| 63 |
IsPage bool |
| 64 |
Path string |
| 65 |
Slug string |
| 66 |
IsSection bool |
| 67 |
Section string |
| 68 |
Sitemap config.SitemapConfig |
| 69 |
Type string |
| 70 |
Weight int |
| 71 |
}{ |
| 72 |
Date: date, |
| 73 |
Lastmod: lastmod, |
| 74 |
PublishDate: publishDate, |
| 75 |
ExpiryDate: expiryDate, |
| 76 |
BundleType: bundleType, |
| 77 |
Description: description, |
| 78 |
Draft: draft, |
| 79 |
IsHome: isHome, |
| 80 |
Keywords: keywords, |
| 81 |
Kind: kind, |
| 82 |
Layout: layout, |
| 83 |
LinkTitle: linkTitle, |
| 84 |
IsNode: isNode, |
| 85 |
IsBranch: isBranch, |
| 86 |
IsPage: isPage, |
| 87 |
Path: path, |
| 88 |
Slug: slug, |
| 89 |
IsSection: isSection, |
| 90 |
Section: section, |
| 91 |
Sitemap: sitemap, |
| 92 |
Type: typ, |
| 93 |
Weight: weight, |
| 94 |
} |
| 95 |
|
| 96 |
return json.Marshal(&s) |
| 97 |
} |