Skip to content

Commit 565311f

Browse files
DOC-4217: Add “page source” links to preview-src pages (#101) [no-release]
* Add “page source” links to preview-src pages * Update README with latest automation enhancements
1 parent b75c032 commit 565311f

14 files changed

+77
-73
lines changed

README.adoc

Lines changed: 31 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ ifdef::env-github[]
1818
endif::[]
1919
// Project URLs:
2020
:url-project: https://github.com/riptano/docs-ui
21-
:url-preview: https://riptano.github.io/docs-ui/main
21+
:url-ui-preview: https://riptano.github.io/docs-ui/main
22+
:url-ui-bundle-latest: {url-project}/releases/latest
2223
// :url-ci-pipelines: {url-project}/pipelines
2324
// :img-ci-status: {url-project}/badges/master/pipeline.svg
2425
:url-docs-home: https://github.com/riptano/docs-home
@@ -43,10 +44,10 @@ endif::[]
4344
:url-source-maps: https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Use_a_source_map
4445
:url-create-release: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release
4546

46-
// image:{img-ci-status}[CI Status (GitLab CI), link={url-ci-pipelines}]
47-
// ifdef::badges[]
48-
// image:https://img.shields.io/static/v1?label=release&message={current-release}&color=blue[Latest Release,link={url-project}/releases/download/{current-release}/ui-bundle.zip,format=svg]
49-
// endif::[]
47+
ifdef::badges[]
48+
image:https://img.shields.io/github/v/release/riptano/docs-ui?label=latest%20release&labelColor=%23232324&color=%237724aa["Latest UI bundle release (GitHub)", link={url-ui-bundle-latest}]
49+
image:https://img.shields.io/badge/Preview-%237724aa["Latest UI preview (GitHub Pages)", link={url-ui-preview}]
50+
endif::[]
5051

5152
This project is used to develop and distribute the UI template for {url-datastax-docs}.
5253
It is a fork of the {url-antora-default-ui}[Antora Default UI] that has been customized for our needs.
@@ -55,8 +56,9 @@ The repository itself produces a UI bundle that can be applied when generating a
5556
The UI bundle contains the HTML templates (layouts, partials, and helpers), CSS, JavaScript, fonts, and (site-wide) images.
5657
As such, it provides both the visual theme and user interactions for the documentation site.
5758

58-
You can see a preview of the DataStax Docs UI at {url-preview}.
59+
* Latest UI preview: {url-ui-preview}
5960
61+
* Latest UI bundle release: {url-ui-bundle-latest}
6062
6163
toc::[]
6264

@@ -243,6 +245,11 @@ This works by monitoring the project for changes, running the `preview:build` ta
243245

244246
Press kbd:[Ctrl+C] to stop the preview server and end the continuous build.
245247

248+
[NOTE]
249+
====
250+
Opening or updating a pull request against the `main` branch triggers an automatic `gulp preview` deployment to GitHub Pages so that reviewers can view your latest changes without having to run the preview locally.
251+
====
252+
246253
[#create-bundle]
247254
=== Package for use with Antora
248255

@@ -267,6 +274,12 @@ gulp bundle:pack
267274

268275
The UI bundle will again be available at [.path]_build/ui-bundle.zip_.
269276

277+
[NOTE]
278+
====
279+
UI bundles for the DataStax documentation site are automatically published via automation.
280+
See <<automatic-ui-release>>.
281+
====
282+
270283
==== Source maps
271284

272285
The build consolidates all the CSS and client-side JavaScript into combined files, [.path]_site.css_ and [.path]_site.js_, respectively, in order to reduce the size of the bundle.
@@ -288,67 +301,28 @@ In this case, the bundle will include the source maps, which can be used for deb
288301

289302
==== Using TailwindCSS
290303

291-
This project uses TailwindCSS. To learn more see xref:{url-tailwind-readme}[TailwindCSS README].
304+
This project uses TailwindCSS.
305+
To learn more see xref:{url-tailwind-readme}[TailwindCSS README].
292306

293-
== Release the UI bundle
307+
[#automatic-ui-release]
308+
== Automatic UI bundle release
294309

295310
Once you're satisfied with the changes you've made to the UI, you'll need to open a pull request to merge your changes into the `main` branch.
296-
After your changes have been reviewed and merged, you can then choose to make those changes available in the production UI by publishing a new release to this repository and attaching the latest `ui-bundle.zip` file.
311+
Upon merging a pull request into `main`, the following automation occurs:
297312

298-
=== Bundle release procedure
313+
. A new UI bundle is built using `gulp bundle` (linting also occurs during this step).
299314

300-
. Start by making sure you've completed the <<prerequisites>>.
315+
. Assuming a successful build, a new tag is applied to the latest commit (incremented from the previous `prod-#` tag).
301316

302-
. Create the release commit.
303-
+
304-
Edit https://github.com/riptano/docs-ui/blob/bdf6484e46f41cff17238a7ef5aeae5368622d2c/README.adoc?plain=1#L3[README.adoc] directly in GitHub and increment the `:current-release:` attribute to the next version number.
305-
+
306-
[source,asciidoc]
307-
----
308-
:current-release: prod-* <.>
309-
----
310-
<.> Add +1 to the version number
311-
+
312-
This should be the only change in the commit, and the commit message should take the form of *Release prod-*.
313-
If you have Admin privileges to the repository, you can commit the changes directly to `main`.
314-
Otherwise, you'll need to open a PR.
317+
. A new `prod-#` {url-project}/releases[release] is published with auto-generated release notes and the UI bundle release asset.
315318

316-
. Once the release commit is merged, open your local copy of the repository in a terminal and retrieve the latest changes from `main`.
317-
+
318-
[source,shell]
319-
----
320-
git switch main && git pull
321-
----
322-
323-
. Pack the UI bundle as described in <<create-bundle>>.
324-
+
325-
[source,shell]
326-
----
327-
gulp bundle
328-
----
329-
330-
. Create a new release (see {url-create-release}[GitHub documentation]).
331-
.. Create a new tag named after the new version (e.g., `prod-2`).
332-
The tag needs to target the `main` branch.
333-
.. Make sure the *Title* of the release is the same name as the tag.
334-
(The release title and the tag name should always be made the same, as it makes releases easier to identify.)
335-
.. Instead of manually adding a description for the release, just click *Generate release notes*.
336-
This automatically adds a description that highlights the functional changes that have been added since the last release.
337-
.. Attach the UI bundle (`ui-bundle.zip`) as a release asset.
338-
.. (Optional) Check the box labeled *This is a pre-release* if you don't want the release to be generally available.
339-
+
340-
Selecting this option is helpful if you want to publish a new UI bundle for testing purposes.
341-
You can edit the release later to remove the *Pre-release* label if desired.
342-
.. When you're ready, publish the release.
343-
344-
Once the new release is published, the attached bundle can then be downloaded from the repository using a unique URL found on the {url-project}/releases[releases page].
345-
346-
[IMPORTANT]
319+
[TIP]
347320
====
348-
All production builds of the DataStax docs are configured to pull the latest, _non-pre-release_ UI bundle.
349-
Once you've publish a new release, all subsequent site builds that use the configuration described in <<use-the-ui>> will consume the new UI bundle.
321+
If you don't want your pull request to trigger an automatic release, e.g. you're only making updates to the README or `preview-src` files, you can skip the automation by including `[no-release]` in the commit message.
350322
====
351323

324+
Once the release is published, you can apply it by updating your Antora playbook to point to the new UI bundle URL.
325+
To apply it to the DataStax documentation site, you'll need to update the playbook in the {url-datastax-docs-repo}[datastax-docs-site] repository.
352326

353327
== Copyright and license
354328

preview-src/asciidoc/admonitions.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
:idseparator: -
44
:table-caption!:
55

6+
*Page source*: https://github.com/riptano/docs-ui/blob/main/preview-src/asciidoc/admonitions.adoc
7+
68
== Basic admonitions
79

810
.Optional title

preview-src/asciidoc/blocks.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
:example-caption!:
55
:stem:
66

7+
*Page source*: https://github.com/riptano/docs-ui/blob/main/preview-src/asciidoc/blocks.adoc
8+
79
== Collapsible blocks
810

911
.Basic collapsible block

preview-src/asciidoc/code.adoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
:idprefix:
33
:idseparator: -
44

5+
*Page source*: https://github.com/riptano/docs-ui/blob/main/preview-src/asciidoc/code.adoc
6+
57
== Inline code
68

79
Monospace text formatting is typically used to represent text shown in `computer terminals` or `code editors` (often referred to as a codespan).
@@ -93,13 +95,17 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i
9395
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
9496
----
9597

96-
=== Text formatting
98+
=== Text formatting (variables)
9799

98-
[source,bash,subs="quotes"]
100+
[source,sql,subs="verbatim,quotes"]
99101
----
100-
cd /Users/*_your-name_*/repos/astra-vector-docs/build/site
102+
DESCRIBE **KEYSPACE_NAME**.**TABLE_NAME**
101103
----
102104

105+
Replace the following:
106+
107+
* *`KEYSPACE_NAME`*: The name of the keyspace that contains the table you want to migrate.
108+
* *`TABLE_NAME`*: The name of the table that contains the data you want to migrate.
103109

104110
== Callouts
105111

preview-src/asciidoc/images.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
:idseparator: -
44
:figure-caption!:
55

6+
*Page source*: https://github.com/riptano/docs-ui/blob/main/preview-src/asciidoc/images.adoc
7+
68
== Block images
79

810
.Optional title

preview-src/asciidoc/lists.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
:idseparator: -
44
:table-caption!:
55

6+
*Page source*: https://github.com/riptano/docs-ui/blob/main/preview-src/asciidoc/lists.adoc
7+
68
== Unordered list
79

810
* List item

preview-src/asciidoc/tables.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
:idseparator: -
44
:table-caption!:
55

6+
*Page source*: https://github.com/riptano/docs-ui/blob/main/preview-src/asciidoc/tables.adoc
7+
68
== Basic table
79

810
.Optional title

preview-src/asciidoc/tabsets.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
:python-icon: image:../img/python-original.svg[,22]
1010
:shell-icon: image:../img/shell-original.svg[,20]
1111

12+
*Page source*: https://github.com/riptano/docs-ui/blob/main/preview-src/asciidoc/tabsets.adoc
13+
1214
[NOTE]
1315
====
1416
Tabsets depend on the https://github.com/asciidoctor/asciidoctor-tabs[Asciidoctor Tabs] extension.

preview-src/asciidoc/text-formatting.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
:idseparator: -
44
:experimental:
55

6+
*Page source*: https://github.com/riptano/docs-ui/blob/main/preview-src/asciidoc/text-formatting.adoc
7+
68
A paragraph can be defined as one or more lines of consecutive text that are logically grouped together.
79
To differentiate between paragraphs, you simply need to insert at least one blank line between them.
810

preview-src/page-templates/full.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
= {company} Astra
22
:page-layout: full
33

4+
*Page source*: https://github.com/riptano/docs-ui/blob/main/preview-src/page-templates/full.adoc
5+
46
[.max-w-[650px]]
57
DataStax Astra is a cutting-edge cloud-native database platform designed to empower developers.
68
Harnessing the strengths of vector databases, serverless computing, and real-time streaming, Astra propels application development into the next generation.

0 commit comments

Comments
 (0)