-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from bcgov/bcds-take-1
Integrate aspects of the BCDS Design Tokens system
- Loading branch information
Showing
45 changed files
with
6,602 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.py] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ frontend/_site/ | |
.RData | ||
.Ruserdata | ||
.Rproj.user | ||
.idea | ||
.idea |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Releasing and Updating Advisories | ||
|
||
## Creating an Advisory | ||
|
||
### Process Overview | ||
|
||
1. This repository, `nr-epd-aq-statements` comprises a Quarto application that will collate and render documents in | ||
Markdown format, producing a complete website with navigation and several automatically-generated lists (for example, | ||
current Smoky Skies Bulletins, and historical advisories). | ||
2. The resulting website is published on [Github pages](https://bcgov.github.io/nr-epd-aq-statements/). It is a static | ||
website, and must be rebuilt from scratch each time content changes. It must also be rebuilt to recompute lists (for | ||
example, those that rely on dates, like the | ||
list of active bulletins). It should ideally be rebuilt daily to remain current. | ||
3. To contribute a new Smoky Skies Bulletin or Advisory, use the companion Shiny application. This application will | ||
produce three output files when run. Those three files should be submitted to this repository in the form of a | ||
pull-request. | ||
4. When the pull-request is merged, the site will begin to rebuild. You can view the status of the build process | ||
in [Github Actions](https://github.com/bcgov/nr-epd-aq-statements/actions). Once the action completes, the new | ||
content will be available on the public [Github pages](https://bcgov.github.io/nr-epd-aq-statements/) site | ||
immediately. | ||
|
||
<img src="Contribution Flow.png" alt='Contribution Workflow'/> | ||
|
||
### Pull Request Details | ||
|
||
- The pull request should be created against the `main` branch. This can be accomplished by either checking out the | ||
repository locally and making changes with the `git` command line or desktop tools, or via Github's web interface | ||
using the [upload tool](https://github.com/bcgov/nr-epd-aq-statements/upload/main). | ||
- Regardless of the method for creating the pull request, it should include three files: | ||
- `map.html` | ||
- dated markdown file (eg `2025-02-06_Smoky-Skies_Issue.md`) | ||
- corresponding PDF file (eg `2025-02-06_Smoky-Skies_Issue.pdf`) | ||
- The files should be contributed to the project in the directory `frontend/statements/YYYY-MM/DD`. Separating the files | ||
in this way ensures that `map.html` is not overwritten (since each statement has a corresponding map file and its name | ||
is not easily changed). | ||
- If more than one statement is created on a given day, consider creating them in further subfolders with a meaninful | ||
name, such as the region or the hour of issue. | ||
|
||
## Updating or Removing an Advisory | ||
|
||
### Updating an existing Advisory | ||
|
||
To update an existing advisory, follow the same steps as above to regenerate the advisory and create a pull request that | ||
**overwrites** the files you wish to edit. After the pull request is merged and the site rebuilt, the content will be | ||
updated. | ||
|
||
You may also create a pull request manually with the Github website if you wish to manually update specific wording | ||
within a statement, advisory, or bulletin. Be aware that you can only edit the generated `html` content this way, and | ||
that corresponding `pdf`s are passed through unmodified (so if you need to change a PDF too, you must make the change by | ||
editing the template in the Shiny app before exporting it), | ||
|
||
### Removing an Advisory | ||
|
||
To remove an advisory, create a pull request against the main branch that deletes the three files (markdown, pdf, | ||
and `map.html`). When the site is rebuilt, the content will be removed and will not be accessible via any listings or | ||
even directly by the URL. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Updating Static Content | ||
|
||
## Content | ||
|
||
There are four pages that provide base content for the static site. They are: | ||
|
||
- `index.qmd` - the home page | ||
- `measuring.qmd` - 'Measuring air quality' document | ||
- `shortcode_demos.qmd` (provided as an example) | ||
- `statements.qmd` - A dynamic list of historic statements. Contents are generated automatically based on the contents | ||
of the preamble ([Quarto Custom Listings](https://quarto.org/docs/websites/website-listings-custom.html)) | ||
|
||
These four documents are written in QMD format and can be edited via Github Pull Request against the `main` branch. | ||
|
||
You can add or remove content as required to edit the static content of the site. Create, edit, or delete files with | ||
a `.qmd` extension in the `frontend` directory. Any file whose name starts with an underscore `_` will be ignored by | ||
Quarto during the rendering step. | ||
|
||
## Navigation | ||
|
||
You may wish to add, remove, or reorder the contents of the site navigation top bar or sidebar. They will not be updated | ||
automatically if you add or delete static content files. These elements are defined in the | ||
file `_extensions/bcds/_extension.yaml` under the key `contributes.project.website`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/.quarto/ | ||
|
||
/env/ | ||
|
||
_recent_statements.yaml | ||
_ssb.yaml | ||
|
||
# for local testing | ||
Caddyfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
auto_https off | ||
} | ||
:3000 | ||
|
||
root * _site | ||
file_server | ||
|
||
log { | ||
level WARN | ||
} | ||
encode gzip | ||
|
||
route { | ||
header /* Cache-Control max-age=3 | ||
} | ||
|
||
route { | ||
try_files {path} /index.html | ||
header /index.html { | ||
Cache-Control max-age=0,no-cache,no-store,must-revalidate | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
```{=html} | ||
<% if (items.length > 0) { %> | ||
<table> | ||
<thead> | ||
<tr> | ||
<td>Title</td> | ||
<td>Date</td> | ||
<td>Location</td> | ||
<td>Categories</td> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% for (const item of items) { %> | ||
<tr> | ||
<td><a href="<%- item.path %>"><%= item.title %></a></td> | ||
<td><%= item.date %></td> | ||
<td><%= item.location %></td> | ||
<td><%= item.categories %></td> | ||
</tr> | ||
<% } %> | ||
</tbody> | ||
</table> | ||
<% } else { %> | ||
<em>There are currently no air quality advisories in effect.</em> | ||
<% } %> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
title: bcds | ||
author: Robert Johnstone | ||
version: 1.0.0 | ||
quarto-required: ">=1.6.0" | ||
contributes: | ||
shortcodes: | ||
- bcds.lua | ||
project: | ||
project: | ||
output-dir: _site | ||
type: website | ||
resources: | ||
- "assets" | ||
format: bcds-html | ||
website: | ||
page-footer: | ||
border: false | ||
center: | | ||
<footer class='bcds-footer'> | ||
<div class='bcds-footer--acknowledgement'> | ||
<div class='bcds-footer--acknowledgement-text'><p>The B.C. Public Service acknowledges the territories of First | ||
Nations around B.C. and is grateful to carry out our work on | ||
these lands. We acknowledge the rights, interests, priorities, | ||
and concerns of all Indigenous Peoples — First Nations, Métis, | ||
and Inuit — respecting and acknowledging their distinct | ||
cultures, histories, rights, laws, and governments.</p></div> | ||
</div> | ||
<div class='bcds-footer--container'> | ||
<div class='bcds-footer--container-content'> | ||
<div class='bcds-footer--logo-links horizontal'> | ||
<div class='bcds-footer--logo'> | ||
<img class='navbar-brand-logo' src='/_extensions/bcds/assets/BCID_H_rgb_pos.svg'/> | ||
<p>We can help in over 220 languages and through other accessible options.<!-- --> | ||
<a href='https://www2.gov.bc.ca/gov/content?id=6A77C17D0CCB48F897F8598CCC019111'>Call, email or text | ||
us</a>, or<!-- --> <a | ||
href='https://www2.gov.bc.ca/gov/content?id=FBC4210F6BC047A5884198F543C97D53' | ||
>find a service centre</a></p></div> | ||
<figure class='bcds-footer--links'> | ||
<figcaption class='bcds-footer--links-title'>More Info</figcaption> | ||
<ul> | ||
<li><a href='https://www2.gov.bc.ca/gov/content/home'>Home</a></li> | ||
<li><a href='https://www2.gov.bc.ca/gov/content?id=3C4F47288DFB454987435AB5EFEFBB7F'>About gov.bc.ca</a> | ||
</li> | ||
<li><a href='https://www2.gov.bc.ca/gov/content?id=79F93E018712422FBC8E674A67A70535'>Disclaimer</a></li> | ||
<li><a href='https://www2.gov.bc.ca/gov/content?id=9E890E16955E4FF4BF3B0E07B4722932'>Privacy</a></li> | ||
<li><a href='https://www2.gov.bc.ca/gov/content?id=E08E79740F9C41B9B0C484685CC5E412'>Accessibility</a> | ||
</li> | ||
<li><a href='https://www2.gov.bc.ca/gov/content?id=1AAACC9C65754E4D89A118B875E0FBDA'>Copyright</a></li> | ||
<li><a href='https://www2.gov.bc.ca/gov/content?id=6A77C17D0CCB48F897F8598CCC019111'>Contact us</a></li> | ||
</ul> | ||
</figure> | ||
</div> | ||
<hr/> | ||
<p class='bcds-footer--copyright'>© 2025 Government of British Columbia.</p></div> | ||
</div> | ||
</footer> | ||
resources: | ||
- "*.html" | ||
- "*.pdf" | ||
title: "Air quality advisories" | ||
navbar: | ||
logo: /_extensions/bcds/assets/BCID_H_rgb_pos.svg | ||
right: | ||
- text: Issued advisories | ||
href: index.qmd | ||
- text: Historical advisories | ||
href: statements.qmd | ||
sidebar: | ||
style: "docked" | ||
alignment: left | ||
border: false | ||
collapse-level: 3 | ||
contents: | ||
- text: Air Quality Data | ||
- section: Active advisories | ||
contents: statements | ||
- section: Air Quality Data | ||
href: https://www2.gov.bc.ca/gov/content/environment/air-land-water/air/air-quality | ||
contents: | ||
- text: Air advisories | ||
href: index.qmd | ||
- text: Historical advisories | ||
href: statements.qmd | ||
- text: BCDS Shortcode Demos | ||
href: shortcode_demos.qmd | ||
- text: Air Quality Subscription Service | ||
href: https://www2.gov.bc.ca/gov/content/environment/air-land-water/air/air-quality/air-advisories/air-quality-subscription-service | ||
- text: "Air Quality Health Index" | ||
href: https://www2.gov.bc.ca/gov/content/environment/air-land-water/air/air-quality/aqhi | ||
- text: "Air Quality Health Index widget" | ||
href: https://www2.gov.bc.ca/gov/content/environment/air-land-water/air/air-quality/aghi-widget | ||
- text: "Latest air quality data" | ||
href: https://www2.gov.bc.ca/gov/content/environment/air-land-water/air/air-quality/current-air-quality-data | ||
- text: "How we measure" | ||
href: https://www2.gov.bc.ca/gov/content/environment/air-land-water/air/air-quality/measuring | ||
formats: | ||
html: | ||
toc: false | ||
include-before-body: | ||
text: | | ||
<script> | ||
function BCDSCollapseAll() { | ||
const elements = document.getElementsByClassName('bcds-disclosure'); | ||
for (let i=0; i<elements.length; i++) { | ||
elements.item(i).removeAttribute('open'); | ||
} | ||
} | ||
function BCDSExpandAll() { | ||
const elements = document.getElementsByClassName('bcds-disclosure'); | ||
for (let i=0; i<elements.length; i++) { | ||
elements.item(i).setAttribute('open', true); | ||
} | ||
} | ||
</script> | ||
theme: | ||
- minimal | ||
- variables.scss | ||
- bcds.scss | ||
- bcds-footer.scss | ||
- bcds-callouts.scss | ||
- bcds-inline-alert.scss | ||
- bcds-cards.scss | ||
- bcds-accordion.scss | ||
|
||
|
Oops, something went wrong.