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
+55Lines changed: 55 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -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.
0 commit comments