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.md
+66Lines changed: 66 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,72 @@ Then click the "Re-run all jobs" button at the top of the page:
105
105
106
106

107
107
108
+
109
+
## Updating the What's New Page with Changelogs
110
+
111
+
Within this project is the ability to automate the display of the latest releases from the VADS component library and design system documentation repositories, along with recent changes from the component library's Figma file. This ensures the "What's New" page in the documentation site is always up-to-date.
112
+
113
+
### Features
114
+
115
+
***Automated Release Fetching:** Retrieves and displays the latest releases from:
***Embedded Figma Changelog:** Integrates the changelog frame from the Component Library Figma file.
119
+
***Dynamic "What's New" Updates:** Automatically updates the "What's New" page with the latest release notes.
120
+
121
+
### File Structure
122
+
123
+
*`json_data_cache/` - Stores fetched release data in JSON format, enabling Jekyll to access it during site builds.
124
+
*`src/`
125
+
*`_about/`
126
+
* `whats-new.md` - The page that displays the latest updates.
127
+
*`_includes/`
128
+
*`_github_markdown_parser.html` - Parses each release from the `data` object into a `va-card` and performs text manipulation for a more user-friendly display.
129
+
*`_plugins/`
130
+
*`jekyll_get_json.rb` - A Jekyll plugin that fetches and stores JSON data from GitHub, making it available to Jekyll's `data` object.
131
+
*`vads.rb` - Provides a custom Jekyll/Liquid filter for applying regular expression-based string transformations to release notes, enhancing readability.
132
+
*`_config.yml` - Configuration file for Jekyll, defining repository URLs and Figma file details.
133
+
*`package.json` - Contains the `yarn run update-releases` script, a shortcut for updating release data.
134
+
135
+
### How Jekyll Displays the Latest Releases
136
+
137
+
[!NOTE]
138
+
These scripts rely on releases to be created in the [component-library repo](https://github.com/department-of-veterans-affairs/component-library) and [design.va.gov repo](https://github.com/department-of-veterans-affairs/vets-design-system-documentation). Before running the scripts, be sure that a release is made and tagged appropriately.
139
+
140
+
1.**JSON Data Retrieval:**
141
+
* When Jekyll builds the site, it checks for JSON files (defined in `_config.yml`) in the `json_data_cache/` folder.
142
+
* If the files do exist, the cached files are used preventing repeated requests to Github.
143
+
* If the files do not exist, it fetches the latest release notes from GitHub and stores it as JSON in the `json_data_cache/` folder.
144
+
2.**Data Loading:**
145
+
* The JSON data is loaded into Jekyll's `data` object upon building the site.
146
+
3.**"What's New" Page Generation:**
147
+
* The `whats-new.md` page uses the `_github_markdown_parser.html` include to process the release data from the `data` object and passes that into `json`.
148
+
* The `num_recent_releases` parameter controls how many of the most recent releases are shown.
149
+
* Example:
150
+
```
151
+
{% include _github_markdown_parser.html json=site.data.site_releases num_recent_releases=3 %}
152
+
```
153
+
4. **String Manipulation:**
154
+
* The `vads.rb` custom filter applies regular expression transformations to the release notes (`json`), improving readability.
155
+
5. **Figma Data:**
156
+
* The Figma changelog frame is simply embedded into the page with an iframe direct from the Figma Component Library. Updates are in real time.
157
+
158
+
### How to Update the What's New Page
159
+
160
+
[!NOTE]
161
+
Be sure your local environment is not running before getting the latest updates.
162
+
163
+
1. Run `yarn run update-releases`. This script deletes the `json_data_cache/` folder and then fetches the latest release data from GitHub, ensuring you have the most current information. It will then continue to build the site normally.
164
+
2. If release data is fetched, you should see this captured in the logs as the site builds:
165
+
```
166
+
...
167
+
Generating...
168
+
* Caching https://api.github.com/repos/department-of-veterans-affairs/vets-design-system-documentation/releases in json_data_cache/site_releases.json
169
+
* Caching https://api.github.com/repos/department-of-veterans-affairs/component-library/releases in json_data_cache/component_library_releases.json
0 commit comments