Documentation/content/codeberg-pages/index.md
Javier Pérez 941914f698 Fix lint issues (#629)
# Changelog

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## Fixed

- Lint issues:
  - Line length ([MD013](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md013.md)).
  -  Heading levels should only increment by one level at a time ([MD001](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md001.md)).
  - Link fragments should be valid ([MD051](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md051.md)).
---

Reviewed-on: https://codeberg.org/Codeberg/Documentation/pulls/629
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Javier Pérez <walpo@noreply.codeberg.org>
Co-committed-by: Javier Pérez <walpo@noreply.codeberg.org>
2025-11-21 12:35:05 +01:00

4 KiB

eleventyNavigation
key title icon order
CodebergPages Codeberg Pages server 60

{% admonition "Warning" %}

Codeberg Pages is currently provided with a best effort approach. To be exact, the software behind this feature is currently in maintenance mode.

Please do not rely on it for critical websites, as we can't guarantee high availability like some other providers do.

{% endadmonition %}

Codeberg Pages allows you to easily publish static websites with a human-friendly address ({username}.codeberg.page) via Git on Codeberg.

Follow these simple steps below to get started, or check out the advanced usage below.

  1. Create a public repository named 'pages' in your user account or organization.
  2. Create static content, HTML, stylesheets, fonts or images. Name the homepage file index.html.
  3. Push your content to the default branch of the new repository.
  4. You should now be able to access your content by visiting {username}.codeberg.page.

This project is developed "in-house" by Codeberg. You can find the source code in our repository.

See also:

{% assign navPages = collections.all | eleventyNavigation %} {%- for entry in navPages %} {% if entry.url == page.url %} {%- if entry.children.length -%}

{%- for child in entry.children %} {%- endfor %}
Find out more in this section:
{{ child.title }}
{% endif %} {% endif %} {%- endfor %}

Advanced Usage: Canonical URLs

The Codeberg Pages server responds to four different URLs:

  • https://raw.codeberg.page/username/reponame/: raw content, uses correct MIME types (HTML is forbidden though) and is accessible with CORS.
  • https://username.codeberg.page: user page, points the default branch of a user's or organization's pages repository
  • https://username.codeberg.page/reponame/: repo page, points to the pages branch of the repository
  • https://example.org: custom domain, points to a repo of choice as outlined below

In all cases, you can append a branch using an @ (e.g. https://username.codeberg.page/@develop/README.md). If the branch name contains a slash (/), they need to be replaced with a tilde (~) (e.g. the branch docs/develop can be accessed via https://username.codeberg.page/@docs~develop/README.md).

Advanced Usage: Custom error page for 404s

You can replace the default 404 error page that Codeberg Pages will show for missing pages with your own version if you prefer. To do so start by writing your own HTML file that you want to serve instead.

After creating the HTML with your custom error message, save it as 404.html in the root of your repository that you use to serve your Codeberg Page.

From then on, your 404.html file will be served when the error is encountered.

Do you have questions, feedback or have you found a bug?

The source code for Codeberg Pages is maintained over at the Pages Server repository; feel free to head there to provide some feedback, suggestions, bug reports or even patches. If you need general community support or have questions, Codeberg/Community is a better place to ask, as more people will be watching there to help you out! We really appreciate your contribution.

Installing Pages for your own Forgejo instance

Codeberg Pages works with any Forgejo host out there. So if you are running your own Forgejo, you can absolutely run it yourself and help with the development. Check out the Pages Server repository for more information.