diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 58b0cf4ea1b2..457ce99557a8 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -27,7 +27,7 @@ jobs: - uses: peaceiris/actions-hugo@v2 with: - hugo-version: '0.111.0' + hugo-version: '0.126.0' extended: true - name: Configure AWS Credentials diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index 9a560b58b5d1..be81ab92078b 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -20,7 +20,7 @@ jobs: - name: Install Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: '0.111.0' + hugo-version: '0.126.0' extended: true - name: Run make check_links run: make check_links diff --git a/.github/workflows/customer-managed-deployment-agent-cli.yml b/.github/workflows/customer-managed-deployment-agent-cli.yml index 1b3945d90bbd..259b803be9f0 100644 --- a/.github/workflows/customer-managed-deployment-agent-cli.yml +++ b/.github/workflows/customer-managed-deployment-agent-cli.yml @@ -54,7 +54,7 @@ jobs: # - name: Install Hugo # uses: peaceiris/actions-hugo@v2 # with: -# hugo-version: '0.111.0' +# hugo-version: '0.126.0' # extended: true # - name: Install node # uses: actions/setup-node@v2 diff --git a/.github/workflows/esc-cli.yml b/.github/workflows/esc-cli.yml index 252b3477c7e8..8ccd810ad797 100644 --- a/.github/workflows/esc-cli.yml +++ b/.github/workflows/esc-cli.yml @@ -53,7 +53,7 @@ jobs: - name: Install Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: '0.111.0' + hugo-version: '0.126.0' extended: true - name: Install node uses: actions/setup-node@v2 diff --git a/.github/workflows/generate-provider-docs.yml b/.github/workflows/generate-provider-docs.yml index 5768a9af43f9..2e54c33229db 100644 --- a/.github/workflows/generate-provider-docs.yml +++ b/.github/workflows/generate-provider-docs.yml @@ -61,7 +61,7 @@ jobs: - name: Install Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: '0.111.0' + hugo-version: '0.126.0' extended: true - name: setup node uses: actions/setup-node@v2 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f698cf31a353..2a947e5e794a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -23,7 +23,7 @@ jobs: - uses: peaceiris/actions-hugo@v2 with: - hugo-version: '0.111.0' + hugo-version: '0.126.0' extended: true - name: Configure AWS Credentials diff --git a/.github/workflows/pulumi-cli.yml b/.github/workflows/pulumi-cli.yml index ef803e57b54d..71e989090caa 100644 --- a/.github/workflows/pulumi-cli.yml +++ b/.github/workflows/pulumi-cli.yml @@ -56,7 +56,7 @@ jobs: - name: Install Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: '0.111.0' + hugo-version: '0.126.0' extended: true - name: Install node uses: actions/setup-node@v2 diff --git a/.github/workflows/scheduled-test.yml b/.github/workflows/scheduled-test.yml index b56261907c07..bcac1efd3d2f 100644 --- a/.github/workflows/scheduled-test.yml +++ b/.github/workflows/scheduled-test.yml @@ -57,7 +57,7 @@ jobs: - name: Install Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: "0.111.0" + hugo-version: "0.126.0" extended: true - name: Install Pulumi diff --git a/.github/workflows/scheduled-upgrade-programs.yml b/.github/workflows/scheduled-upgrade-programs.yml index e2f476db90d0..c7733451b030 100644 --- a/.github/workflows/scheduled-upgrade-programs.yml +++ b/.github/workflows/scheduled-upgrade-programs.yml @@ -57,7 +57,7 @@ jobs: - name: Install Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: "0.111.0" + hugo-version: "0.126.0" extended: true - name: Install Pulumi diff --git a/.github/workflows/testing-build-and-deploy.yml b/.github/workflows/testing-build-and-deploy.yml index f381d3751ffd..7faf70164dfe 100644 --- a/.github/workflows/testing-build-and-deploy.yml +++ b/.github/workflows/testing-build-and-deploy.yml @@ -27,7 +27,7 @@ jobs: - uses: peaceiris/actions-hugo@v2 with: - hugo-version: '0.111.0' + hugo-version: '0.126.0' extended: true - name: Configure AWS Credentials diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 000000000000..d7c29f3c837c --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,2 @@ +echo "Running pre-commit checks..." +make lint diff --git a/Makefile b/Makefile index 70725a72f41f..30e2d7fc13ec 100644 --- a/Makefile +++ b/Makefile @@ -142,4 +142,4 @@ lint: .PHONY: format format: - yarn prettier --write . + ./scripts/format.sh diff --git a/README.md b/README.md index d43b3f83ab31..e8feeac2f65e 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,10 @@ See also: We build the Pulumi website with Hugo, manage our dependencies with Node.js and Yarn, and write our documentation in Markdown. Below is a list of the tools you'll need if you'd like to work on the website (e.g., to contribute docs content, a blog post, etc.): -* [Hugo](https://gohugo.io) (>= 0.111.0) - * Hugo 0.111.0 is highly recommended. This is the version we use in our deployment pipelines. -* [Node.js](https://nodejs.org/en/) (>= 18) -* [Yarn](https://classic.yarnpkg.com/en/) (1.x) +* [Hugo](https://gohugo.io/installation/) (>= 0.126.0) + * Hugo 0.126.0 is highly recommended. This is the version we use in our deployment pipelines. +* [Node.js](https://nodejs.org/en/download/package-manager) (>= 18) +* [Yarn](https://classic.yarnpkg.com/lang/en/docs/install) (1.x) Additionally, to build the SDK and CLI documentation, you'll also need: @@ -65,12 +65,12 @@ The `Makefile` exposes a number of useful helpers for authoring: * `make new-blog-post` scaffolds a new, bare-bones blog post with placeholder content * `make new-example-program` generates a new multi-language set of examples at `./static/programs` -As a content contributor, the commands you'll most often use are these: +As a content contributor, the commands you'll use most often are these: ```bash make ensure # Install or update dependencies. make serve # Run the development server locally on http://localhost:1313. -make lint # Identify any Markdown or code-formatting issues so you an fix them. +make lint # Identify any Markdown or code-formatting issues so you can fix them. ``` ## Generating SDK and CLI documentation diff --git a/config/_default/config.yml b/config/_default/config.yml index 7d963ef8b502..ef5e68b35152 100644 --- a/config/_default/config.yml +++ b/config/_default/config.yml @@ -13,8 +13,7 @@ security: - ALGOLIA_APP_SEARCH_KEY disableKinds: - - category - - taxonomyTerm + - taxonomy sectionPagesMenu: main pygmentsCodeFences: true diff --git a/layouts/index.json b/layouts/index.json index d3d2a7c1de17..3938177a8603 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -6,17 +6,19 @@ {{ $ancestors = $ancestors | append $a.LinkTitle }} {{- end -}} - {{- - $index = $index | append ( - dict - "objectID" $page.File.UniqueID - "title" $page.Title - "section" $page.Section - "href" $page.RelPermalink - "params" $page.Params - "kind" $page.Kind - "ancestors" (after 1 $ancestors) - ) - -}} + {{- if ne $page.File nil -}} + {{- + $index = $index | append ( + dict + "objectID" $page.File.UniqueID + "title" $page.Title + "section" $page.Section + "href" $page.RelPermalink + "params" $page.Params + "kind" $page.Kind + "ancestors" (after 1 $ancestors) + ) + -}} + {{- end -}} {{- end -}} {{- $index | jsonify (dict "indent" " ") -}} diff --git a/layouts/page/about.html b/layouts/page/about.html index b22d820d4803..885cf84df3fa 100644 --- a/layouts/page/about.html +++ b/layouts/page/about.html @@ -57,7 +57,7 @@

We are Pulumi

Our purpose

To democratize the cloud for every engineer.

We help engineers ship infrastructure faster with Infrastructure as Code in general-purpose languages.

- Meet our leaders + Meet our leaders
@@ -98,7 +98,7 @@

{{ $value.title }}

-

Like what we stand for? Join us.

+

Like what we stand for? Join us.

We are looking for new teammates who want to build the future of cloud infrastructure together.

@@ -119,7 +119,7 @@

Pulumi is about community

Pulumipus wearing a medal with two hands raised
The Puluminaries

A group for stellar Pulumi community members who have made "above and beyond" contributions to the community.

- Meet our Puluminaries + Meet our Puluminaries
Pulumipus wearing a medal with two hands raised @@ -129,9 +129,9 @@

Pulumi is about community

Pulumipus wearing a Pulumi hoodie -
Pulumi users
+
Pulumi users

Engineers love Pulumi! Don’t believe us? Check out what our users have to say.

- Read user quotes + Read user quotes
@@ -226,7 +226,7 @@

Our awards & recognition

{{ end }}
- View all achievements + View all achievements
@@ -248,7 +248,7 @@
{{ .title }}
{{ end }} - View all press releases + View all press releases

Recent News

@@ -262,7 +262,7 @@
{{ .title }}
{{ end }} - View all recent news + View all recent news
@@ -275,6 +275,6 @@
{{ .title }}

Join our team

We are fully remote and hiring!

Our team is a diverse and talented group of individuals from all walks of life.

- Browse open positions + Browse open positions {{ end }} diff --git a/layouts/page/leadership.html b/layouts/page/leadership.html index 8f88634fd1bd..395e75267c96 100644 --- a/layouts/page/leadership.html +++ b/layouts/page/leadership.html @@ -4,7 +4,7 @@ {{ define "main" }}
- diff --git a/layouts/product/pulumi-cloud.html b/layouts/product/pulumi-cloud.html index 2e60a7935905..1a3a2493d10e 100644 --- a/layouts/product/pulumi-cloud.html +++ b/layouts/product/pulumi-cloud.html @@ -151,7 +151,7 @@
{{ $item.title }}

{{ .title }}

{{ .description | markdownify }}

- Pricing + Pricing
{{ end }} diff --git a/layouts/product/pulumi-insights.html b/layouts/product/pulumi-insights.html index eefb900929b5..6d9417a9f60c 100644 --- a/layouts/product/pulumi-insights.html +++ b/layouts/product/pulumi-insights.html @@ -120,7 +120,7 @@

{{ .subtitle }}

{{ .title }}

{{ .description | markdownify }}

- View Pricing + View Pricing
{{ end }} diff --git a/package.json b/package.json index ac50576e168b..8e2f36f41843 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "private": true, "license": "Apache-2.0", "scripts": { - "minify-css": "node scripts/minify-css.js" + "minify-css": "node scripts/minify-css.js", + "prepare": "husky" }, "dependencies": { "@aws-sdk/client-s3": "^3.427.0", @@ -34,6 +35,7 @@ "typescript": "^4.9.5" }, "devDependencies": { + "husky": "^9.0.11", "prettier": "^2.6.2" } } diff --git a/scripts/ensure.sh b/scripts/ensure.sh index 2f7b7cfd21a2..57e78d9e7ef5 100755 --- a/scripts/ensure.sh +++ b/scripts/ensure.sh @@ -1,14 +1,34 @@ #!/bin/bash -# Make sure the Node version matches what's in .nvmrc (and in our GitHub Actions workflows). -current_version="$(node -v)" -required_version="$(cat .nvmrc)" +set -o errexit -o pipefail -if [ ! $(echo ${current_version} | grep ${required_version}) ]; then - printf "\nIt looks like you're running Node %s, but this project uses Node %s.\n" ${current_version} ${required_version} - printf "If you're using nvm, try running nvm use.\n\n" - exit 1 -fi +check_version() { + tool_name="$1" + executable="$2" + version_string="$(eval $3)" + required_version="$4" + level="$5" + + color_red=$(echo -e "\033[0;31m") + color_yellow=$(echo -e "\033[0;33m") + color_end=$(echo -e "\033[0m") + + details="See the README at https://github.com/pulumi/docs for a list of required tools and versions." + + if ! command -v "$executable" &> /dev/null; then + echo -e "${color_red}error${color_end} This project requires $1, but the '$2' executable is either not installed or not on your PATH." + echo $details + exit 1 + fi + + if [ ! $(echo ${version_string} | grep ${required_version}) ]; then + printf "${color_yellow}warning${color_end} It looks like you're running %s %s, but this project uses version %s.\n" ${tool_name} ${version_string} ${required_version} + echo $details + fi +} +check_version "Node.js" "node" "node -v | sed 's/v\([0-9\.]*\).*$/\1/'" "18" +check_version "Hugo" "hugo" "hugo version | sed 's/hugo v\([0-9\.]*\).*$/\1/'" "0.126.0" +check_version "Yarn" "yarn" "yarn -v | sed 's/v\([0-9\.]*\).*$/\1/'" "1.22" # Install the Node dependencies for the website and the infrastructure. yarn install diff --git a/scripts/format.sh b/scripts/format.sh new file mode 100755 index 000000000000..db8eabdb7570 --- /dev/null +++ b/scripts/format.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -o errexit -o pipefail + +yarn prettier --write . diff --git a/yarn.lock b/yarn.lock index 934c9d39c427..6d789733c235 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2894,6 +2894,11 @@ humanize-duration@^3.9.1: resolved "https://registry.yarnpkg.com/humanize-duration/-/humanize-duration-3.27.3.tgz#db654e72ebf5ccfe232c7f56bc58aa3a6fe4df88" integrity sha512-iimHkHPfIAQ8zCDQLgn08pRqSVioyWvnGfaQ8gond2wf7Jq2jJ+24ykmnRyiz3fIldcn4oUuQXpjqKLhSVR7lw== +husky@^9.0.11: + version "9.0.11" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.11.tgz#fc91df4c756050de41b3e478b2158b87c1e79af9" + integrity sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw== + iconv-lite@0.6.3: version "0.6.3" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501"