Skip to content

Commit

Permalink
Add search dependencies (#73)
Browse files Browse the repository at this point in the history
* Add search dependencies

* minor edit

* Remove line numbers from supplemental-ui example links

* another take

---------

Co-authored-by: Eric Schneider <37347760+eric-schneider@users.noreply.github.com>
  • Loading branch information
johnsmartco and eric-schneider authored May 4, 2023
1 parent fcb0d50 commit e645270
Showing 1 changed file with 57 additions and 2 deletions.
59 changes: 57 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= DataStax Antora UI
// Variables:
:current-release: prod-9
:current-release: prod-12
// Settings:
:!example-caption:
:experimental:
Expand All @@ -18,9 +18,11 @@ ifdef::env-github[]
endif::[]
// Project URIs:
:project-repo-name: riptano/antora-ui-docs
:url-repo: git@github.com:{project-repo-name}.git
:url-project: https://github.com/{project-repo-name}
:url-site: https://docs.datastax.com
:url-repo: git@github.com:{project-repo-name}.git
:url-coppi: https://coppi.aws.dsinternal.org
:url-docs-preview: http://docs-preview.datastax.com
// External URIs:
:url-antora: https://antora.org
:url-git: https://git-scm.com
Expand All @@ -30,6 +32,7 @@ endif::[]
:url-nvm: https://github.com/creationix/nvm
:url-nvm-install: {url-nvm}#installation
:url-datastax: https://datastax.com
:url-docs-home: https://github.com/riptano/docs-home

ifdef::badges[]
image:https://img.shields.io/static/v1?label=release&amp;message={current-release}&amp;color=blue[Latest Release,link={url-project}/releases/download/{current-release}/ui-bundle.zip,format=svg]
Expand Down Expand Up @@ -62,6 +65,58 @@ NOTE: The `snapshot` flag tells Antora to fetch the UI when the `--fetch` comman
This setting is required because updates to the UI bundle are pushed to the same URL.
If the URL were to be unique, this setting would not be required.

[#search-dependencies]
=== About site search UI dependencies

Additional tasks must be performed in order for the site search functionality on {url-site}[docs.datastax.com] to work properly.
These tasks only need to be performed when changes are made to the following files:

[%header.autowidth.stretch]
|===
|Files |Tasks

|{url-project}/blob/main/gcx/algoliaSearch/index.html[_gcx/algoliaSearch/index.html_]
|Copy this file to the _/en/search_ directory on the {url-coppi}/en/search/[coppi] and {url-docs-preview}/en/search/[docs-preview] servers.

|{url-project}/tree/main/gcx/algoliaSearch/src[_gcx/algoliaSearch/src/*_]
|Copy these files to the _playbooks/supplemental-ui_ directory in the {url-docs-home}/tree/main/playbooks/supplemental-ui[docs-home] repository.
|===

In the {url-docs-home}[docs-home] repository, the {url-docs-home}/blob/main/playbooks/site-local-home.yaml[_site-local-home.yaml_] and {url-docs-home}/blob/main/playbooks/site-publish-home.yaml[_site-publish-home.yaml_] playbooks are configured to incorporate the files from the _supplemental-ui_ directory into the assets directory of the generated site:

[source,yaml]
----
ui:
supplemental_files:
- path: css/siteSearch.css
contents: ./supplemental-ui/siteSearch.css
- path: js/siteSearch.js
contents: ./supplemental-ui/siteSearch.js
output_dir: assets
----

Whenever files are changed or added within the _supplemental-ui_ directory, the `home` docset must then be built and deployed to all of the docs servers to ensure that the servers have the latest site search assets.

[source,console]
----
bsys build home
bsys deploy home coppi
bsys deploy home docs-preview
bsys sync
----

.coppi asset locations
----
/var/www/en/home/assets/css/siteSearch.css
/var/www/en/home/assets/js/siteSearch.js
----

.docs-preview asset locations
----
/datastax/www/docs.datastax.com/en/home/assets/css/siteSearch.css
/datastax/www/docs.datastax.com/en/home/assets/js/siteSearch.js
----

== Development quickstart

This section offers a basic tutorial to teach you how to set up the UI project, preview it locally, and bundle it for use with Antora.
Expand Down

0 comments on commit e645270

Please sign in to comment.