Skip to content

Add Codeberg as a code platform option#121

Merged
egrace479 merged 11 commits into
devfrom
feat/codeberg
Jul 10, 2026
Merged

Add Codeberg as a code platform option#121
egrace479 merged 11 commits into
devfrom
feat/codeberg

Conversation

@egrace479

@egrace479 egrace479 commented Jul 9, 2026

Copy link
Copy Markdown
Member

This PR introduces the option to use Codeberg repositories, instead of GitHub repos. Specifically, defining PLATFORM: codeberg uses the Codeberg API for all code platform-based calls so that the catalog is expected to be run from a Codeberg repo. I did include a note in the personalization documentation regarding the fetch release and tag export scripts, as well as the workflows (they would need some platform-specific edits).

I set platform configs at the top of the code fetch file which will facilitate the addition of GitLab as well (see table in #96). Additionally, I switched to using SVGs for the platform logos due to the complexity required for the Codeberg logo.

Only one code platform can be used at a time.

Tested on the Forgejo Codeberg Organization by replacing the following keys in public/config.yaml:

ORGANIZATION_NAME: forgejo
...
# Branding
CATALOG_TITLE: Fake Forgejo Catalog
...
# Codebase platform for API calls and link generation. Supported values: "github" or "codeberg", pending: "gitlab".
PLATFORM: codeberg
...
# Array of "owner/repo" strings to include in addition to non-forked org repos.
# Use this for forked repos within the org and repos outside the org entirely.
ADDITIONAL_REPOS: []

Note: the ADDITIONAL_REPOS key was set to an empty list, since it fetches listed repos based on PLATFORM API.

fake-Forgejo-catalog

@egrace479 egrace479 added the enhancement New feature or request label Jul 9, 2026
@egrace479 egrace479 requested a review from Copilot July 9, 2026 16:57

This comment was marked as outdated.

egrace479 added 2 commits July 9, 2026 17:06
Add profile repo key, Codeberg uses .profile like GitHub has .github

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.

Comment thread src/api/fetchCodeRepos.js
Comment thread index.html Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

src/validateConfig.js:42

  • The platform validation comment says PLATFORM is parsed “without whitespace”, but the check does not trim. A config like PLATFORM: "codeberg " (common copy/paste issue) will be rejected even though the code uses toLowerCase() elsewhere. Trimming here makes validation match the comment and prevents surprising config errors.
    const supportedPlatforms = ['github', 'codeberg'];
    const platform = config.PLATFORM;
    if (!platform || typeof platform !== 'string') {
        errors.push('PLATFORM');
    } else if (!supportedPlatforms.includes(platform.toLowerCase())) {

Comment thread src/api/fetchCodeRepos.js
Comment thread src/utils/defineRibbonVals.js
Comment thread src/api/fetchCodeRepos.js

@hlapp hlapp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See two minor inline edit suggestions.

Comment thread docs/personalization.md Outdated
Comment thread docs/personalization.md Outdated
Co-authored-by: Hilmar Lapp <hlapp@drycafe.net>
@egrace479 egrace479 merged commit 44bad34 into dev Jul 10, 2026
1 check passed
@egrace479 egrace479 deleted the feat/codeberg branch July 10, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants