Skip to content

Conversation

@justinvp
Copy link
Member

@justinvp justinvp commented Sep 23, 2025

The pulumi-command shortcode is used to emit an inline copy of the CLI's root command docs, which is used on a couple pages:

Originally, this shortcode simply opened the local file. Then when the docs were split between pulumi/docs and pulumi/pulumi-hugo repos, the shortcode was changed to make an API request to GitHub to grab the file's content from the docs repo.

We've since merged these two repos back into the single pulumi/docs repo, so there's no longer a need to make a network request to get the content. We can go back to just reading the file. Which is what this change does.

This should make site generation slightly faster and less flaky.

The `pulumi-command` shortcode is used to emit an inline copy of the CLI's root command docs, which is referenced on a couple pages:
- https://www.pulumi.com/docs/iac/cli/
- https://www.pulumi.com/docs/iac/cli/commands/

Originally, this shortcode simply opened the local file. Then when the docs were split between pulumi/docs and pulumi/pulumi-hugo repos, the shortcode was changed to make an API request to GitHub to grab the file's content from the docs repo.

We've since merged these two repos back into the single pulumi/docs repo, so there's no longer a need to make a network request to get the content. We can go back to just reading the file. Which is what this change does.
@pulumi-bot
Copy link
Collaborator

@claude
Copy link
Contributor

claude bot commented Sep 23, 2025

PR Review

This change correctly simplifies the pulumi-command shortcode by removing the unnecessary GitHub API call and returning to local file reading. However, there's a path issue that needs to be fixed:

Issues Found:

  • Line 1: The file path /docs/iac/cli/commands/pulumi.md is incorrect. Hugo's readFile function expects paths relative to the project root. The correct path should be content/docs/iac/cli/commands/pulumi.md.

Suggested Fix:

Replace line 1 with:

{{- $content := readFile "content/docs/iac/cli/commands/pulumi.md" -}}

The rest of the implementation looks good - the regex patterns for removing front matter and auto-generated suffixes are appropriate and match the original functionality.

Claude suggests using `content/docs/iac/cli/commands/pulumi.md` rather than `/docs/iac/cli/commands/pulumi.md` (either work).
@pulumi-bot
Copy link
Collaborator

Copy link
Contributor

@smithrobs smithrobs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM and simplifies things, thanks!

@justinvp justinvp merged commit 770fea3 into master Sep 24, 2025
13 checks passed
@justinvp justinvp deleted the justin/local-cli-docs branch September 24, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants