You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dataFolder: articlesPath,//Data folder path (will fetch ALL files from here)
38
+
dataFolder: dataPath,//Data folder path (will fetch ALL files from here)
40
39
type: "api",//Type name [basically layout] (save it under "layouts/NAME/single.html" or themes/THEME/layouts/NAME/single.html). Can be overridden on individual pages by defining "type" under "fields"
41
-
pages: "articles",//Pages element in your data, in case it's "posts" or "articles" etc.
40
+
pages: "paths",//Pages element in your data, in case it's "posts" or "articles" etc.
42
41
contentPath: contentPath,//Path to content directory (in case it's not "content")
43
42
hugoPath: `${DOCS_ROOT}/node_modules/.bin/hugo-extended`//Path to hugo binary (if global, e.g. /snap/bin/hugo)
- Hugo can render the following content formats as page content:
4
+
Markdown, HTML, Emacs Org Mode, AsciiDoc, Pandoc, or reStructuredText.
5
+
6
+
- Front matter at the top of each content file is metadata that:
7
+
8
+
- Describes the content
9
+
- Augments the content
10
+
- Establishes relationships with other content
11
+
- Controls the published structure of your site
12
+
- Determines template selection
13
+
14
+
1. Create a content type (folder) or assign a `type` property for API reference (OpenAPI) paths. For example, if the page structure is `content/influxdb/v2/api/v2/[OpenAPI path]`, then add `type: api_path` to the frontmatter and, if necessary, specify a layout: `layout: api_path`.
15
+
1. Store each product's OpenAPI spec files in YAML format inside a "namespaced" (to avoid collisions) directory structure in `/data`.
16
+
1. For each product.path, generate a page with all path metadata in the frontmatter. See [`.Site.Data`](https://gohugo.io/methods/site/data/)
17
+
2. Create a template to render the path
18
+
3. Create additional templates that process page data for nav, filtering, links, code samples, etc.
19
+
20
+
21
+
22
+
## Useful functions
23
+
24
+
-[`data.GetJSON`](https://gohugo.io/functions/data/getjson/): Returns a JSON object from a local or remote JSON file, or an error if the file does not exist.
25
+
-[`resources.GetRemote URL`](https://gohugo.io/functions/resources/getremote/): fetches and caches remote resources (images, js, etc.)
0 commit comments