Skip to content

use_brand(): install and refresh the openwashdata brand - #110

Merged
larnsce merged 2 commits into
devfrom
109-use-brand
Aug 25, 2026
Merged

use_brand(): install and refresh the openwashdata brand#110
larnsce merged 2 commits into
devfrom
109-use-brand

Conversation

@larnsce

@larnsce larnsce commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Implements #109.

Summary

  • use_brand() copies _brand.yml and the logo files it references from the central openwashdata/brand repository (raw GitHub at a configurable ref, or a local/alternative source for tests and offline work) into the active package.
  • Refresh is idempotent: files compare by md5, unchanged files stay untouched, written and updated files are reported. Brand values are never edited locally (change-here-first discipline).
  • With pkgdown = TRUE, an existing _pkgdown.yml is wired to the brand via template.bslib.brand; without a config the wiring is skipped with a setup_website() hint.
  • brand.yml added to Suggests: bslib resolves the brand through it at site build time, surfaced by the end-to-end trial below.

Test plan

  • Five new tests: install, idempotent refresh with an upstream change, pkgdown wiring and re-run stability, missing-config skip, missing-source error
  • Full suite passes (63)
  • End-to-end: use_brand(ref = "dev") on fslogisticskampala downloaded the brand over the network, wired _pkgdown.yml, and pkgdown::build_site() rendered the site in Atkinson Hyperlegible with the brand palette

Note: the default ref is main, which becomes functional once openwashdata/brand#1 merges; until then ref = "dev" exercises the real download path.

use_brand() copies _brand.yml and the logo files it references from
the central openwashdata/brand repository (raw GitHub content at a
configurable ref, or a local/alternative source for tests and offline
work) into the active package. Re-running refreshes idempotently and
reports written and updated files by md5 comparison; unchanged files
stay untouched. With pkgdown = TRUE an existing _pkgdown.yml is wired
to the brand through template.bslib.brand so the next site build
renders with the brand fonts and colors; without a config the wiring
is skipped with a setup_website() hint. Brand values are never edited
locally, keeping the change-here-first discipline of the brand repo.

Five tests cover install, idempotent refresh with source change,
pkgdown wiring and re-run stability, the missing-config skip, and the
missing-source error. Full suite passes at 63.

Refs #109

Assisted-by: Claude claude-fable-5
…trial

bslib resolves the brand through the brand.yml package at site build
time; without it pkgdown::build_site() stops. Surfaced by the first
end-to-end run on a real data package.

Refs #109

Assisted-by: Claude claude-fable-5
@larnsce
larnsce merged commit 1668b66 into dev Aug 25, 2026
5 of 6 checks passed
@larnsce
larnsce deleted the 109-use-brand branch August 25, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant