Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

website: Add subcategories to docs for display on the Terraform Registry #4795

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ install:
- make tools

script:
- make docscheck
- make lint
- make test
- make website-test
Expand Down
5 changes: 4 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,8 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)

.PHONY: build test testacc vet fmt fmtcheck lint tools errcheck test-compile website website-test
docscheck:
@sh -c "'$(CURDIR)/scripts/docscheck.sh'"

.PHONY: build test testacc vet fmt fmtcheck lint tools errcheck test-compile website website-test docscheck

39 changes: 39 additions & 0 deletions scripts/docscheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

docs=$(ls website/docs/**/*.markdown)
error=false

for doc in $docs; do
dirname=$(dirname "$doc")
category=$(basename "$dirname")

case "$category" in
"guides")
# Guides require a page_title
if ! grep "^page_title: " "$doc" > /dev/null; then
echo "Guide is missing a page_title: $doc"
error=true
fi
;;

"d" | "r")
# Resources and data sources require a subcategory
if ! grep "^subcategory: " "$doc" > /dev/null; then
echo "Doc is missing a subcategory: $doc"
error=true
fi
;;

*)
error=true
echo "Unknown category \"$category\". " \
"Docs can only exist in r/, d/, or guides/ folders."
;;
esac
done

if $error; then
exit 1
fi

exit 0
1 change: 1 addition & 0 deletions website/docs/d/datasource_client_config.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_client_config"
sidebar_current: "docs-google-datasource-client-config"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_cloudfunctions_function"
sidebar_current: "docs-google-datasource-cloudfunctions-function"
Expand Down
3 changes: 2 additions & 1 deletion website/docs/d/datasource_compute_address.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_address"
sidebar_current: "docs-google-datasource-compute-address"
Expand Down Expand Up @@ -55,4 +56,4 @@ exported:

* `self_link` - The URI of the created resource.
* `address` - The IP of the created resource.
* `status` - Indicates if the address is used. Possible values are: RESERVED or IN_USE.
* `status` - Indicates if the address is used. Possible values are: RESERVED or IN_USE.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_forwarding_rule"
sidebar_current: "docs-google-datasource-compute-forwarding-rule"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_global_address"
sidebar_current: "docs-google-datasource-compute-global-address"
Expand Down Expand Up @@ -52,4 +53,4 @@ exported:

* `self_link` - The URI of the created resource.
* `address` - The IP of the created resource.
* `status` - Indicates if the address is used. Possible values are: RESERVED or IN_USE.
* `status` - Indicates if the address is used. Possible values are: RESERVED or IN_USE.
1 change: 1 addition & 0 deletions website/docs/d/datasource_compute_image.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_image"
sidebar_current: "docs-google-datasource-compute-image"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/datasource_compute_instance.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_instance"
sidebar_current: "docs-google-datasource-compute-instance-x"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_lb_ip_ranges"
sidebar_current: "docs-google-datasource-compute-lb-ip-ranges"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/datasource_compute_network.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_network"
sidebar_current: "docs-google-datasource-compute-network"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_region_instance_group"
sidebar_current: "docs-google-datasource-compute-region-instance-group"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_ssl_certificate"
sidebar_current: "docs-google-datasource-compute-ssl-certificate"
Expand Down
3 changes: 2 additions & 1 deletion website/docs/d/datasource_compute_ssl_policy.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_ssl_policy"
sidebar_current: "docs-google-datasource-compute-ssl-policy"
Expand Down Expand Up @@ -48,4 +49,4 @@ In addition to the arguments listed above, the following attributes are exported

* `fingerprint` - Fingerprint of this resource.

* `self_link` - The URI of the created resource.
* `self_link` - The URI of the created resource.
1 change: 1 addition & 0 deletions website/docs/d/datasource_compute_subnetwork.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_subnetwork"
sidebar_current: "docs-google-datasource-compute-subnetwork"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_vpn_gateway"
sidebar_current: "docs-google-datasource-compute-vpn-gateway"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_client_openid_userinfo"
sidebar_current: "docs-google-datasource-client-openid-userinfo"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_composer_image_versions"
sidebar_current: "docs-google-datasource-composer-image-versions"
Expand Down Expand Up @@ -43,4 +44,4 @@ The following attributes are exported:

* `image_versions` - A list of composer image versions available in the given project and location. Each `image_version` contains:
* `image_version_id` - The string identifier of the image version, in the form: "composer-x.y.z-airflow-a.b(.c)"
* `supported_python_versions` - Supported python versions for this image version
* `supported_python_versions` - Supported python versions for this image version
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_backend_service"
sidebar_current: "docs-google-datasource-compute-backend-service"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_network_endpoint_group"
sidebar_current: "docs-google-datasource-compute-network-endpoint-group"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_folder_organization_policy"
sidebar_current: "docs-google-datasource-folder-organization-policy"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/datasource_google_iam_role.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_iam_role"
sidebar_current: "docs-google-datasource-iam-role"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_netblock_ip_ranges"
sidebar_current: "docs-google-datasource-netblock-ip-ranges"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_project_organization_policy"
sidebar_current: "docs-google-datasource-project-organization-policy"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_service_account"
sidebar_current: "docs-google-datasource-service-account"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_service_account_access_token"
sidebar_current: "docs-google-service-account-access-token"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_service_account_key"
sidebar_current: "docs-google-datasource-service-account-key"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_tpu_tensorflow_versions"
sidebar_current: "docs-google-datasource-tpu-tensorflow-versions"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/dns_managed_zone.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_dns_managed_zone"
sidebar_current: "docs-google-datasource-dns-managed-zone"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_active_folder.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_active_folder"
sidebar_current: "docs-google-datasource-active-folder"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_billing_account.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_billing_account"
sidebar_current: "docs-google-datasource-billing-account"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_default_service_account"
sidebar_current: "docs-google-datasource-compute-default-service-account"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_compute_instance_group.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_instance_group"
sidebar_current: "docs-google-datasource-compute-instance-group"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_compute_node_types.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_node_types"
sidebar_current: "docs-google-datasource-compute-node-types"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_compute_regions.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_regions"
sidebar_current: "docs-google-datasource-compute-regions"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_compute_zones.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_compute_zones"
sidebar_current: "docs-google-datasource-compute-zones"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_container_cluster.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_container_cluster"
sidebar_current: "docs-google-datasource-container-cluster"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_container_engine_versions"
sidebar_current: "docs-google-datasource-container-versions"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_container_registry_image"
sidebar_current: "docs-google-datasource-container-image"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_container_registry_repository"
sidebar_current: "docs-google-datasource-container-repo"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_folder.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_folder"
sidebar_current: "docs-google-datasource-folder"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_iam_policy.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_iam_policy"
sidebar_current: "docs-google-datasource-iam-policy"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_kms_crypto_key.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_kms_crypto_key"
sidebar_current: "docs-google-datasource-kms-crypto-key"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_kms_crypto_key_version.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_kms_crypto_key_version"
sidebar_current: "docs-google-datasource-kms-crypto-key-version"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_kms_key_ring.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_kms_key_ring"
sidebar_current: "docs-google-datasource-kms-key-ring"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_kms_secret.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_kms_secret"
sidebar_current: "docs-google-kms-secret"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_kms_secret_ciphertext.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_kms_secret_ciphertext"
sidebar_current: "docs-google-kms-secret-ciphertext"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_organization.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_organization"
sidebar_current: "docs-google-datasource-organization"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_project.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_project"
sidebar_current: "docs-google-datasource-project"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_project_services.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_project_services"
sidebar_current: "docs-google-datasource-project-services"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/google_projects.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_projects"
sidebar_current: "docs-google-datasource-projects"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_storage_project_service_account"
sidebar_current: "docs-google-datasource-storage-project-service-account"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_storage_transfer_project_service_account"
sidebar_current: "docs-google-datasource-storage-transfer-project-service-account"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/signed_url.html.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
subcategory: "Google Cloud Platform"
layout: "google"
page_title: "Google: google_storage_object_signed_url"
sidebar_current: "docs-google-datasource-signed_url"
Expand Down
Loading