From 318a87367212d3e025bdece24b6d6d02c7dcdb73 Mon Sep 17 00:00:00 2001 From: Bastian Hofmann Date: Fri, 3 Jul 2020 13:11:36 +0200 Subject: [PATCH] Move cluster-capabilities-table to a headless bundle and include it as a page instead of reading the file This prevents the table to automatically be included on pages of other bundles. By including the page instead of reading the file also the shortcodes in the table are expanded correctly. This fixes broken links in the table. Fixes https://github.com/rancher/docs/issues/2577 Signed-off-by: Bastian Hofmann --- content/rancher/v2.x/en/cluster-admin/_index.md | 2 +- .../rancher/v2.x/en/cluster-admin/editing-clusters/_index.md | 2 +- content/rancher/v2.x/en/cluster-provisioning/_index.md | 2 +- .../cluster-capabilities-table.md | 0 content/rancher/v2.x/en/includes/index.md | 3 +++ content/rancher/v2.x/en/overview/_index.md | 2 +- layouts/shortcodes/include.html | 5 +++++ 7 files changed, 12 insertions(+), 4 deletions(-) rename content/rancher/v2.x/en/{cluster-admin => includes}/cluster-capabilities-table.md (100%) create mode 100644 content/rancher/v2.x/en/includes/index.md create mode 100644 layouts/shortcodes/include.html diff --git a/content/rancher/v2.x/en/cluster-admin/_index.md b/content/rancher/v2.x/en/cluster-admin/_index.md index fe49bdb7e9c..9323075c141 100644 --- a/content/rancher/v2.x/en/cluster-admin/_index.md +++ b/content/rancher/v2.x/en/cluster-admin/_index.md @@ -23,7 +23,7 @@ Alternatively, you can switch between projects and clusters directly in the navi After clusters have been [provisioned into Rancher]({{}}/rancher/v2.x/en/cluster-provisioning/), [cluster owners]({{}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#cluster-roles) will need to manage these clusters. There are many different options of how to manage your cluster. -{{% readfile file="/rancher/v2.x/en/cluster-admin/cluster-capabilities-table.md" markdown="true" %}} +{{% include file="/rancher/v2.x/en/includes/cluster-capabilities-table.md" %}} ## Configuring Tools diff --git a/content/rancher/v2.x/en/cluster-admin/editing-clusters/_index.md b/content/rancher/v2.x/en/cluster-admin/editing-clusters/_index.md index 1fe6ce09d18..b69c578fbd0 100644 --- a/content/rancher/v2.x/en/cluster-admin/editing-clusters/_index.md +++ b/content/rancher/v2.x/en/cluster-admin/editing-clusters/_index.md @@ -12,7 +12,7 @@ The options and settings available for an existing cluster change based on the m The following table summarizes the options and settings available for each cluster type: -{{% readfile file="/rancher/v2.x/en/cluster-admin/cluster-capabilities-table.md" markdown="true" %}} +{{% include file="/rancher/v2.x/en/includes/cluster-capabilities-table.md" %}} ## Editing Cluster Membership diff --git a/content/rancher/v2.x/en/cluster-provisioning/_index.md b/content/rancher/v2.x/en/cluster-provisioning/_index.md index 652194b518b..1c9485b0495 100644 --- a/content/rancher/v2.x/en/cluster-provisioning/_index.md +++ b/content/rancher/v2.x/en/cluster-provisioning/_index.md @@ -28,7 +28,7 @@ This section covers the following topics: The following table summarizes the options and settings available for each cluster type: -{{% readfile file="/rancher/v2.x/en/cluster-admin/cluster-capabilities-table.md" markdown="true" %}} +{{% include file="/rancher/v2.x/en/includes/cluster-capabilities-table.md" %}} # Setting up Clusters in a Hosted Kubernetes Provider diff --git a/content/rancher/v2.x/en/cluster-admin/cluster-capabilities-table.md b/content/rancher/v2.x/en/includes/cluster-capabilities-table.md similarity index 100% rename from content/rancher/v2.x/en/cluster-admin/cluster-capabilities-table.md rename to content/rancher/v2.x/en/includes/cluster-capabilities-table.md diff --git a/content/rancher/v2.x/en/includes/index.md b/content/rancher/v2.x/en/includes/index.md new file mode 100644 index 00000000000..ca03031f1ee --- /dev/null +++ b/content/rancher/v2.x/en/includes/index.md @@ -0,0 +1,3 @@ +--- +headless: true +--- diff --git a/content/rancher/v2.x/en/overview/_index.md b/content/rancher/v2.x/en/overview/_index.md index b691f67864a..2f981c7ec1c 100644 --- a/content/rancher/v2.x/en/overview/_index.md +++ b/content/rancher/v2.x/en/overview/_index.md @@ -60,4 +60,4 @@ After a cluster is created with Rancher, a cluster administrator can manage clus The following table summarizes the options and settings available for each cluster type: -{{% readfile file="/rancher/v2.x/en/cluster-admin/cluster-capabilities-table.md" markdown="true" %}} +{{% include file="/rancher/v2.x/en/includes/cluster-capabilities-table.md" %}} diff --git a/layouts/shortcodes/include.html b/layouts/shortcodes/include.html new file mode 100644 index 00000000000..0d98507f062 --- /dev/null +++ b/layouts/shortcodes/include.html @@ -0,0 +1,5 @@ +{{$file := .Get "file"}} + +{{- with .Site.GetPage $file -}} +{{- .Content | markdownify -}} +{{- end -}}