Embed example manifests inline via shortcode (#960)#1086
Conversation
✅ Deploy Preview for crossplane ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
2c1b789 to
522ac0a
Compare
2ac5d78 to
d365ad9
Compare
d365ad9 to
9db2446
Compare
|
Thanks for the contribution @jonasz-lasut! I was able to review and test:
Couple things I noticed:
I created a PR to your forked branch to add usage information to the docs code styling guide.. Once that's accepted or edited, we'll be good to approve and merge 🚀 |
tr0njavolta
left a comment
There was a problem hiding this comment.
Requesting a usage guide for the shortcode in https://docs.crossplane.io/contribute/code-style-guide/. Created a PR here
|
Really appreciate the review @tr0njavolta I'll take a look at fixing hover inside a tab and localhost baseUrl in the follow-up PR sometime next week :) |
|
Looks like your commit was missing a signoff, I've invited you as a collaborator on my fork so you should be able to push directly to the branch |
Replaces the inconsistent mix of save-and-apply YAML, kubectl heredocs, and duplicated manifest files with a single mechanism: example manifests live as real .yaml files Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Jonasz Łasut-Balcerzak <jonasz.lasut@gmail.com> Signed-off-by: Rae Sharp <resharp20@gmail.com>
6f11719 to
809144d
Compare
Signed-off-by: Rae Sharp <resharp20@gmail.com>
jbw976
left a comment
There was a problem hiding this comment.
thank you so much for taking this on @jonasz-lasut, i think it's a lot easier/quicker to walk through the interactive guides now than the previous approach of copying the content to a file each time. This is very appreciated!! 🙇
I added two small comments of things I noticed, none of them are explicitly blocking - I'll add my approval on as well and we can merge tomorrow either way 😁
|
|
||
| {{- $highlightOpts := "linenos=table,linenostart=1" -}} | ||
|
|
||
| <div class="gdoc-manifest"> |
There was a problem hiding this comment.
one funny thing i noticed is that the manifest code blocks now seem to use a blue/green color for their line numbers, when before they were a grey color. Is something in the logic here affecting that? Compare the line number colors on these two:
Current: https://docs.crossplane.io/v2.2/guides/change-logs/#configure-permissions
NEW: https://deploy-preview-1086--crossplane.netlify.app/v2.2/guides/change-logs/#configure-permissions
|
|
||
| {{< manifest path="code-style-guide/provider.yaml" apply="false" >}} | ||
|
|
||
| ### `generateName` |
There was a problem hiding this comment.
is it also worth mentioning the manifest-url function in this contributing guide page? i see it used quite a lot on some pages like https://deploy-preview-1086--crossplane.netlify.app/v2.2/get-started/get-started-with-composition/
There was a problem hiding this comment.
Thanks for calling this out - added a mention in the contributing guide.
Signed-off-by: Rae Sharp <resharp20@gmail.com> Vale exception Signed-off-by: Rae Sharp <resharp20@gmail.com> Fix language and mismatched backticks Signed-off-by: Rae Sharp <resharp20@gmail.com>
ba449a9 to
dd2ebb5
Compare

Replaces the inconsistent mix of save-and-apply YAML, kubectl heredocs, and duplicated manifest files with a single mechanism: example manifests live as real .yaml files under
content//manifests/.yaml, embedded into prose by a new
{{< manifest >}}shortcode and simultaneously published as fetchable URLs athttps://docs.crossplane.io/<ver>/manifests/...so readers can runkubectl apply -f <url>directly.I see room for improvement in the future by moving
Functionmanifests to a separate directory and use the shared functions in all docs across all versions as this way we'll be able to updateFunctionversions in one place only.Fixes #960
Changes:
Adds a Hugo module mount in
config.yamlthat re-exposescontent/<ver>/manifests/**.yamlunderstatic/, so each manifest publishes verbatim at its natural URL.Adds
themes/geekboot/layouts/shortcodes/manifest.html. Required arg path= names the manifest relative to the calling page's version. The shortcode auto-derives the version segment from .Page.File.Path so authors never type version strings. Optional args:apply="false"suppresses the kubectl block; command= overrides the default verb (kubectl apply -f);label=wraps the rendered YAML in<div label="...">so existing{{< hover label="..." >}}annotations keep working. Hostname is based on base URL so preview deploys still emit usable kubectl URLs.