reorganize workspace directory #53

Merged
claudiomaradonna merged 6 commits from chore/reorganize-src into master 2026-04-27 22:57:28 +02:00
Collaborator
No description provided.
- package.json (empty {}) and package-lock.json (no real packages):
  terser is installed globally via npm install -g in both Dockerfile
  and .devcontainer/Dockerfile; the Makefile uses npx terser which
  resolves the global binary, so these files have no consumer.
- .dir-locals.el: empty file (0 bytes), Emacs placeholder with no effect.
- .ignore: contains only "_site", redundant with .gitignore which already
  excludes _site/. Both ripgrep and silver_searcher honor .gitignore.
Group the project's only build-time helper script under a dedicated
scripts/ directory, separating it from Jekyll source and root config.

- git mv tag-generator.py scripts/tag-generator.py
- Makefile: tag-pages target now invokes scripts/tag-generator.py
- Dockerfile: same path update in the builder stage
- _config.yml: replace "tag-generator.py" with "scripts" in exclude list,
  so Jekyll skips the whole scripts/ directory rather than that one file

Internal paths inside the script (_pages/, tag/) stay CWD-relative; both
the Makefile and Dockerfile invoke the script from the repo root, so the
relative paths still resolve.
Separate site source from build/repo metadata by moving every Jekyll
source root, static site asset, and the .well-known directory into a
dedicated src/ subdirectory, set as Jekyll's source via _config.yml.

Layout changes:
- All underscore dirs (_pages, _layouts, _includes, _sass, _i18n,
  _assets, assets) plus webfonts/ and .well-known/ moved into src/.
- Static root files (index.html, 404.html, favicon.ico, apple-touch-icon.png,
  icon-{192,512}.png, logo.png, path.webmanifest, robots.txt, search.json,
  rss.opml, info_at_unitoo_dot_it.gpg) moved into src/.
- Generated tag/ removed from git and moved into the gitignored src/tag/;
  tag-generator.py rebuilds it on every build (already a dependency of
  `make build` and run in the Dockerfile).

Config updates:
- _config.yml: add `source: src`. Drop most exclude entries (README.md,
  Gemfile*, Makefile, Dockerfile, CLAUDE.md, .devcontainer, .forgejo,
  node_modules, vendor, scripts) since they now live outside the source
  dir and Jekyll naturally ignores them. Keep "_assets/javascripts" since
  it lives under src/. Keep `include: [".well-known"]` since it's still
  a dotted dir at the source root.
- Makefile: prefix all build paths with src/ (JS_SOURCES, LOGO_*, terser
  output, matomo copy). Add src/tag to the clean target.
- .gitignore: prefix build outputs with src/, add src/tag/.
- scripts/tag-generator.py: read from src/_pages/, write to src/tag/.

URL contract preserved: /favicon.ico, /path.webmanifest, /icon-*.png,
/logo.png, /info_at_unitoo_dot_it.gpg, /webfonts/*, /.well-known/matrix/*,
sitemap.xml, /tag/* and i18n routes (/it/*, /en/*) all serve unchanged.

Build diff verified: structurally identical _site/, only differences are
the cache-busting query string (?v={{ site.time }}) on main.css/main.js
links, which changes on every build by design. Binary assets, generated
CSS/JS, and .well-known are byte-identical to the pre-move build.

Side cleanup: stop publishing dev metadata (COPYING, package*.json) that
Jekyll was implicitly copying into _site because they sat in the source
root with no exclude entry.
Update developer-facing docs to match the new repository layout.

README.md:
- Contributor instructions point to src/_pages/, src/_i18n/, src/tag/
- Add a one-liner pointing readers at src/ as the Jekyll source root

CLAUDE.md:
- New "Repository layout" paragraph in the Overview section spelling out
  what lives under src/ (Jekyll source + static site root files), what
  stays at the repo root (build/repo metadata), and where helper scripts
  and generated output live
- Common commands: assets-js / tag-pages descriptions reference the new
  src/assets/main.js, src/tag/, scripts/tag-generator.py paths
- Architecture: every reference to _pages/, _layouts/, _includes/, _sass/,
  _i18n/, assets/, _assets/images/ now reads as src/_pages/, src/_layouts/, etc.
- Tag system paragraph notes that src/tag/ is gitignored and rebuilt on
  every build, and points to scripts/tag-generator.py
- Deploy paragraph references scripts/tag-generator.py
- "Excluded from build" rewritten: most former exclude entries are now
  outside src/ and ignored implicitly; only _assets/javascripts is still
  explicitly excluded inside the source dir
The Matrix federation tester (federationtester.matrix.org) requires
/.well-known/matrix/server and /.well-known/matrix/client to be served
with Content-Type: application/json. static-web-server, lacking a custom
config, served these extension-less files as application/octet-stream,
which made the federation check fail.

Add sws.toml with a [advanced.headers] rule that pins Content-Type:
application/json on both files, plus Access-Control-Allow-Origin: *
on the client well-known (recommended by the Matrix spec so browser
clients can fetch it cross-origin).

Wire it in via the runtime stage of the Dockerfile:
- COPY sws.toml /home/sws/sws.toml
- CMD ["-w", "/home/sws/sws.toml"]

The general section pins root=./public (relative to /home/sws WORKDIR),
host=::, port=80 — matching the SWS image defaults — plus compression
and cache-control-headers, which were implicitly on by default and
are kept explicit for visibility.

JSON content of the two well-known files is unchanged.
claudiomaradonna deleted branch chore/reorganize-src 2026-04-27 22:57:42 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
unitoo/website!53
No description provided.