You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.adoc
+62-7Lines changed: 62 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
= Couchbase Documentation UI
2
2
// Variables:
3
-
:current-release: cloud-6
3
+
:current-release: cloud-11
4
4
// Settings:
5
5
:!example-caption:
6
6
:experimental:
@@ -198,7 +198,7 @@ If you need to package the UI so you can use it to generate the documentation si
198
198
If any errors are reported by lint, you'll need to fix them.
199
199
200
200
When the command completes successfully, the UI bundle will be available at [.path]_build/ui-bundle.zip_.
201
-
You can point Antora at this bundle using the `--ui-bundle-url` command-line option (e.g., `--ui-bundle-url=../docs-ui/build/ui-bundle.zip`).
201
+
You can point Antora at this bundle using the `--ui-bundle-url` command-line option (e.g., `--ui-bundle-url=../docs-ui-sandbox/build/ui-bundle.zip`).
202
202
203
203
== Control the Visual Appearance of Pages
204
204
@@ -360,6 +360,61 @@ You can test the feedback widget directly from the preview site by setting the `
360
360
361
361
The configuration for the widget is currently hardcoded into the partial template.
362
362
363
+
== View Latest and Canonical URL
364
+
365
+
This section documents the logic used to compute the URL for the View Latest button and the canonical URL.
366
+
367
+
=== View Latest
368
+
369
+
If the version of the current page does not match the latest version of the component (i.e., product), a banner is displayed to the visitor.
370
+
If the version is a prerelease, the banner states that you're viewing a prerelease version.
371
+
If the version is an older stable release, the banner states that a newer version is available.
372
+
On the banner offers a button named "View Latest" that directs the visitor to the latest version.
373
+
374
+
The "View Latest" button tries to preserve the current page when switching versions.
375
+
If the page is no longer available, then the button directs the user to the start page for the component.
376
+
377
+
The URL for the "View Latest" button is computed by the latest-page-url helper.
378
+
Here's the logic that the helper uses:
379
+
380
+
* If the current page is found in the latest version, the latest page URL resolves to the URL of that page.
381
+
For example, the latest page URL for https://docs.couchbase.com/server/6.0/introduction/intro.html resolves to https://docs.couchbase.com/server/6.5/introduction/intro.html (assuming 6.5 is the latest version)
382
+
** If the SUPPORTS_CURRENT_URL=true environment variable is set, the version segment in the URL is replaced with the word "current".
383
+
For example, the latest page URL for https://docs.couchbase.com/server/6.0/introduction/intro.html resolves to https://docs.couchbase.com/server/current/introduction/intro.html
384
+
* If the current page is not found in the latest version, but the page is claimed by an alias, the latest page URL resolves to the URL of the page to which the alias points.
385
+
For example, the latest page URL for https://docs.couchbase.com/server/5.5/admin/ui-intro.html resolves to https://docs.couchbase.com/server/6.5/manage/management-overview.html (assuming 6.5 is the latest version)
386
+
** If the SUPPORTS_CURRENT_URL=true environment variable is set, the version segment in the URL is replaced with the word "current".
387
+
For example, the latest page URL for https://docs.couchbase.com/server/5.5/admin/ui-intro.html resolves to https://docs.couchbase.com/server/current/manage/management-overview.html
388
+
* If neither the current page or an alias is found in the latest version, the latest page URL resolves to the component start page.
389
+
** If the SUPPORTS_CURRENT_URL=true environment variable is set, the version segment in the URL is replaced with the word "current".
390
+
391
+
If the current page is in the archive site and the latest version is in the production site, then the latest page URL will point to the production site.
392
+
In this case, the version segment will only be replaced with "current" if the PRIMARY_SITE_SUPPORTS_CURRENT_URL=true environment variable is set.
393
+
394
+
=== Canonical URL
395
+
396
+
The canonical URL differs slightly from the URL for the "View Latest" button in that if the page cannot be found in the latest version, it instead resolves to the newest version of the page.
397
+
The canonical URL can resolve to the current URL (if the current URL is the canonical URL).
398
+
399
+
The canonical URL is computed by the canonical-url helper.
400
+
Here's the logic that the helper uses:
401
+
402
+
* If the site.url is not set to an absolute path, no value is returned.
403
+
* If the current page is found in the latest version, the canonical URL resolves to the URL of that page.
404
+
For example, the canonical URL for https://docs.couchbase.com/server/6.0/introduction/intro.html resolves to https://docs.couchbase.com/server/6.5/introduction/intro.html (assuming 6.5 is the latest version)
405
+
** If the SUPPORTS_CURRENT_URL=true environment variable is set, the version segment in the URL is replaced with the word "current".
406
+
For example, the canonical URL for https://docs.couchbase.com/server/6.0/introduction/intro.html resolves to https://docs.couchbase.com/server/current/introduction/intro.html
407
+
* If the current page is not found in the latest version, but the page is claimed by an alias, the canonical URL resolves to the URL of the page to which the alias points.
408
+
For example, the canonical URL for https://docs.couchbase.com/server/5.5/admin/ui-intro.html resolves to https://docs.couchbase.com/server/6.5/manage/management-overview.html (assuming 6.5 is the latest version)
409
+
** If the SUPPORTS_CURRENT_URL=true environment variable is set, the version segment in the URL is replaced with the word "current".
410
+
For example, the canonical URL for https://docs.couchbase.com/server/5.5/admin/ui-intro.html resolves to https://docs.couchbase.com/server/current/manage/management-overview.html
411
+
* If neither the current page or an alias is found in the latest version, the current URL resolves to the newest version of the page (which could be the current page).
412
+
For example, the canonical URL for https://docs.couchbase.com/server/4.0/architecture/cluster-ram-quotas.html resolves to https://docs.couchbase.com/server/4.1/architecture/cluster-ram-quotas.html
413
+
** If the SUPPORTS_CURRENT_URL=true environment variable is set, it has no affect on this case.
414
+
415
+
If the current page is in the archive site and the latest version is in the production site, then the canonical URL will point to the production site.
416
+
In this case, the version segment will only be replaced with "current" if the PRIMARY_SITE_SUPPORTS_CURRENT_URL=true environment variable is set and the newest version of the page is the latest version of the component.
417
+
363
418
== Release the UI Bundle
364
419
365
420
Once you're satisfied with the changes you've made to the UI and would like to make those changes available to Antora, you'll need to publish the UI as a bundle by making a release.
@@ -382,12 +437,12 @@ Releasing the UI bundle consists of the following tasks:
382
437
Fortunately, you don't have to do any of these steps yourself.
383
438
These steps are fully automated by the `gulp release` task.
384
439
In fact, you don't even have to run the `gulp release` task manually.
385
-
When a commit is pushed to the master branch of the repository, it triggers the CI job named *release-docs-ui-bundle*, which executes the `gulp release` task using pre-configured credentials.
440
+
When a commit is pushed to the master branch of the repository, it triggers the CI job named *docs-ui-sandbox*, which executes the `gulp release` task using pre-configured credentials.
386
441
387
442
IMPORTANT: A release will only be made if the project validates.
388
443
To validate the project, run `gulp pack` before pushing your changes to GitHub.
389
444
390
-
The release-docs-ui-bundle CI job is already configured, so there's nothing you need to do to make automated release work.
445
+
The docs-ui-sandbox CI job is already configured, so there's nothing you need to do to make automated release work.
391
446
All you have to do is commit your changes and push those commits to the master branch of the git repository.
392
447
A few seconds later, a new bundle will be available for use with Antora.
393
448
Run `git pull` to retrieve the updated README that includes the new URL.
@@ -420,7 +475,7 @@ In the CI job configuration, covered in the next section, you'll learn how this
420
475
=== CI Job Configuration
421
476
422
477
Jenkins is used to execute the CI job that publishes the UI bundle.
423
-
The job is named *release-docs-ui-bundle* and can be found under the *Antora* folder in the Jenkins server managed by the Couchbase docs team.
478
+
The job is named *docs-ui-sandbox* and can be found under the *Antora* folder in the Jenkins server managed by the Couchbase docs team.
424
479
This section describes in detail how that job has been configured in case it must be recreated.
425
480
426
481
The release is performed by the cb-docs-robot GitHub account, which interacts with GitHub entirely using the GitHub API.
@@ -429,10 +484,10 @@ The release script authenticates with the GitHub API as the cb-docs-robot user u
429
484
Create a new CI job from the Pipeline project template.
430
485
On the configuration screen, select or populate the following settings:
431
486
432
-
.Configuration details for the Antora/release-docs-ui-bundle CI job
487
+
.Configuration details for the Antora/docs-ui-sandbox CI job
433
488
====
434
489
General::
435
-
* _Project name:_ `release-docs-ui-bundle`
490
+
* _Project name:_ `docs-ui-sandbox`
436
491
* _Description:_ Packs, tags, and releases the UI bundle whenever a non-ignored commit is pushed to the master branch of this repository.
0 commit comments