diff --git a/Makefile b/Makefile index cfb6cf79c7..fe50561246 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,10 @@ .PHONY: all all: @echo "Available targets:" - @echo " community-local Build the local community docs site" + @echo " community-local Build the local community docs site for local workstation test" @echo " community-remote Build the remote community docs site (as would happen on GH)" - @echo " preview-local-community Preview the local community docs site" + @echo " community-netlify-preview Build the community docs site for Netlify preview (as on Netlify)" + @echo " preview Preview the local community docs site" @echo " clean Clean build artifacts" @echo " checkmake Check Makefile for common issues" @echo " environment Set up the Node.js environment" @@ -11,32 +12,30 @@ all: .PHONY: community-local community-local: tmpdir environment - npx antora --version | tee tmp/community-local-build.log + npx antora --version | tee tmp/build.log npx antora --stacktrace --log-format=pretty --log-level=info \ kw-local-community-playbook.yml \ - 2>&1 | tee -a tmp/community-local-build.log - cd build-local-community/site && ln -s kubewarden/latest latest - @echo - @echo "If your build was successful, you can preview the site with" - @echo "'make preview-local-community'. The server needs to be used, viewing" - @echo "the html files directly will not work due to the Antora playbook" - @echo "setting 'html_extension_style: drop'." - @echo + 2>&1 | tee -a tmp/build.log + cd build/site && ln -s kubewarden/latest latest + @echo "" + @echo "If your build was successful, you can preview the site with" + @echo "'make preview'." + @echo "" .PHONY: community-remote community-remote: tmpdir environment - npx antora --version | tee tmp/community-remote-build.log + npx antora --version | tee tmp/build.log npx antora --stacktrace --log-format=pretty --log-level=info \ kw-remote-community-playbook.yml \ - 2>&1 | tee -a tmp/community-remote-build.log + 2>&1 | tee -a tmp/build.log cd build/site && ln -s kubewarden/latest latest -.PHONY: community-remote-netlify -community-remote-netlify: tmpdir environment - npx antora --version | tee tmp/community-remote-netlify-build.log - npx antora --stacktrace --log-format=pretty --log-level=info \ - kw-remote-community-netlify-playbook.yml \ - 2>&1 | tee -a tmp/community-remote-netlify-build.log +.PHONY: community-netlify-preview +community-netlify-preview: tmpdir environment + npx antora --version | tee tmp/build.log + npx antora --attribute build-environment=netlify --stacktrace --log-format=pretty --log-level=info \ + kw-local-community-playbook.yml \ + 2>&1 | tee -a tmp/build.log cd build/site && ln -s kubewarden/latest latest @@ -63,9 +62,9 @@ checkmake: fi; \ else echo "checkmake not available"; fi -.PHONY: preview-local-community -preview-local-community: - npx http-server build-local-community/site -c-1 +.PHONY: preview +preview: + npx http-server build/site -c-1 .PHONY: test test: diff --git a/kw-local-community-playbook.yml b/kw-local-community-playbook.yml index 5e13364c3c..61f41c2433 100644 --- a/kw-local-community-playbook.yml +++ b/kw-local-community-playbook.yml @@ -4,12 +4,6 @@ site: title: Kubewarden start_page: 1.0@kubewarden:en:introduction.adoc -# urls: -# html_extension_style: drop -# latest_version_segment: '' -# latest_prerelease_version_segment: dev -# latest_version_segment_strategy: replace - content: sources: - url: ./ @@ -47,4 +41,4 @@ antora: output: - dir: build-local-community/site + dir: build/site diff --git a/kw-remote-community-netlify-playbook.yml b/kw-remote-community-netlify-playbook.yml deleted file mode 100644 index 23746c6e1b..0000000000 --- a/kw-remote-community-netlify-playbook.yml +++ /dev/null @@ -1,51 +0,0 @@ ---- -site: - url: https://docs.kubewarden.io - title: Kubewarden - start_page: 1.0@kubewarden:en:introduction.adoc - -# urls: -# html_extension_style: drop -# latest_version_segment: '' -# latest_prerelease_version_segment: dev -# latest_version_segment_strategy: replace - -content: - sources: - - url: ./ - branches: HEAD - start_paths: [shared, docs/kw/version-*, docs/admission-controller/version-*, docs/sbom-scanner/v*] - -ui: - bundle: - url: https://github.com/rancher/product-docs-ui/blob/main/build/ui-bundle.zip?raw=true - snapshot: true - supplemental_files: ./kw-community-docs-supp-files - -asciidoc: - attributes: - kw-build-community: true - build-environment: netlify - page-pagination: '' - tabs-sync-option: '' - extensions: - - '@asciidoctor/tabs' - -antora: - extensions: - # - require: "@antora/pdf-extension" - - require: "@antora/lunr-extension" - index_latest_only: true - - require: "@sntke/antora-mermaid-extension" - mermaid_library_url: https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs # <2> - script_stem: header-scripts - mermaid_initialize_options: - - require: ./product-docs-common/extensions/dynamic-loading-attributes/load-global-site-attributes.js - attributefile: ./product-docs-common/global-attributes.yml - enabled: true - - require: ./product-docs-common/extensions/versions-latest-prerelease/vlp.js - enabled: true - - -output: - dir: build/site diff --git a/kw-remote-community-playbook.yml b/kw-remote-community-playbook.yml index 129ca70e29..23d0cf67ec 100644 --- a/kw-remote-community-playbook.yml +++ b/kw-remote-community-playbook.yml @@ -4,12 +4,6 @@ site: title: Kubewarden start_page: 1.0@kubewarden:en:introduction.adoc -# urls: -# html_extension_style: drop -# latest_version_segment: '' -# latest_prerelease_version_segment: dev -# latest_version_segment_strategy: replace - content: sources: - url: https://github.com/kubewarden/docs.git diff --git a/netlify.toml b/netlify.toml index 4dd8efd2ea..7d0614b35e 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,7 +1,7 @@ # Configuration file to customize the build process of the website on Netlify. [build] publish = "build/site" -command = "make community-remote-netlify" +command = "make community-netlify-preview" #[build.environment] # NODE_OPTIONS = "--max_old_space_size=4096"