Skip to content

Commit

Permalink
Merge pull request #3141 from chef/im/shortcodes
Browse files Browse the repository at this point in the history
CHEF-4515 reorganize reusable text files in docs
  • Loading branch information
IanMadd authored Aug 9, 2023
2 parents d0b3d65 + 55afb74 commit ff48d07
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 7 deletions.
6 changes: 5 additions & 1 deletion docs-chef-io/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ SHELL=bash
preview_netlify: chef_web_docs
rm -rf chef-web-docs/_vendor/github.com/chef/supermarket/docs-chef-io/*
cp -R content chef-web-docs/_vendor/github.com/chef/supermarket/docs-chef-io/content
cp -R layouts chef-web-docs/_vendor/github.com/chef/supermarket/docs-chef-io/layouts

if [ -d "layouts" ]; then \
cp -R layouts chef-web-docs/_vendor/github.com/chef/supermarket/docs-chef-io/layouts; \
fi

cp -R config.toml chef-web-docs/_vendor/github.com/chef/supermarket/docs-chef-io/config.toml
pushd chef-web-docs && make bundle; hugo --buildFuture --gc --minify --environment development && popd

Expand Down
4 changes: 2 additions & 2 deletions docs-chef-io/content/supermarket/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ aliases = ["/supermarket.html"]
weight = 10
+++

{{% supermarket/supermarket_summary %}}
{{< readfile file="content/supermarket/reusable/md/supermarket_summary.md" >}}

## Public Supermarket

Expand All @@ -27,4 +27,4 @@ To interact with the public Chef Supermarket, use [knife supermarket](/workstati

## Private Supermarket

{{% supermarket/supermarket_private %}}
{{< readfile file="content/supermarket/reusable/md/supermarket_private.md" >}}
9 changes: 9 additions & 0 deletions docs-chef-io/content/supermarket/reusable/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- markdownlint-disable MD002 -->
# Directory for Reusable Content
<!-- markdownlint-enable MD002 -->

Files in this directory are used in *more than one place* within the Chef docs.

Store all files in subdirectories organized by file type. For example, all Markdown files should be in `content/<product>/reusable/md/` and all Ruby files are stored in `content/<product>/reusable/rb/`.

Call these files using the [`readfile` shortcode](https://docs.chef.io/style/reuse/#readfile-shortcode).
5 changes: 5 additions & 0 deletions docs-chef-io/content/supermarket/reusable/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
headless = true
## headless = true makes this directory a headless bundle.
## See https://gohugo.io/content-management/page-bundles/#headless-bundle
+++
7 changes: 5 additions & 2 deletions docs-chef-io/content/supermarket/supermarket_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ aliases = ["/supermarket_api.html", "/supermarket_api/"]
<!-- markdownlint-disable-file MD033 MD036-->

{{< note >}}
In general, using knife (and the `knife supermarket` subcommand) to manage cookbooks that are located on the Cookbooks site is more efficient than using the Supermarket API and is the recommended approach for managing cookbooks on that site. This document provides information about the Supermarket API in the event that using the API is necessary.

In general, using knife (and the `knife supermarket` subcommand) to manage cookbooks that are located on the Cookbooks site is more efficient than using the Supermarket API and is the recommended approach for managing cookbooks on that site.
This document provides information about the Supermarket API in the event that using the API is necessary.

{{< /note >}}

{{% supermarket/supermarket_api_summary %}}
{{< readfile file="/content/supermarket/reusable/md/supermarket_api_summary.md" >}}

## Endpoints

Expand Down
4 changes: 2 additions & 2 deletions docs-chef-io/content/supermarket/supermarket_private.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ aliases = ["/supermarket.html", "/supermarket_private/"]
weight = 10
+++

{{% supermarket/supermarket_summary %}}
{{< readfile file="content/supermarket/reusable/md/supermarket_summary.md" >}}

## Private Supermarket

{{% supermarket/supermarket_private %}}
{{< readfile file="content/supermarket/reusable/md/supermarket_private.md" >}}

0 comments on commit ff48d07

Please sign in to comment.