Skip to content

Commit

Permalink
Merge pull request #8 from redpanda-data/JakeSCahill-patch-1
Browse files Browse the repository at this point in the history
Add batch redirects
  • Loading branch information
Deflaimun authored Aug 7, 2023
2 parents 3ca21c6 + 453f8cf commit 262c12c
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 13 deletions.
14 changes: 7 additions & 7 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= Redpanda Docs Site
:url-docs: https://docs.redpanda.com
:url-org: https://github.com/redpanda-data
:url-docs: {url-org}/documentation
:url-gh-docs: {url-org}/documentation
:url-ui: {url-org}/docs-ui
:url-extensions: {url-org}/docs-extensions-and-macros
:hide-uri-scheme:
Expand Down Expand Up @@ -51,7 +51,7 @@ For more details, see the https://github.com/redpanda-data/documentation/blob/ma

=== API docs

The OpenAPI spec files are stored in the `api/modules/ROOT/attachments/` directory of the {url-docs}/tree/api[`api` branch].
The OpenAPI spec files are stored in the `api/modules/ROOT/attachments/` directory of the {url-gh-docs}/tree/api[`api` branch].

The API component hosts all OpenAPI docs at the root of the site under the `/api` path.

Expand All @@ -61,27 +61,27 @@ image::images/api.png[Preview of API docs]

=== Home page

The home page is hosted in the {url-docs}/tree/home[`home` branch] and is configured as a dedicated component called `home` so that we can host it at the root of the site under the `/home` path.
The home page is hosted in the {url-gh-docs}/tree/home[`home` branch] and is configured as a dedicated component called `home` so that we can host it at the root of the site under the `/home` path.

The link:./antora.yml[`antora.yml`] file contains the content for the home page. This content is read by a template in the UI to produce the home page. The template for the home page is in the {url-ui}/blob/main/src/partials/home.hbs[`home.hbs`] file of the link:{url-ui}[`docs-ui` repository].

image::images/home.png[Preview of the home page]

=== Search page

The site-wide search page is hosted in the {url-docs}/tree/site-search[`site-search` branch] and is configured as a dedicated component called `search` so that we can host it at the root of the site under the `/search` path.
The site-wide search page is hosted in the {url-gh-docs}/tree/site-search[`site-search` branch] and is configured as a dedicated component called `search` so that we can host it at the root of the site under the `/search` path.

Search is powered by an link:{url-algolia}[Algolia] search index. The index is generated on each build of the production site using the {url-extensions}[Algolia indexer extension].

image::images/search.png[Preview of site search]

=== Shared content

The {url-docs}/tree/shared[`shared` branch] contains content that is intended to be shared across all component versions.
The {url-gh-docs}/tree/shared[`shared` branch] contains content that is intended to be shared across all component versions.

The attributes in the `ROOT/partials/attributes.yaml` file are merged into the `antora.yml` file of each component version by the {url-extensions}[global attributes extension]. These global attributes are required for all local builds as well as the production build.

The pages in the `terms/partials/` directory are terms that can be referenced in any component version using the {url-extensions}[`glossterm` macro]. The content of these term page are also added automatically to `reference:glossary.adoc` pages by the {url-extensions}[aggregate terms extension].
The pages in the `terms/partials/` directory are terms that can be referenced in any component version using the {url-extensions}[`glossterm` macro]. The content of these term page is also added automatically to `reference:glossary.adoc` pages by the {url-extensions}[aggregate terms extension].

== Extensions and macros

Expand All @@ -101,4 +101,4 @@ For details about this file, see the link:{url-netlify-docs}/configure-builds/fi

== Contributing

To learn how to use the playbook and generate the docs site locally, see our link:{url-contributing}[contributing guide].
To learn how to use the playbook and generate the docs site locally, see our link:{url-contributing}[contributing guide].
4 changes: 2 additions & 2 deletions antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ urls:
html_extension_style: indexify
redirect_facility: netlify
latest_version_segment: 'current'
latest_prerelease_version_segment: 'prerelease'
latest_prerelease_version_segment: 'beta'
latest_version_segment_strategy: redirect:to
content:
sources:
- url: https://github.com/redpanda-data/documentation
branches: [v/*, home, api, shared, 'site-search']
branches: [main, v/*, home, api, shared, 'site-search']
ui:
bundle:
url: https://github.com/redpanda-data/docs-ui/releases/latest/download/ui-bundle.zip
Expand Down
4 changes: 2 additions & 2 deletions local-antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ site:
content:
sources:
- url: https://github.com/redpanda-data/documentation
branches: [v/*, home, api, shared, site-search]
branches: [main, v/*, home, api, shared, site-search]
ui:
bundle:
url: https://github.com/redpanda-data/docs-ui/releases/latest/download/ui-bundle.zip
Expand All @@ -21,4 +21,4 @@ antora:
extensions:
- require: '@redpanda-data/docs-extensions-and-macros/extensions/unlisted-pages'
- require: '@redpanda-data/docs-extensions-and-macros/extensions/add-global-attributes'
- require: '@redpanda-data/docs-extensions-and-macros/extensions/aggregate-terms'
- require: '@redpanda-data/docs-extensions-and-macros/extensions/aggregate-terms'
35 changes: 35 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ NODE_VERSION = "16"

# NOTE the following redirects get appended to the redirects defined in the _redirects file

[[redirects]]
from = "/docs/beta/*"
to = "/current/:splat"
status = 301

[[redirects]]
from = "/docs/23.2/home"
to = "/home"
status = 301

[[redirects]]
from = "/docs/23.1/home"
to = "/home"
Expand All @@ -43,6 +53,16 @@ from = "/docs/21.11/home"
to = "/home"
status = 301

[[redirects]]
from = "/docs/23.2/*"
to = "/23.2/:splat"
status = 301

[[redirects]]
from = "/docs/23.1/*"
to = "/23.1/:splat"
status = 301

[[redirects]]
from = "/docs/22.3/*"
to = "/22.3/:splat"
Expand All @@ -63,11 +83,26 @@ from = "/docs/21.11/*"
to = "/21.11/:splat"
status = 301

[[redirects]]
from = "/docs/home/*"
to = "/home"
status = 301

[[redirects]]
from = "/docs/reference/faq"
to = "/home"
status = 301

[[redirects]]
from = "/docs/api/*"
to = "/api/:splat"
status = 301

[[redirects]]
from = "/docs/platform/*"
to = "/current/:splat"
status = 301

[[redirects]]
from = "/docs/*"
to = "/current/:splat"
Expand Down
4 changes: 2 additions & 2 deletions preview-antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ urls:
html_extension_style: indexify
redirect_facility: netlify
latest_version_segment: 'current'
latest_prerelease_version_segment: 'prerelease'
latest_prerelease_version_segment: 'beta'
latest_version_segment_strategy: redirect:to
content:
sources:
- url: https://github.com/redpanda-data/documentation
branches: [v/*, home, api, shared, site-search]
branches: [main, v/*, home, api, shared, site-search]
ui:
bundle:
url: https://github.com/redpanda-data/docs-ui/releases/latest/download/ui-bundle.zip
Expand Down

0 comments on commit 262c12c

Please sign in to comment.