diff --git a/.ci/lint-docs-source-page.sh b/.ci/lint-docs-source-page.sh index 37b4fdf8cf4e..9311581cd51e 100755 --- a/.ci/lint-docs-source-page.sh +++ b/.ci/lint-docs-source-page.sh @@ -118,4 +118,4 @@ if has_errors: sys.exit(1) print("Success: Source pages validated.") sys.exit(0) -EOF \ No newline at end of file +EOF diff --git a/.ci/lint-docs-tool-page.sh b/.ci/lint-docs-tool-page.sh index 1859c6564c08..9b3cde4089f8 100755 --- a/.ci/lint-docs-tool-page.sh +++ b/.ci/lint-docs-tool-page.sh @@ -132,4 +132,4 @@ if has_errors: sys.exit(1) else: print("Success: All Tool pages passed structure validation.") -EOF \ No newline at end of file +EOF diff --git a/.github/workflows/deploy_dev_docs.yaml b/.github/workflows/deploy_dev_docs.yaml index d71f1db27379..51e20fd19b61 100644 --- a/.github/workflows/deploy_dev_docs.yaml +++ b/.github/workflows/deploy_dev_docs.yaml @@ -69,6 +69,9 @@ jobs: HUGO_BASEURL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/dev HUGO_RELATIVEURLS: false + - name: Build Pagefind Search Index + run: npx pagefind --site public + - name: Create Staging Directory run: | mkdir staging diff --git a/.github/workflows/deploy_previous_version_docs.yaml b/.github/workflows/deploy_previous_version_docs.yaml index e8362536c921..39bd196fa5e2 100644 --- a/.github/workflows/deploy_previous_version_docs.yaml +++ b/.github/workflows/deploy_previous_version_docs.yaml @@ -73,6 +73,10 @@ jobs: HUGO_RELATIVEURLS: false HUGO_PARAMS_VERSION: ${{ github.event.inputs.version_tag }} + - name: Build Pagefind Index (Archived Version) + run: npx pagefind --site public + working-directory: .hugo + - name: Deploy to gh-pages uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4 with: @@ -95,6 +99,10 @@ jobs: HUGO_RELATIVEURLS: false HUGO_PARAMS_VERSION: ${{ github.event.inputs.version_tag }} + - name: Build Pagefind Index (Root) + run: npx pagefind --site public + working-directory: .hugo + - name: Deploy to root uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4 with: @@ -103,4 +111,4 @@ jobs: publish_branch: versioned-gh-pages keep_files: true allow_empty_commit: true - commit_message: "deploy: docs to root for ${{ github.event.inputs.version_tag }}" \ No newline at end of file + commit_message: "deploy: docs to root for ${{ github.event.inputs.version_tag }}" diff --git a/.github/workflows/deploy_previous_version_docs_to_cf.yaml b/.github/workflows/deploy_previous_version_docs_to_cf.yaml index 3a7166b4f571..35b344c942a6 100644 --- a/.github/workflows/deploy_previous_version_docs_to_cf.yaml +++ b/.github/workflows/deploy_previous_version_docs_to_cf.yaml @@ -73,6 +73,10 @@ jobs: HUGO_RELATIVEURLS: false HUGO_PARAMS_VERSION: ${{ github.event.inputs.version_tag }} + - name: Build Pagefind Index (Root) + run: npx pagefind --site public + working-directory: .hugo + - name: Deploy to cloudflare-pages uses: peaceiris/actions-gh-pages@v4 with: @@ -95,6 +99,10 @@ jobs: HUGO_RELATIVEURLS: false HUGO_PARAMS_VERSION: ${{ github.event.inputs.version_tag }} + - name: Build Pagefind Index (Root) + run: npx pagefind --site public + working-directory: .hugo + - name: Deploy to root uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4 with: diff --git a/.github/workflows/deploy_versioned_docs.yaml b/.github/workflows/deploy_versioned_docs.yaml index a7c8300af4db..6decc5738fdd 100644 --- a/.github/workflows/deploy_versioned_docs.yaml +++ b/.github/workflows/deploy_versioned_docs.yaml @@ -63,6 +63,10 @@ jobs: HUGO_RELATIVEURLS: false HUGO_PARAMS_VERSION: ${{ steps.get_version.outputs.VERSION }} + - name: Build Pagefind Index (Versioned) + run: npx pagefind --site public + working-directory: .hugo + - name: Deploy uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4 with: @@ -84,6 +88,10 @@ jobs: HUGO_RELATIVEURLS: false HUGO_PARAMS_VERSION: ${{ steps.get_version.outputs.VERSION }} + - name: Build Pagefind Index (Root) + run: npx pagefind --site public + working-directory: .hugo + - name: Deploy to root uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4 with: diff --git a/.github/workflows/deploy_versioned_docs_to_cf.yaml b/.github/workflows/deploy_versioned_docs_to_cf.yaml index d3b29c225dbd..cfac34d98c9c 100644 --- a/.github/workflows/deploy_versioned_docs_to_cf.yaml +++ b/.github/workflows/deploy_versioned_docs_to_cf.yaml @@ -63,6 +63,10 @@ jobs: HUGO_RELATIVEURLS: false HUGO_PARAMS_VERSION: ${{ steps.get_version.outputs.VERSION }} + - name: Build Pagefind Index (Root) + run: npx pagefind --site public + working-directory: .hugo + - name: Deploy uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4 with: @@ -84,6 +88,10 @@ jobs: HUGO_RELATIVEURLS: false HUGO_PARAMS_VERSION: ${{ steps.get_version.outputs.VERSION }} + - name: Build Pagefind Index (Root) + run: npx pagefind --site public + working-directory: .hugo + - name: Deploy to root uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4 with: diff --git a/.github/workflows/docs_preview_deploy.yaml b/.github/workflows/docs_preview_deploy.yaml index fda0e4895f9c..510a2b260dcd 100644 --- a/.github/workflows/docs_preview_deploy.yaml +++ b/.github/workflows/docs_preview_deploy.yaml @@ -17,7 +17,7 @@ name: "docs" permissions: contents: write pull-requests: write - + # This Workflow depends on 'github.event.number', # not compatible with branch or manual triggers. on: @@ -81,6 +81,9 @@ jobs: HUGO_ENVIRONMENT: preview HUGO_RELATIVEURLS: false + - name: Build Pagefind Search Index + run: npx pagefind --site public + - name: Deploy uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4 with: diff --git a/.github/workflows/docs_preview_deploy_cf.yaml b/.github/workflows/docs_preview_deploy_cf.yaml index 71a6f7c65c34..b1cc19e3b5b0 100644 --- a/.github/workflows/docs_preview_deploy_cf.yaml +++ b/.github/workflows/docs_preview_deploy_cf.yaml @@ -72,6 +72,9 @@ jobs: HUGO_ENVIRONMENT: preview HUGO_RELATIVEURLS: false + - name: Build Pagefind Search Index + run: npx pagefind --site public + - name: Deploy to Cloudflare Pages via Wrangler id: cf_deploy uses: cloudflare/wrangler-action@v3 diff --git a/.gitignore b/.gitignore index 724bfc3e7d90..fff1611f0cf0 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ node_modules # hugo .hugo/public/ .hugo/resources/_gen +.hugo/static/pagefind/ .hugo_build.lock # coverage diff --git a/.hugo/hugo.cloudflare.toml b/.hugo/hugo.cloudflare.toml index d2789ec07a9f..b91baa6983dd 100644 --- a/.hugo/hugo.cloudflare.toml +++ b/.hugo/hugo.cloudflare.toml @@ -49,18 +49,25 @@ ignoreFiles = ["quickstart/shared", "quickstart/python", "quickstart/js", "quick github_repo = "https://github.com/googleapis/genai-toolbox" github_project_repo = "https://github.com/googleapis/genai-toolbox" github_subdir = "docs" - offlineSearch = true + offlineSearch = false version_menu = "Releases" disableMigrationBanner = true releases_url = "/releases.releases" global_logo_url = "/" + pagefind = true version = "Dev" [params.ui] ul_show = 100 showLightDarkModeMenu = true - breadcrumb_disable = true + breadcrumb_disable = false sidebar_menu_foldable = true sidebar_menu_compact = false + [params.ui.feedback] + enable = true + yes = 'Glad to hear it! Please tell us how we can improve.' + no = 'Sorry to hear that. Please tell us how we can improve.' + [params.ui.readingtime] + enable = true [[params.versions]] version = "Dev" @@ -151,3 +158,7 @@ ignoreFiles = ["quickstart/shared", "quickstart/python", "quickstart/js", "quick [outputs] home = ["HTML", "RSS", "LLMS", "LLMS-FULL", "releases"] + +[services] + [services.googleAnalytics] + id = "G-GLSV9KD8BF" diff --git a/.hugo/hugo.toml b/.hugo/hugo.toml index 5af92a191648..cbc825700a04 100644 --- a/.hugo/hugo.toml +++ b/.hugo/hugo.toml @@ -35,17 +35,24 @@ ignoreFiles = ["quickstart/shared", "quickstart/python", "quickstart/js", "quick github_repo = "https://github.com/googleapis/genai-toolbox" github_project_repo = "https://github.com/googleapis/genai-toolbox" github_subdir = "docs" - offlineSearch = true + offlineSearch = false version_menu = "Releases" releases_url = "/genai-toolbox/releases.releases" global_logo_url = "/genai-toolbox/" version = "Dev" + pagefind = true [params.ui] ul_show = 100 showLightDarkModeMenu = true - breadcrumb_disable = true + breadcrumb_disable = false sidebar_menu_foldable = true sidebar_menu_compact = false + [params.ui.feedback] + enable = true + yes = 'Glad to hear it! Please tell us how we can improve.' + no = 'Sorry to hear that. Please tell us how we can improve.' + [params.ui.readingtime] + enable = true [[params.versions]] version = "Dev" @@ -173,3 +180,8 @@ ignoreFiles = ["quickstart/shared", "quickstart/python", "quickstart/js", "quick [outputs] home = ["HTML", "RSS", "LLMS", "LLMS-FULL", "releases"] + +# Google Analytics ID +[services] + [services.googleAnalytics] + id = "G-GLSV9KD8BF" \ No newline at end of file diff --git a/.hugo/layouts/docs/section.html b/.hugo/layouts/docs/section.html index c8d7a5f36fd3..47b41c080af2 100644 --- a/.hugo/layouts/docs/section.html +++ b/.hugo/layouts/docs/section.html @@ -11,8 +11,10 @@