diff --git a/content/codeberg-pages/advanced-usage.md b/content/codeberg-pages/advanced-usage.md index 51c9682..461a1dd 100644 --- a/content/codeberg-pages/advanced-usage.md +++ b/content/codeberg-pages/advanced-usage.md @@ -5,6 +5,7 @@ eleventyNavigation: parent: CodebergPages order: 999 --- + ## 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. diff --git a/content/codeberg-pages/forgejo-actions.md b/content/codeberg-pages/forgejo-actions.md index 8be884c..b93f4ef 100644 --- a/content/codeberg-pages/forgejo-actions.md +++ b/content/codeberg-pages/forgejo-actions.md @@ -5,6 +5,7 @@ eleventyNavigation: parent: CodebergPages order: 100 --- + {% admonition "Warning" %} The following instructions depend on the new git-pages server for Codeberg Pages and can currently only be used on sites which are hosted under our `codeberg.page` domain, and not with sites that should be served from custom domains. @@ -25,7 +26,7 @@ To use it, simply add it as a final step to your workflow: ```yaml - uses: https://codeberg.org/git-pages/action@v2 with: - site: "https://${{ forge.repository_owner }}.codeberg.page/repository-name/" + site: 'https://${{ forge.repository_owner }}.codeberg.page/repository-name/' token: ${{ forge.token }} source: _site/ ``` @@ -36,7 +37,7 @@ Replace `repository-name` in the `site` parameter with the name of your reposito If your repository is also called `pages`, you can also omit the repository name and deploy directly to the site `https://username.codeberg.page/`. The `source` parameter should point to the directory (relative to the root, after all previous steps in your workflow) where your site generator has put the generated version of your site. -This directory can also contain the `404.html` and `_redirects` files to customize your site’s behaviour, as described in the [advanced documentation](/codeberg-pages/advanced-usage/). +This directory can also contain the `404.html` and `_redirects` files to customize your site’s behavior, as described in the [advanced documentation](/codeberg-pages/advanced-usage/). The `token` will automatically be filled by Forgejo Actions with a secret token, which in turn will automatically be recognized by git-pages as authorizing this workflow to publish to this site. @@ -57,4 +58,3 @@ if: ${{ forge.ref == 'refs/heads/main'}} This will limit deploys so they only happen when CI is triggered by a push to the `main` branch. {% endadmonition %} - diff --git a/content/codeberg-pages/index.md b/content/codeberg-pages/index.md index 34a59a4..33f5df3 100644 --- a/content/codeberg-pages/index.md +++ b/content/codeberg-pages/index.md @@ -49,7 +49,7 @@ This page documents the first method. See the [separate page on using Forgejo Ac 1. Create a repository called `pages` under your own username or under the organization you want to create a website for - The website will be published from a branch also called `pages`. You can also set this as the default branch, if you prefer. + The website will be published from a branch also called `pages`. You can also set this as the default branch, if you prefer. 2. Go to **Settings** at the top right of your repository page. @@ -57,7 +57,7 @@ This page documents the first method. See the [separate page on using Forgejo Ac 4. Click the **Add webhook** button in the top right corner of the webhook settings page. - Select **Forgejo** from the drop-down list of webhook types. + Select **Forgejo** from the drop-down list of webhook types. 5. Enter `https://username.codeberg.page/` as the **Target URL**, replacing the `username` with your Codeberg username or organization name. This is the URL your website will be available from. @@ -75,7 +75,7 @@ This page documents the first method. See the [separate page on using Forgejo Ac 3. Click the **Add webhook** button in the top right corner of the webhook settings page. - Select **Forgejo** from the drop-down list of webhook types. + Select **Forgejo** from the drop-down list of webhook types. 4. Enter `https://username.codeberg.page/repository-name/` as the **Target URL**, replacing the `username` with your Codeberg username or organization name, and `repository-name` with the name of your repository. This is the URL your website will be available from. diff --git a/content/codeberg-pages/migrating-from-pages-v2.md b/content/codeberg-pages/migrating-from-pages-v2.md index abe4bc7..03fa9b6 100644 --- a/content/codeberg-pages/migrating-from-pages-v2.md +++ b/content/codeberg-pages/migrating-from-pages-v2.md @@ -5,6 +5,7 @@ eleventyNavigation: parent: CodebergPages order: 120 --- + {% admonition "Warning" %} Codeberg Pages is currently migrating from the legacy v2 codebase to the newer [git-pages](https://git-pages.org/) codebase. @@ -27,10 +28,10 @@ It improves performance and stability, and fixes various design issues from the Please be aware of the following changes and deprecated features. -* The recommended way to deploy websites is by directly uploading them to git-pages. -* Content is no longer fetched automatically. You need to use a method that informs git-pages about changes. -* `raw.codeberg.page` is no longer available. CORS headers are now directly set on your page and this workaround is no longer necessary. -* Direct access to repos and branches is no longer possible. You can no longer use the `/repository/@branch` access. `git-pages` restricts you to the website you explicitly deployed. Serving arbitrary resources from Codeberg was a common abuse vector and is going to be deprecated. +- The recommended way to deploy websites is by directly uploading them to git-pages. +- Content is no longer fetched automatically. You need to use a method that informs git-pages about changes. +- `raw.codeberg.page` is no longer available. CORS headers are now directly set on your page and this workaround is no longer necessary. +- Direct access to repos and branches is no longer possible. You can no longer use the `/repository/@branch` access. `git-pages` restricts you to the website you explicitly deployed. Serving arbitrary resources from Codeberg was a common abuse vector and is going to be deprecated. ## The first push @@ -66,11 +67,11 @@ To do this: 3. Click the **Add webhook** button in the top right corner of the webhook settings page. - Select **Forgejo** from the drop-down list of webhook types. + Select **Forgejo** from the drop-down list of webhook types. 4. Enter `https://username.codeberg.page/repository-name/` as the **Target URL**, replacing the `username` with your Codeberg username or organization name, and `repository-name` with the name of your repository. This is the URL your website will be available from. - If your repository *and* your branch are both called `pages`, you can omit the `repository-name` and just push to `https://username.codeberg.page/` directly. + If your repository _and_ your branch are both called `pages`, you can omit the `repository-name` and just push to `https://username.codeberg.page/` directly. 5. Set the **Branch filter** to `pages`. diff --git a/content/codeberg-pages/pushing-output.md b/content/codeberg-pages/pushing-output.md index 009f55c..d4b2ee7 100644 --- a/content/codeberg-pages/pushing-output.md +++ b/content/codeberg-pages/pushing-output.md @@ -6,6 +6,7 @@ eleventyNavigation: author: Fayçal Alami Hassani - https://codeberg.org/ka2in order: 110 --- + {% admonition "Warning" %} Codeberg Pages is currently migrating from the legacy v2 codebase to the newer [git-pages](https://git-pages.org/) codebase. @@ -36,7 +37,6 @@ To begin with, we will have two separate repositories, both locally and on Codeb - A main repository for the source files, i.e. where the source files related to your main project will be located. We will refer to this repository as the `source` repository. - This repository is the one associated with your [mydocs](/codeberg-pages/examples/docs-as-code/#mydocs) folder. - A second repository for Codeberg pages that we will call the `pages` repository. This repository will only contain the files available in the `html` folder located under docs/build/html. diff --git a/content/codeberg-pages/using-custom-domain.md b/content/codeberg-pages/using-custom-domain.md index d036907..98b464e 100644 --- a/content/codeberg-pages/using-custom-domain.md +++ b/content/codeberg-pages/using-custom-domain.md @@ -5,6 +5,7 @@ eleventyNavigation: parent: CodebergPages order: 10 --- + {% admonition "Warning" %} Codeberg Pages is currently migrating from the legacy v2 codebase to the newer [git-pages](https://git-pages.org/) codebase. diff --git a/eleventy.config.mjs b/eleventy.config.mjs index b7b3fe3..694b0db 100644 --- a/eleventy.config.mjs +++ b/eleventy.config.mjs @@ -87,13 +87,13 @@ export default function (eleventyConfig) { const navFilter = eleventyConfig.getFilter('eleventyNavigation'); // from the nav tree, find the current page's entry - const entry = navFilter(collections.all).find(page => page.url == this.page.url); + const entry = navFilter(collections.all).find((page) => page.url == this.page.url); // if the current page has children, create a nav table with a link for each if (entry.children.length) { - const rows = entry.children.map(child => - `${ child.title }` - ).join(''); + const rows = entry.children + .map((child) => `${child.title}`) + .join(''); return `