Configure Hugo for InSpec docs

Signed-off-by: IanMadd <imaddaus@chef.io>
This commit is contained in:
IanMadd 2020-07-07 17:43:46 -07:00
parent 67cead6631
commit c93a515c6f
13 changed files with 760 additions and 53 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "www/chef-web-docs"]
path = www/chef-web-docs
url = https://github.com/chef/chef-web-docs

40
www/.gitignore vendored
View file

@ -4,18 +4,32 @@
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
# Ignore bundler config
/.bundle
# Ignore the build directory
/build
# Ignore cache
/.sass-cache
/.cache
# Ignore .DS_store file
.DS_Store
# Ignore rendered files from docs/
source/docs/reference/
# ignore doctree files in translation folders
*.doctree
*.pickle
public/
/resources/
**/.sass-cache
**/.sass-cache/*
*.css.map
*.css_t.map
/.delivery/cli.toml
/.vscode
/.venv
*.*~
*~
TAGS
results/
static/fonts/fontawesome
node_modules
vendor

39
www/Makefile Normal file
View file

@ -0,0 +1,39 @@
# we use pushd/popd here, and /bin/sh of our chefes/buildkite image is not bash
# so we have to override the default shell here
SHELL=bash
assets:
git submodule update --init --recursive
git submodule foreach git pull origin master
git submodule foreach git reset --hard
pushd chef-web-docs/themes/docs-new && make assets && popd
clean:
pushd chef-web-docs/themes/docs-new && make clean && popd
rm -rf chef-web-docs/resources/
clean_all:
pushd chef-web-docs/themes/docs-new && make clean_all && popd
rm -rf chef-web-docs/resources/
rm -rf chef-web-docs/results/
preview_netlify: chef_web_docs_submodule
pushd chef-web-docs && make assets; hugo --buildFuture --gc --minify --enableGitInfo && popd
chef_web_docs_submodule:
git submodule update --init --recursive
git submodule foreach git pull origin master
git submodule foreach git reset --hard
cp -R content/* chef-web-docs/_vendor/github.com/inspec/inspec/www/content
cp -R static/images/* chef-web-docs/_vendor/github.com/inspec/inspec/www/static/images
cp -R layouts/* chef-web-docs/_vendor/github.com/inspec/inspec/www/layouts
reset_chef_web_docs:
git submodule foreach git reset --hard
git submodule foreach git clean -f -d
serve: assets
hugo server --buildDrafts --buildFuture --noHTTPCache
lint: assets
hugo -D

View file

@ -1,74 +1,442 @@
# InSpec homepage
# Chef InSpec Documentation
## Development
This is the home of the Chef InSpec documentation. This documentation provides
an introduction to this mechanism and shows how to write custom tests.
Get all dependencies:
The goal of this folder is for any community member to clone these docs, make the
changes, check if they are valid, and contribute to the project.
## The Fastest Way to Contribute
There are two steps to updating the Chef InSpec documentation:
1. Update the documentation in the inspec/inspec repository.
1. Update the InSpec repository module in chef-web-docs
### Update Content in `inspec/inspec`
The fastest way to change the documentation is to edit a page on the
GitHub website using the GitHub UI.
To perform edits using the GitHub UI, click on the `[edit on GitHub]` link at
the top of the page that you want to edit. The link takes you to that topic's GitHub
page. In GitHub, click on the pencil icon and make your changes. You can preview
how they'll look right on the page ("Preview Changes" tab).
We also require contributors to include their [DCO signoff](https://github.com/chef/chef/blob/master/CONTRIBUTING.md#developer-certification-of-origin-dco)
in the comment section of every pull request, except for obvious fixes. You can
add your DCO signoff to the comments by including `Signed-off-by:`, followed by
your name and email address, like this:
`Signed-off-by: Julia Child <juliachild@chef.io>`
See our [blog post](https://blog.chef.io/introducing-developer-certificate-of-origin/)
for more information about the DCO and why we require it.
After you've added your DCO signoff, add a comment about your proposed change,
then click on the "Propose file change" button at the bottom of the page and
confirm your pull request. The CI system will do some checks and add a comment
to your PR with the results.
The Chef documentation team can normally merge pull requests within seven days.
We'll fix build errors before we merge, so you don't have to
worry about passing all the CI checks, but it might add an extra
few days. The important part is submitting your change.
### Update the InSpec Repository Module In `chef/chef-web-docs`
We use [Hugo modules](https://gohugo.io/hugo-modules/) and [vendoring](https://gohugo.io/hugo-modules/use-modules/#vendor-your-modules)
to build Chef's documentation from multiple repositories. The Hugo modules are
pinned to commits in each repository, and the documentation files from those
repositories and commits are vendored in `chef/chef-web-docs`. When the documentation
is updated in a repository, those changes won't appear in docs.chef.io until the
Hugo modules are updated to the new commit and then vendored files are updated.
This can be useful if you want to update documentation in `inspec/inspec`, but
don't want it to appear on docs.chef.io until a later date.
To update the Hugo module for documentation in `inspec/inspec`:
1. Make sure your documentation changes are merged into master in `inspec/inspec`.
1. Contact your friendly local Docs Team who will update the InSpec Hugo module for you.
Or, for the adventurous:
1. Make sure your documentation changes are merged into master in `inspec/inspec`.
1. On a local clone of `chef/chef-web-docs` run:
1. `hugo mod get github/com/inspec/inspec/www`
1. `hugo mod tidy`
1. `hugo mod vendor`
1. Submit a pull request to `chef/chef-web-docs`.
This will updated the InSpec vendored files in `chef-web-docs/_vendor/github.com/inspec/inspec/www`,
and update the commits in the go.mod and go.sum files in chef-web-docs.
## Local Development Environment
We use [Hugo](https://gohugo.io/), [Go](https://golang.org/), and[NPM](https://www.npmjs.com/)
to build the Chef Documentation website. You will need Hugo 0.61 or higher
installed and running to build and view our documentation properly.
To install Hugo, NPM, and Go on Windows and macOS:
- On macOS run: `brew install hugo node go`
- On Windows run: `choco install hugo nodejs golang -y`
To install Hugo on Linux, run:
- `apt install -y build-essential`
- `snap install node --classic --channel=12`
- `snap install hugo --channel=extended`
## Hugo Theme
We use a git submodule to grab the Hugo theme from the `chef/chef-web-docs` repository.
## Preview Workstation Documentation
There are three ways to preview the documentation in `inspec`:
- submit a PR
- `make serve`
- preview content from `chef/chef-web-docs`
### Submit a PR
When you submit a PR to `inspec/inspec`, Netlify will build the documentation
and add a notification to the GitHub pull request page. You can review your
documentation changes as they would appear on docs.chef.io.
### make serve
`make serve` will preview the documentation that only exists in `inspec/inspec/www`.
This also shows a preview page that includes page metadata which can be useful
for changing where a page exists in the left navigation menu.
To build the docs and preview locally:
- Run `make serve`
- go to http://localhost:1313
The landing page shows navigation menu metadata and the left navigation menu
shows the menu weight for each page. You can use this information to add,
remove, or reorganize Workstation documentation in the menu. None of this will
appear on the [Chef Documentation](https://docs.chef.io) site when the workstation
content is updated.
While the Hugo server is running, any changes you make to content
in the `docs/content` directory will be automatically compiled and updated in the
browser.
#### Clean Your Local Environment
To clean your local development environment:
##### `make clean`
Deletes the sass files, javascript, and fonts in `themes/docs-new`. These will be rebuilt the next time you run `make serve`.
##### `make clean_all`
Deletes the node modules used to build this site in addition to `make clean` described above. These will be reinstalled the next time you run `make serve`.
##### `make reset_chef_web_docs`
Deletes all changes to the chef-web-docs submodule. Changes to chef-web-docs must be made in the chef/chef-web-docs repo and cannot be made from any other repository. Use `make reset_chef_web_docs` to restore the submodule to its initial state.
### Preview Content from chef/chef-web-docs
You can run the Hugo server locally from `chef/chef-web-docs` and direct Hugo to
preview content from your local copy of `inspec/inspec` instead of from the
GitHub repo. This allows you to live reload documentation in `inspec/inspec` and
see how it would look in https://docs.chef.io.
See the README in `chef/chef-web-docs` for instructions.
Also, see the [Hugo documentation](https://gohugo.io/hugo-modules/use-modules/#make-and-test-changes-in-a-module)
for previewing local changes to a module.
## Manage the chef-web-docs Git Submodule
We build previews on Netlify by adding `chef/chef-web-docs` as a Git submodule
in `docs/chef-web-docs`.
To get the commit that the chef-web-docs submodule is set to, run:
```bash
bundle install
git submodule status
```
To build the `docs/` child pages run:
To update the submodule, run:
```bash
bundle exec rake docs
git submodule foreach git pull origin master
```
To run it live run:
This will update the submodule to the latest commit in `chef/chef-web-docs`.
If local changes have been made to the chef-web-docs submodule and you want to
delete them, run:
```bash
bundle exec middleman server
make reset_chef_web_docs
```
For the online demo, take a look at `www/demo`.
This will reset the content of the chef-web-docs submodule to the commit that it
is set to.
## Building
## Creating New Pages
To build the site to a local static folder (without demo):
```bash
bundle exec middleman build
```
* _if you get an error building the css files it could be because you don't have node.js installed. e.g._
```
== Request: /stylesheets/vendor/fontawesome.min.css
== Finishing Request: stylesheets/vendor/fontawesome.min.css (0.0s)
error build/stylesheets/vendor/fontawesome.min.css
```
To build everything including the online demo:
Please keep all of the InSpec documentation in the `content/inspec` directory.
To add a new Markdown file, run the following command from the `www` directory:
```
bundle exec rake www:build
hugo new content/inspec/<filename>.md
```
## Releasing
To build everything and push a new version of the website, be in the www folder of this repository and run:
If it's a new resource page, run:
```
bundle install
bundle exec rake www
hugo new -k resource content/inspec/resources/<filename>.md
```
It will clear everything and build from scratch and create a local `gh-pages` branch with a static version of the website.
Before pushing, it will ask you if you are happy with it.
This will create a draft page with enough front matter to get you going. Note that
resource pages must have a platform specified in the page frontmatter. See
the [Resource pages](#resource-pages) section below for more information.
**Please verify the site now!** To host the current folder you can run:
Hugo uses [Goldmark](https://github.com/yuin/goldmark) which is a
superset of Markdown that includes GitHub styled tables, task lists, and
definition lists.
See our [Style Guide](https://docs.chef.io/style_guide/) for more information
about formatting documentation using Markdown.
## Chef InSpec Page Menu
Adding pages to a menu or modifying a menu should be handled by the Docs Team.
If you add content, it will not automatically show up in the left navigation menu.
Build the site locally (`make serve`) and see the landing page (`http://localhost:1313`).
Any page followed by `InSpec Menu: False` has not been added to the left navigation menu.
Each page needs a page title, an identifier, and a parent.
**Title**
The title is the name of the page as it appears in the left navigation menu.
**Parent**
The parent is the path to that page in the left navigation menu. For example, the
`getting started` page is found by clicking on Chef InSpec so it's parent is
`inspec`.
**Identifier**
Each menu identifier must be unique. We use the menu parent value, followed by
the file name, followed by the page title.
**Menu Weight**
The menu weight is optional. If it isn't included, Hugo assigns each page a weight of 0
and pages with the same weight are put in alphabetical order. Pages with a higher weight
are lower in the menu.
Below is an example of a page menu entry:
```
ruby -run -e httpd . -p 8000
[menu]
[menu.inspec]
title = "Page Menu Title"
identifier = "inspec/<file_name>.md Page Title"
parent = "inspec"
weight = 10
```
Open your browser to [localhost:8000](http://localhost:8000).
## InSpec Menu Config
If you are happy, you can confirm the site and let the release task push it live.
The framework for the InSpec menu is located in the `config.toml`
file. This defines the parent menu directories that each page can be added to.
### Flushing the Fastly Cache
In addition, you can add links to the InSpec menu that navigate to other pages on
the [Chef Documentation](https://docs.chef.io) site or to an external site. See
the example below.
The `www` Rake task will flush the cache at Fastly if you have the following environment variables set:
```
[[menu.inspec]]
title = "Page Menu Title"
identifier = "inspec/<filename> Page Title"
parent = "inspec"
url = "relative or absolute URL"
weight = 10
```
* `FASTLY_API_KEY`
* `FASTLY_SERVICE_ID`
See the [Hugo menu documentation](https://gohugo.io/content-management/menus/)
for additional information about formatting a menu item.
These can be found in Chef's shared password manager. If these aren't set, the cache will not be flushed and will expire on its own. The cache can be flushed without doing a full website release by running `rake www:flush`
## Shortcodes
Shortcodes are simple snippets of code that can be used to modify a Markdown
page by adding content or changing the appearance of content in a page. See
Hugo's [shortcode documentation](https://gohugo.io/content-management/shortcodes/)
for general information about shortcodes.
We primarily use shortcodes in two ways:
- adding reusable text
- highlighting blocks of text in notes or warnings to warn users or
provide additional important information
### Adding reusable text
There are often cases where we want to maintain blocks of text that are identical
from one page to the next. In those cases, we add that text, formatted in Markdown,
to a shortcode file located in `inspec/inspec/docs/layouts/shortcodes`.
Each shortcode in the Chef InSpec documentation must be prefixed with `in_`.
For example, `in_shortcode_name.md`.
To add that shortcode to a page in `inspec/inspec/docs/content`, add the file name,
minus the .md suffix, wrapped in double curly braces and percent symbols to
the location in the Markdown page where you want that text included. For example,
if you want to add the text in `dt_shortcode_file_name.md` to a page, add
`{{% in_shortcode_file_name %}}` to the text of that page and it will appear when
Hugo rebuilds the documentation.
**Shortcodes in lists**
Hugo doesn't handle shortcodes that are indented in a list item properly. It interprets
the text of the shortcode as a code block. More complicated shortcodes with
code blocks, notes, additional list items, or other formatting look pretty
bad. We've created a simple shortcode for handling shortcodes in lists or definition
lists called `readFile_shortcode`.
To include a shortcode in a list or definition list, just add its file name
to the `file` parameter of `readFile_shortcode`.
For example, if you wanted to add `shortcode_file_name.md` to a list:
``` md
1. Here is some text in a list item introducing the shortcode.
{{< readFile_shortcode file="shortcode_file_name.md" >}}
```
### Highlighting blocks of text
We also use shortcodes to highlight text in notes, warnings or danger notices.
These should be used sparingly especially danger notices or warnings. Wrap text
that you want in a note using opening and closing shortcode notation. For example,
```
{{< note >}}
Note text that gives the user additional important information.
{{< /note >}}
```
To add a warning or danger, replace the word `note` with `warning` or `danger` in the
example above.
**Notes in lists**
Hugo doesn't handle shortcodes that are indented in lists very well, that includes the Note,
Warning, and Danger shortcodes. It interprets the indented text that's inside
the Note as a code block when it should be interpreted as Markdown.
To resolve this problem, there's a `spaces` parameter that can be added to the Note,
Warning, and Danger shortcodes. The value of spaces should be set to the number
of spaces that the note is indented.
For example:
```
This is a list:
- List item.
{{< note spaces=4 >}}
Text that gives the user additional important information about that list item.
{{< /note >}}
```
This parameter also works on Danger and Warning shortcodes.
## Aliases
Add an alias to the page metadata to redirect users from a page to the page you are
editing. They are only needed if a page has been deleted and you want to redirect
users from the deleted page to a new or existing page.
## Resource Pages
The resource pages are located in `www/content/inspec/resources/`.
The InSpec resources index page is located in `www/content/inspec/resources/_index.md`
and can be found on https://docs.chef.io/inspec/resources/
The resource index page has a shortcode called `inspec_resources` that lists
resource pages by platform. To use the shortcode, add the shortcode and
specify the platform parameter: `{{< inspec_resources platform="<platform>" >}}`
A resource page must be located in `www/content/inspec/resources` and must have
the platform parameter set in its frontmatter. Add `platform = <platform>` to
the page frontmatter to add the platform parameter. For example, the
`aide_conf.md` resource frontmatter has `platform = "linux"` in its page
frontmatter.
## Structure
### High Level
```
.
├── Makefile # contains helpers to quickly start up the development environment
├── README.md
├── docs # the hugo site directory used for local development
```
### Local Content
```
.
├── site
│   ├── content
│   │   ├── inspec # where to keep markdown file documentation
│   │ │ ├── resources # where to keep resource page documentation
│   ├── layouts
| │   ├── shortcodes
| │   │   ├── in_<shortcode_name>.md # how to name your desktop-specific shortcodes
| ├── static
| | ├── images
| | | ├── inspec/inspec # where to keep any images you need to reference in your documentation
```
### What is happening behind the scenes
The [Chef Documentation](https://docs.chef.io) site uses [Hugo modules](https://gohugo.io/hugo-modules/)
to load content directly from the `www` directory in the `inspec/inspec`
repository. Every time `inspec/inspec` is promoted to stable, Expeditor
instructs Hugo to update the version of the `inspec/inspec` repository
that Hugo uses to build Chef InSpec documentation on the [Chef Documentation](https://docs.chef.io)
site. This is handled by the Expeditor subscriptions in the `chef/chef-web-docs` GitHub repository.
## Sending documentation feedback
We love getting feedback. You can use:
- Email --- Send an email to docs@chef.io for documentation bugs,
ideas, thoughts, and suggestions. This email address is not a
support email address, however. If you need support, contact Chef
support.
- Pull request --- Submit a PR to this repo using either of the two
methods described above.
- GitHub issues --- Use the https://github.com/inspec/inspec/issues.
This is a good place for "important" documentation bugs that may need
visibility among a larger group, especially in situations where a doc bug
may also surface a product bug. You can also use [chef-web-docs
issues](https://github.com/chef/chef-web-docs/issues), especially for
docs feature requests and minor docs bugs.
- https://discourse.chef.io/ --- This is a great place to interact with Chef and others.
## Questions
If you need tips for making contributions to our documentation, check out the
[instructions](https://docs.chef.io/style_guide.html).
If you see an error, open an [issue](https://github.com/chef/chef-web-docs/issues)
or submit a pull request.
If you have a question about the documentation, send an email to docs@chef.io.

13
www/archetypes/default.md Normal file
View file

@ -0,0 +1,13 @@
+++
title = "{{ or (replace .Name "_" " ") (replace .Name "-" " ") | title }}"
draft = false
[menu]
[menu.desktop]
title = "{{ replace .Name "-" " " | title }}"
identifier = "inspec/{{ .Name }}.md {{ or (replace .Name "_" " ") (replace .Name "-" " ") | title }}"
parent = "inspec"
weight = 10
+++
[\[edit on GitHub\]](https://github.com/inspec/inspec/blob/master/docs/content/inspec/{{ .Name }}.md)

View file

@ -0,0 +1,13 @@
+++
title = "{{ or (replace .Name "_" " ") (replace .Name "-" " ") | title }}"
draft = false
platform = "<platform>"
[menu]
[menu.desktop]
title = "{{ replace .Name "-" " " | title }}"
identifier = "inspec/resources/{{ .Name }}.md {{ or (replace .Name "_" " ") (replace .Name "-" " ") | title }}"
parent = "inspec/resources"
+++
[\[edit on GitHub\]](https://github.com/inspec/inspec/blob/master/docs/content/inspec/resources/{{ .Name }}.md)

1
www/chef-web-docs Submodule

@ -0,0 +1 @@
Subproject commit 5b9859aba4ef48f05eb0362972c221a861bbd1f0

168
www/config.toml Normal file
View file

@ -0,0 +1,168 @@
baseURL = "/"
languageCode = "en-us"
title = "Chef InSpec Documentation"
theme = "docs-new"
themesDir = "chef-web-docs/themes"
enableGitInfo = true
pluralizeListTitles = false
disableKinds = ["taxonomy", "taxonomyTerm"]
[markup]
defaultMarkdownHandler = "goldmark"
[markup.blackFriday]
angledQuotes = false
footnoteAnchorPrefix = ""
footnoteReturnLinkContents = ""
fractions = true
hrefTargetBlank = false
latexDashes = true
nofollowLinks = false
noreferrerLinks = false
plainIDAnchors = true
skipHTML = false
smartDashes = true
smartypants = true
smartypantsQuotesNBSP = false
taskLists = true
extensions = ["hardLineBreak"]
[markup.goldmark]
[markup.goldmark.extensions]
definitionList = true
footnote = true
linkify = true
strikethrough = true
table = true
taskList = true
typographer = true
[markup.goldmark.parser]
attribute = true
autoHeadingID = true
autoHeadingIDType = "github"
[markup.goldmark.renderer]
hardWraps = false
unsafe = true
xHTML = false
[markup.highlight]
codeFences = true
guessSyntax = false
hl_Lines = ""
lineNoStart = 1
lineNos = false
lineNumbersInTable = true
noClasses = true
style = "friendly"
tabWidth = 4
[markup.tableOfContents]
endLevel = 4
ordered = false
startLevel = 2
[params]
enable_search = true
robots = ''
menuOrder = ["overview", "compliance", "effortless", "infra", "workstation", "desktop", "habitat", "inspec", "automate", "legacy", "api", "extra"]
product = "inspec"
[taxonomies]
category = "categories"
tag = "tags"
resource = "resources"
## Main Menu ##
[[menu.main]]
title = "Chef.io"
identifier = "chef"
url = "https://www.chef.io/"
weight = 10
[[menu.main]]
title = "Learn Chef"
identifier = "learn chef"
url = "https://learn.chef.io/"
weight = 20
[[menu.main]]
title = "Blog"
identifier = "blog"
url = "https://blog.chef.io/"
weight = 30
[[menu.main]]
title = "Community"
identifier = "community"
url = "https://community.chef.io/"
weight = 40
[[menu.main]]
title = "Training"
identifier = "training"
url = "https://training.chef.io/"
weight = 50
[[menu.main]]
title = "Download"
identifier = "download"
url = "https://downloads.chef.io/"
weight = 60
####
# Chef InSpec Menu
####
[[menu.inspec]]
title = "Chef InSpec"
identifier = "inspec"
weight = 10
[[menu.inspec]]
title = "Chef InSpec Reference"
identifier = "inspec/reference"
parent = "inspec"
weight = 500
[[menu.inspec]]
title = "Chef InSpec Resources"
identifier = "inspec/resources"
parent = "inspec"
weight = 999
[[menu.inspec]]
title = "OS Resources"
identifier = "inspec/resources/os"
parent = "inspec/resources"
weight = 20
[[menu.inspec]]
title = "AWS Resources"
identifier = "inspec/resources/aws"
parent = "inspec/resources"
weight = 30
[[menu.inspec]]
title = "Azure Resources"
identifier = "inspec/resources/azure"
parent = "inspec/resources"
weight = 40
[[menu.inspec]]
title = "GCP Resources"
identifier = "inspec/resources/gcp"
parent = "inspec/resources"
weight = 50
[[menu.inspec]]
title = "Habitat Resources"
identifier = "inspec/resources/habitat"
parent = "inspec/resources"
weight = 60
####
# End Chef InSpec Menu
####

3
www/go.mod Normal file
View file

@ -0,0 +1,3 @@
module github.com/inspec/inspec/www
go 1.14

48
www/layouts/index.html Normal file
View file

@ -0,0 +1,48 @@
{{ define "main" }}
<main id="main-content-col" tabindex="-1">
<div class="col-content">
<div id="{{ anchorize ( .Title )}}"><h1>{{ .Title }}</h1></div>
<p>
Below is a list of all of the pages in the {{ title (.Site.Params.product) }} documentation. It lists
the page name, the file name, if the page exists in the {{ .Site.Params.product }} menu, and
metadata about the page's menu entry if it is in the menu.
</p>
<p>
Pages that are not in the <strong>content/{{ .Site.Params.product }}</strong> subdirectory
won't be copied to chef-web-docs. Those file names are highlighted in red.
</p>
<p>
To the left, each entry in the menu is listed with its menu weight. Red menu
items are links to pages outside of the {{ .Site.Params.product }} documentation.
</p>
<ul>
{{ range .Site.RegularPages }}
{{ if ne (string .File) "desktop/resources/README.md"}}
<li>
<p><a href="{{ .Permalink }}">{{ .Title }}</a></p>
<p>
<br>
{{ if hasPrefix .File (.Site.Params.product)}}
<strong>File name:</strong> {{ .File }}
{{ else }}
<strong>File not in {{ .Site.Params.product }} subdirectory:</strong> <span class="page_menu_false">{{ .File }}</span>
{{ end }}
<br>
<strong>{{ title (.Site.Params.product) }} Menu:</strong>
{{ if index (.Params.menu) (.Site.Params.product) }}
<span class="page_menu_true">True</span>
<br><strong>Title:</strong> {{ (index (.Params.menu) (.Site.Params.product)).title }}
<br><strong>Identifier:</strong> {{ (index (.Params.menu) (.Site.Params.product)).identifier }}
<br><strong>Parent:</strong> {{ (index (.Params.menu) (.Site.Params.product)).parent }}
<br><strong>Weight:</strong> {{ (index (.Params.menu) (.Site.Params.product)).weight }}
{{ else }}
<span class="page_menu_false">False</span>
{{ end }}
<br>
</p>
</li>
{{ end }}
{{ end }}
</div>
</main>
{{ end }}

6
www/main.go Normal file
View file

@ -0,0 +1,6 @@
package main
// Placeholder so go.mod can be installed, not meant to do anything
func main() {
}

19
www/netlify.toml Normal file
View file

@ -0,0 +1,19 @@
[build]
ignore = "sh ./netlify_ignore.sh"
[build.environment]
HUGO_VERSION = "0.69.0"
HUGO_ENABLEGITINFO = "true"
GO_VERSION = "1.12"
NODE_ENV = "development"
[build.processing]
skip_processing = true
[context.deploy-preview]
publish = "chef-web-docs/public"
command = "make preview_netlify"
[context.production]
publish = "netlify_production"
command = ""

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex">
</head>
<body>
<p>See our documentation on the <a href="https://docs.chef.io">Chef Documentation</a> site.</p>
</body>
</html>