Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit de9aff5

Browse files
ckoegelbrianluisgomezdyeam-bw
authored
DX-2837 Add Documentation for New LTS Process (#741)
* DX-2837 Add Documentation for New LTS Process * convert to react component for easier updating * update version * update test * add keyword * update action version * Apply suggestions from code review Co-authored-by: Brian <[email protected]> * Update site/docs/versions.mdx Co-authored-by: dyeam-bw <[email protected]> Co-authored-by: Brian <[email protected]> Co-authored-by: dyeam-bw <[email protected]>
1 parent 6d99500 commit de9aff5

File tree

5 files changed

+138
-3
lines changed

5 files changed

+138
-3
lines changed

.github/workflows/lts-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
BUCKET_NAME: ${{ needs.lts_needed.outputs.release_name }}
4949

5050
- name: Sync to S3
51-
uses: Bandwidth/s3-sync-action@v1.2.0
51+
uses: Bandwidth/s3-sync-action@v1.3.0
5252
with:
5353
bucket-name: ${{ steps.bucket_name.outputs.bucket_name }}
5454
bucket-expiration: '180'

site/cypress/e2e/tests/docs.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ context('Emergency Services Link', () => {
2828
testTextLink('/docs','Emergency Services', 'docs/emergency' ,'.docs-intro-grid-item')
2929
})
3030

31-
context('Next - About Link', () => {
32-
testTextLink('/docs','About', 'docs/account' ,'a.pagination-nav__link')
31+
context('Next - Versions Link', () => {
32+
testTextLink('/docs','Versions', 'docs/versions' ,'a.pagination-nav__link')
3333
})
3434

3535
context('Edit This Page Link', () => {

site/docs/versions.mdx

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
id: versions
3+
title: Bandwidth Documentation Versions
4+
slug: /versions
5+
description: Bandwidth's Developer Docs Versions
6+
sidebar_label: Versions
7+
hide_table_of_contents: true
8+
keywords:
9+
- bandwidth
10+
- docs
11+
- documentation
12+
- api
13+
- versioning
14+
- LTS
15+
hide_title: false
16+
image: '@site/static/img/bw-icon.svg'
17+
---
18+
19+
import LTSVersions from '@site/src/components/LTSVersions.js';
20+
21+
export const versions = [
22+
'v2022.10.17'
23+
]
24+
25+
# Bandwidth Documentation Versions
26+
27+
Bandwidth maintains both current and LTS versions of our docsite and all of its contents.
28+
What you will find here (dev.bandwidth.com), will always be the most up-to-date version of our docsite.
29+
If you need to access an old version of our site, you can check the [LTS Versions](#lts-versions) table below.
30+
Our versions use date-based versioning in the format `vYYYY.MM.DD`.
31+
32+
### LTS Versions
33+
34+
This table contains all of our current LTS versions of the doc site, which are snapshots of the site and its contents taken on the 1st and 16th of each month.
35+
We maintain up to 12 LTS versions, or 6 months of old content. After 6 months, the LTS versions can still be accessed via Github, but will not be hosted online.
36+
37+
<LTSVersions versions={versions}/>
38+
39+
:::info
40+
If you need to access a version of the site not listed as an LTS Version, either because the version was not published as an LTS release,
41+
or because the LTS version is outside of our 6 month support window, please see the [Other Versions](#other-versions) sections below.
42+
:::
43+
44+
### Other Versions
45+
46+
Even though we only release an LTS version of the site twice a month, the site can have changes published as frequently as once a day. This is possible during periods when multiple domain teams are making documentation changes.
47+
These releases also follow our date-based versioning schema, and contain changes to the site that were made over the course of a few days at most.
48+
If you are in need of changes that will only be contained in one of these versions, all of our releases can be found on our [Github Releases Page](https://github.com/Bandwidth/api-docs/releases).
49+
Instructions for how to use these releases can be found below.
50+
51+
#### Using Github Release Versions
52+
53+
Since versions found in our Github Releases are not hosted online, they will need to be downloaded and accessed locally.
54+
You can follow these steps to access and run the site locally.
55+
56+
1. **Choose Your Release.**
57+
* Find the release that contains the content you want to view. All of our releases can be found [here](https://github.com/Bandwidth/api-docs/releases).
58+
59+
2. **Download and Extract the Release.**
60+
* In the `Assests` section on the release page, there will be links to both a `.zip`, and `tar.gz` file that contain the contents of that release.
61+
Choose one of the two, download, and extract it to a folder on your PC.
62+
63+
3. **Open Terminal in the `/site` Directory of the Project.**
64+
* Navigate to the `/site` directory inside the newly extracted folder and open the terminal of your choice.
65+
:::info
66+
A lot of our documentation is written in Markdown; therefore, if you are comfortable naviagting the file structure of the project,
67+
this documentation can be found in the `/docs` directory, and does not necessarily need to be viewed with the whole site running locally.
68+
You may forgo opening a ternimal and following the succeeding steps if you wish to to do this.
69+
These files can be viewed in the text editor of your choice, or copy and pasted into a markdown renderer such as [Dillinger](https://dillinger.io/).
70+
If you choose to go with this method of viewing the files, note that some formatting may not be supported.
71+
:::
72+
73+
4. **Install Packages and Run the Site**
74+
* This step requires you to have either [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/) installed.
75+
76+
From the terminal run the following commands for npm.
77+
```bash
78+
npm i # installs packages
79+
npm run start # builds and serves the site locally
80+
```
81+
82+
**_OR_**
83+
84+
From the terminal run the following commands for yarn.
85+
```bash
86+
yarn # installs packages
87+
yarn start # builds and serves the site locally
88+
```
89+
90+
5. **Access the Locally Running Site**
91+
* The site can now be accessed via `localhost:3000` and navigated around normally.
92+
93+
:::caution
94+
Since these versions are running locally, the Algolia search at the top right of our site will not work properly for these sites.
95+
:::

site/sidebar.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ module.exports = {
44
id: "intro",
55
label: "Introduction",
66
},
7+
{
8+
type: "doc",
9+
id: "versions",
10+
label: "Versions"
11+
},
712
{
813
type: "category",
914
label: "Account Management",

site/src/components/LTSVersions.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from 'react';
2+
3+
export default function LTSVersions({versions}) {
4+
return (
5+
<table>
6+
<thead>
7+
<tr>
8+
<th>LTS Version</th>
9+
<th>Release Date</th>
10+
<th>Sunset Date</th>
11+
<th>Hosted Link</th>
12+
<th>Github Release</th>
13+
</tr>
14+
</thead>
15+
<tbody>
16+
{versions.map((version, idx) => {
17+
const s3Version = version.replaceAll(/[^a-z0-9]/g, '-');
18+
const splitVer = version.split('.');
19+
const relDate = new Date(splitVer[0].substring(1), splitVer[1] - 1, splitVer[2]);
20+
var sunDate = new Date();
21+
sunDate.setDate(relDate.getDate() + 180);
22+
return (
23+
<tr key={idx}>
24+
<td>{version}</td>
25+
<td>{relDate.toDateString()}</td>
26+
<td>{sunDate.toDateString()}</td>
27+
<td><a href={`http://bandwidth-api-docs-${s3Version}.s3-website-us-east-1.amazonaws.com/`}>{version}</a></td>
28+
<td><a href={`https://github.com/Bandwidth/api-docs/releases/tag/${version}`}>{version}</a></td>
29+
</tr>
30+
)
31+
})}
32+
</tbody>
33+
</table>
34+
)
35+
}

0 commit comments

Comments
 (0)