Shared design system for omeka.net. Two sites consume it:
| Site | Repo | Stack |
|---|---|---|
www.omeka.net |
omeka/Omeka.net | Zend Framework 1 (Omeka Classic MU layer) |
info.omeka.net |
omeka/omeka-net-hugo | Hugo |
Design tokens, base styles, and components that appear on more than one site — the header, footer, alert banner, buttons, flash messages, the hosting panel.
What does not belong here: styles for a single page. Those stay in the project
that owns the page (application/mu/views/scripts/scss/pages/ in the app,
assets/scss/pages/ in the Hugo site). Without that rule this repo slowly becomes
everyone's CSS, and every change starts risking both sites.
If the Hugo site needs a component the app already has, promote it deliberately:
move the partial here, update both main.scss files, tag a release.
scss/
abstracts/ _variables (tokens), _mixins
base/ _reset, _typography, _layout
components/ _buttons, _alert-banner, _post-header, _site-header,
_site-footer, _floating-button, _notices, _forms
js/ site-header.js — nav toggle, hover pill, hosting panel, scroll behavior
assets/ logo + hosting icon (the only two images the shared layer needs)
data/ navigation.json — the header/footer link lists, read by both sites
preview/ standalone component gallery
git clone https://github.com/omeka/omeka-net-ui.git
cd omeka-net-ui
npm install
npm run dev # sass --watch
open preview/index.htmlpreview/index.html renders every shared component — tokens, type scale, button
variants, form fields, flash messages, and the live header and footer — compiled
from scss/ in the same order the real sites load it. You do not need PHP, MySQL, Lando, or
Hugo to work on the shared layer. Reload the page after each save.
The header and footer markup in preview/index.html is the reference
implementation. See "The markup seam" below.
Both sites depend on a tag, pinned in their lockfile:
npm install -D "@omeka/ui@github:omeka/omeka-net-ui#v1.0.0"Hugo — mount it, then @use from main.scss:
# hugo.toml — declaring any assets mount replaces the default, so keep both
[[module.mounts]]
source = "assets"
target = "assets"
[[module.mounts]]
source = "node_modules/@omeka/ui/scss"
target = "assets/scss/shared"Use module.mounts, not the includePaths option of css.Sass. Both compile,
but only mounted files are watched — with includePaths, hugo server never
rebuilds when a shared partial changes.
The Zend app — resolve via node_modules on the Sass load path:
sass --load-path=node_modules application/mu/views/scripts/scss/main.scss ...
npm link rather than npm install file:../omeka-net-ui: the file: form writes
that local path into package.json, which breaks every other machine if committed.
npm link produces the same symlink and leaves package.json alone, so the
committed dependency stays a pinned tag.
cd omeka-net-ui && npm link
cd ../omeka-net-hugo && npm link @omeka/ui
cd ../omeka.net/dev && npm link @omeka/uiTwo behaviors worth knowing, both verified against Hugo 0.165 and Dart Sass 1.103:
- Hugo picks up linked edits.
hugo serverwatches through the npm symlink and live-reloads when you edit a partial in this repo. sass --watchdoes not. The app'snpm run watch:csswill not notice changes undernode_modules. One-shot builds resolve correctly, so after editing shared styles runnpm run build:cssin the app. Itsmain.cssis committed, so it also needs rebuilding and committing.
In practice: use the Hugo server as the live feedback loop, or npm run dev here
with the gallery.
- Commit here, update
CHANGELOG.md, bumpversioninpackage.json. - Tag:
git tag v1.1.0 && git push --tags. - Bump each consumer when you want it to move:
npm install -D "@omeka/ui@github:omeka/omeka-net-ui#v1.1.0".
Consumers pin, so merging here cannot move either production site on its own. The two sites can sit on different versions deliberately.
Zend .phtml partials and Hugo Go templates cannot share templates, so the header
and footer markup exists three times: here in preview/index.html, in the app's
header.phtml/footer.phtml, and in the Hugo site's layouts/partials/.
What changes most — the link lists — is centralized in data/navigation.json, read
by both sites, so a nav or footer link change is one edit here. Structural markup
changes have to be made in all three places. Keep the class names identical; that is
what lets one stylesheet cover both.
Inherits the license of the Omeka.net application. Add a LICENSE file here to
match it before this repo is made public.