Add grebedoc docs hosting and client-side redirect #21

Closed
opened 2026-07-07 20:59:23 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-07-07 20:59:23 +00:00 (Migrated from codeberg.org)

Longwei's docs are currently only served from Codeberg Pages (marvinsmastodontools.codeberg.page/longwei/). This issue tracks adding grebedoc as a second hosting target and redirecting old URLs to the new address.

Scope:

  • Update mkdocs.yml to set site_url: https://longwei.marvin8.zone
  • Add docs/javascripts/redirect.js that redirects visitors from marvinsmastodontools.codeberg.page to longwei.marvin8.zone
  • Wire the git-pages/action@v2 upload step into the deploy-docs job in ci.yml (done as part of issue #20's CI migration)
Longwei's docs are currently only served from Codeberg Pages (`marvinsmastodontools.codeberg.page/longwei/`). This issue tracks adding grebedoc as a second hosting target and redirecting old URLs to the new address. Scope: - Update `mkdocs.yml` to set `site_url: https://longwei.marvin8.zone` - Add `docs/javascripts/redirect.js` that redirects visitors from `marvinsmastodontools.codeberg.page` to `longwei.marvin8.zone` - Wire the `git-pages/action@v2` upload step into the `deploy-docs` job in `ci.yml` (done as part of issue #20's CI migration)
coding-agent-marvin8 commented 2026-07-07 21:00:26 +00:00 (Migrated from codeberg.org)

Findings:

Current mkdocs.yml has site_url: https://marvinsmastodontools.codeberg.page/longwei/. No extra_javascript section exists yet.

Old Codeberg Pages hostname: marvinsmastodontools.codeberg.page. Path prefix to strip: /longwei.

zaojun template for docs/javascripts/redirect.js:

(function () {
    if (window.location.hostname === 'marvin8.codeberg.page') {
        var path = window.location.pathname.replace(/^\/zaojun/, '');
        window.location.replace(
            'https://zaojun.marvin8.zone' + path + window.location.search + window.location.hash
        );
    }
}());

The grebedoc upload step (git-pages/action@v2) is wired into deploy-docs in ci.yml (part of issue #20).

Plan:

  1. Create docs/javascripts/redirect.js adapting the zaojun template for longwei's hostname and path prefix.
  2. Update mkdocs.yml: set site_url: https://longwei.marvin8.zone, add extra_javascript: - javascripts/redirect.js.
**Findings:** Current `mkdocs.yml` has `site_url: https://marvinsmastodontools.codeberg.page/longwei/`. No `extra_javascript` section exists yet. Old Codeberg Pages hostname: `marvinsmastodontools.codeberg.page`. Path prefix to strip: `/longwei`. zaojun template for `docs/javascripts/redirect.js`: ```js (function () { if (window.location.hostname === 'marvin8.codeberg.page') { var path = window.location.pathname.replace(/^\/zaojun/, ''); window.location.replace( 'https://zaojun.marvin8.zone' + path + window.location.search + window.location.hash ); } }()); ``` The grebedoc upload step (`git-pages/action@v2`) is wired into `deploy-docs` in `ci.yml` (part of issue #20). **Plan:** 1. Create `docs/javascripts/redirect.js` adapting the zaojun template for longwei's hostname and path prefix. 2. Update `mkdocs.yml`: set `site_url: https://longwei.marvin8.zone`, add `extra_javascript: - javascripts/redirect.js`.
Sign in to join this conversation.
No milestone
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.

Reference
marvin8/longwei#21
No description provided.