Refactor and fix tables (#627)

# Changelog

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

## Changed

- Refactor tables to respect `indent_size = 1`.

## Fixed

- Tables with `<tr>` and `<td>` tags in wrong ending order.

Reviewed-on: https://codeberg.org/Codeberg/Documentation/pulls/627
Reviewed-by: Bastian Greshake Tzovaras <gedankenstuecke@noreply.codeberg.org>
Co-authored-by: Javier Pérez <walpo@noreply.codeberg.org>
Co-committed-by: Javier Pérez <walpo@noreply.codeberg.org>
This commit is contained in:
Javier Pérez 2025-06-16 22:57:17 +02:00 committed by Bastian Greshake Tzovaras
parent e405ae93ae
commit 875cb34bdc
12 changed files with 258 additions and 232 deletions

View file

@ -17,18 +17,18 @@ Codeberg is based on.
{% if entry.url == page.url %}
{%- if entry.children.length -%}
<table class="table">
<table class="table">
<thead>
<th> Find out more in this section: </th>
<th>Find out more in this section:</th>
</thead>
<tbody>
{%- for child in entry.children %}
<tr><td>
<a href="{{ child.url }}">{{ child.title }}</a>
</tr></td>
{%- endfor %}
{%- for child in entry.children %}
<tr>
<td><a href="{{ child.url }}">{{ child.title }}</a></td>
</tr>
{%- endfor %}
</tbody>
</table>
</table>
{% endif %}
{% endif %}
{%- endfor %}

View file

@ -40,18 +40,18 @@ See also:
{% if entry.url == page.url %}
{%- if entry.children.length -%}
<table class="table">
<table class="table">
<thead>
<th> Find out more in this section: </th>
<th>Find out more in this section:</th>
</thead>
<tbody>
{%- for child in entry.children %}
<tr><td>
<a href="{{ child.url }}">{{ child.title }}</a>
</tr></td>
{%- endfor %}
{%- for child in entry.children %}
<tr>
<td><a href="{{ child.url }}">{{ child.title }}</a></td>
</tr>
{%- endfor %}
</tbody>
</table>
</table>
{% endif %}
{% endif %}
{%- endfor %}

View file

@ -50,24 +50,37 @@ For all of the options it is important that the Pages server knows where to look
Depending on from where you want to serve your files, there is a naming scheme for the domain:
<table class="table">
<thead>
<th>Domain Scheme</th>
<th>Pages URL</th>
</thead>
<tbody>
<tr>
<td><code>username.codeberg.page</code></td>
<td>https://username.codeberg.page <br /> which will serve <code>codeberg.org/username/pages</code></td>
</tr>
<tr>
<td><code>reponame.username.codeberg.page</code></td>
<td>https://username.codeberg.page/reponame <br /> which will serve <code>codeberg.org/username/reponame</code></td>
</tr>
<tr>
<td><code>branchname.reponame.username.codeberg.page</code></td>
<td>https://username.codeberg.page/reponame/@branchname/<br /> which will serve <code>codeberg.org/username/reponame/src/branch/branchname</code></td>
</tr>
</tbody>
<thead>
<th>Domain Scheme</th>
<th>Pages URL</th>
</thead>
<tbody>
<tr>
<td>
<code>username.codeberg.page</code>
</td>
<td>
https://username.codeberg.page<br />which will serve <code>codeberg.org/username/pages</code>
</td>
</tr>
<tr>
<td>
<code>reponame.username.codeberg.page</code>
</td>
<td>
https://username.codeberg.page/reponame<br />which will serve <code>codeberg.org/username/reponame</code>
</td>
</tr>
<tr>
<td>
<code>branchname.reponame.username.codeberg.page</code>
</td>
<td>
https://username.codeberg.page/reponame/@branchname/<br />
which will serve <code>codeberg.org/username/reponame/src/branch/branchname</code>
</td>
</tr>
</tbody>
<table>
_We assume for the following description, that you want to serve your website with and without www in front.
@ -91,18 +104,23 @@ The easiest and recommended way is to just setup a CNAME record for your domain,
In the end, it should look like this:
<table class="table">
<thead>
<th>Domain</th>
<th>Type</th>
<th>Data</th>
</thead>
<tbody>
<tr>
<td>yourdomain.com</td><td>CNAME</td><td>reponame.username.codeberg.page</td>
</tr>
<tr>
<td>www.yourdomain.com</td><td>CNAME</td><td>reponame.username.codeberg.page</td>
</tr>
<thead>
<th>Domain</th>
<th>Type</th>
<th>Data</th>
</thead>
<tbody>
<tr>
<td>yourdomain.com</td>
<td>CNAME</td>
<td>reponame.username.codeberg.page</td>
</tr>
<tr>
<td>www.yourdomain.com</td>
<td>CNAME</td>
<td>reponame.username.codeberg.page</td>
</tr>
</tbody>
</table>
<br />
@ -130,21 +148,22 @@ If you cannot use a CNAME record to configure the target you can use this method
In the end it should look like this:
<table class="table">
<thead>
<th>Domain</th>
<th>Type</th>
<th>Data</th>
</thead>
<tbody>
<tr>
<td>yourdomain.com</td><td>ALIAS</td><td>codeberg.page</td>
</tr>
<tr>
<td>yourdomain.com</td><td>TXT</td><td>reponame.username.codeberg.page</td>
</tr>
<tr>
<td>www.yourdomain.com</td><td>CNAME</td><td>reponame.username.codeberg.page</td>
</tr>
<thead>
<th>Domain</th>
<th>Type</th>
<th>Data</th>
</thead>
<tbody>
<tr>
<td>yourdomain.com</td><td>ALIAS</td><td>codeberg.page</td>
</tr>
<tr>
<td>yourdomain.com</td><td>TXT</td><td>reponame.username.codeberg.page</td>
</tr>
<tr>
<td>www.yourdomain.com</td><td>CNAME</td><td>reponame.username.codeberg.page</td>
</tr>
</tbody>
</table>
### Option 3: A/AAAA record
@ -161,24 +180,33 @@ If your service provider does not support `ALIAS records` you can also use `A re
In the end, it should look like this:
<table class="table">
<thead>
<th>Domain</th>
<th>Type</th>
<th>Data</th>
</thead>
<tbody>
<tr>
<td>yourdomain.com</td><td>A</td><td>217.197.84.141</td>
</tr>
<tr>
<td>yourdomain.com</td><td>AAAA</td><td>2a0a:4580:103f:c0de::2</td>
</tr>
<tr>
<td>yourdomain.com</td><td>TXT</td><td>reponame.username.codeberg.page</td>
</tr>
<tr>
<td>www.yourdomain.com</td><td>CNAME</td><td>reponame.username.codeberg.page</td>
</tr>
<thead>
<th>Domain</th>
<th>Type</th>
<th>Data</th>
</thead>
<tbody>
<tr>
<td>yourdomain.com</td>
<td>A</td>
<td>217.197.84.141</td>
</tr>
<tr>
<td>yourdomain.com</td>
<td>AAAA</td>
<td>2a0a:4580:103f:c0de::2</td>
</tr>
<tr>
<td>yourdomain.com</td>
<td>TXT</td>
<td>reponame.username.codeberg.page</td>
</tr>
<tr>
<td>www.yourdomain.com</td>
<td>CNAME</td>
<td>reponame.username.codeberg.page</td>
</tr>
</tbody>
</table>
## Examples

View file

@ -14,18 +14,18 @@ These documentation pages contain information on how you can use [Codeberg Trans
{% if entry.url == page.url %}
{%- if entry.children.length -%}
<table class="table">
<table class="table">
<thead>
<th> Find out more in this section: </th>
<th>Find out more in this section:</th>
</thead>
<tbody>
{%- for child in entry.children %}
<tr><td>
<a href="{{ child.url }}">{{ child.title }}</a>
</tr></td>
{%- endfor %}
{%- for child in entry.children %}
<tr>
<td><a href="{{ child.url }}">{{ child.title }}</a></td>
</tr>
{%- endfor %}
</tbody>
</table>
</table>
{% endif %}
{% endif %}
{%- endfor %}

View file

@ -18,18 +18,18 @@ issue tracking and wikis on Codeberg.
{% if entry.url == page.url %}
{%- if entry.children.length -%}
<table class="table">
<table class="table">
<thead>
<th> Find out more in this section: </th>
<th>Find out more in this section:</th>
</thead>
<tbody>
{%- for child in entry.children %}
<tr><td>
<a href="{{ child.url }}">{{ child.title }}</a>
</tr></td>
{%- endfor %}
{%- for child in entry.children %}
<tr>
<td><a href="{{ child.url }}">{{ child.title }}</a></td>
</tr>
{%- endfor %}
</tbody>
</table>
</table>
{% endif %}
{% endif %}
{%- endfor %}

View file

@ -42,95 +42,93 @@ By default, the person who creates a repository is an **_Owner_**.
The table below gives an overview of what collaborators are allowed to do when granted each of these permission levels:
<table class="table">
<thead>
<tr>
<th> Task </th>
<th> Read </th>
<th> Write</th>
<th> Admin </th>
<th> Owner </th>
</tr>
</thead>
<tbody>
<tr>
<td> View, clone and pull repository </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
</tr>
<tr>
<td> Contribute pull requests </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
</tr>
<tr>
<td> Push to/update contributed pull requests </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
</tr>
<tr>
<td> Push directly to repository </td>
<td> <span style="color: red">{% fas_icon "times" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
</tr>
<tr>
<td> Merge pull requests </td>
<td> <span style="color: red">{% fas_icon "times" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
</tr>
<tr>
<td> Moderate/delete issues and comments </td>
<td> <span style="color: red">{% fas_icon "times" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
</tr>
<tr>
<td> Force-push/rewrite history (if enabled) </td>
<td> <span style="color: red">{% fas_icon "times" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
</tr>
<tr>
<td> Add/remove collaborators to repository </td>
<td> <span style="color: red">{% fas_icon "times" %}</span> </td>
<td> <span style="color: red">{% fas_icon "times" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
</tr>
<tr>
<td> Configure branch settings (protect/un-protect, enable force-push) </td>
<td> <span style="color: red">{% fas_icon "times" %}</span> </td>
<td> <span style="color: red">{% fas_icon "times" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<tr>
<td> Configure repository settings (enable wiki, issues, PRs, update profile) </td>
<td> <span style="color: red">{% fas_icon "times" %}</span> </td>
<td> <span style="color: red">{% fas_icon "times" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
</tr>
<tr>
<td>
Configure repository settings in the danger zone (transfer ownership, delete wiki data / repository, archive repository)
</td>
<td> <span style="color: red">{% fas_icon "times" %}</span> </td>
<td> <span style="color: red">{% fas_icon "times" %}</span> </td>
<td> <span style="color: red">{% fas_icon "times" %}</span> </td>
<td> <span style="color: green">{% fas_icon "check" %}</span> </td>
</tr>
</tbody>
<thead>
<tr>
<th>Task</th>
<th>Read</th>
<th>Write</th>
<th>Admin</th>
<th>Owner</th>
</tr>
</thead>
<tbody>
<tr>
<td>View, clone and pull repository</td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
</tr>
<tr>
<td>Contribute pull requests</td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
</tr>
<tr>
<td>Push to/update contributed pull requests</td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
</tr>
<tr>
<td>Push directly to repository</td>
<td><span style="color: red">{% fas_icon "times" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
</tr>
<tr>
<td>Merge pull requests </td>
<td><span style="color: red">{% fas_icon "times" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
</tr>
<tr>
<td>Moderate/delete issues and comments</td>
<td><span style="color: red">{% fas_icon "times" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
</tr>
<tr>
<td>Force-push/rewrite history (if enabled)</td>
<td><span style="color: red">{% fas_icon "times" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
</tr>
<tr>
<td>Add/remove collaborators to repository</td>
<td><span style="color: red">{% fas_icon "times" %}</span></td>
<td><span style="color: red">{% fas_icon "times" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
</tr>
<tr>
<td>Configure branch settings (protect/un-protect, enable force-push)</td>
<td><span style="color: red">{% fas_icon "times" %}</span></td>
<td><span style="color: red">{% fas_icon "times" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<tr>
<td>Configure repository settings (enable wiki, issues, PRs, update profile)</td>
<td><span style="color: red">{% fas_icon "times" %}</span></td>
<td><span style="color: red">{% fas_icon "times" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
</tr>
<tr>
<td>Configure repository settings in the danger zone (transfer ownership, delete wiki data / repository, archive repository)</td>
<td><span style="color: red">{% fas_icon "times" %}</span></td>
<td><span style="color: red">{% fas_icon "times" %}</span></td>
<td><span style="color: red">{% fas_icon "times" %}</span></td>
<td><span style="color: green">{% fas_icon "check" %}</span></td>
</tr>
</tbody>
</table>
## Teams

View file

@ -29,18 +29,18 @@ Welcome to Codeberg! 😊
{% if entry.url == page.url %}
{%- if entry.children.length -%}
<table class="table">
<table class="table">
<thead>
<th> Find out more in this section: </th>
<th>Find out more in this section:</th>
</thead>
<tbody>
{%- for child in entry.children %}
<tr><td>
<a href="{{ child.url }}">{{ child.title }}</a>
</tr></td>
{%- endfor %}
{%- for child in entry.children %}
<tr>
<td><a href="{{ child.url }}">{{ child.title }}</a></td>
</tr>
{%- endfor %}
</tbody>
</table>
</table>
{% endif %}
{% endif %}
{%- endfor %}

View file

@ -24,18 +24,18 @@ use (no need to provide credentials on every push).
{% if entry.url == page.url %}
{%- if entry.children.length -%}
<table class="table">
<table class="table">
<thead>
<th> Find out more in this section: </th>
<th>Find out more in this section:</th>
</thead>
<tbody>
{%- for child in entry.children %}
<tr><td>
<a href="{{ child.url }}">{{ child.title }}</a>
</tr></td>
{%- endfor %}
{%- for child in entry.children %}
<tr>
<td><a href="{{ child.url }}">{{ child.title }}</a></td>
</tr>
{%- endfor %}
</tbody>
</table>
</table>
{% endif %}
{% endif %}
{%- endfor %}

View file

@ -13,18 +13,18 @@ We're very happy you're considering to contribute to Codeberg Documentation!
{% if entry.url == page.url %}
{%- if entry.children.length -%}
<table class="table">
<table class="table">
<thead>
<th> Find out more in this section: </th>
<th>Find out more in this section:</th>
</thead>
<tbody>
{%- for child in entry.children %}
<tr><td>
<a href="{{ child.url }}">{{ child.title }}</a>
</tr></td>
{%- endfor %}
{%- for child in entry.children %}
<tr>
<td><a href="{{ child.url }}">{{ child.title }}</a></td>
</tr>
{%- endfor %}
</tbody>
</table>
</table>
{% endif %}
{% endif %}
{%- endfor %}

View file

@ -18,18 +18,18 @@ solutions should work with our Forgejo instance, too.
{% if entry.url == page.url %}
{%- if entry.children.length -%}
<table class="table">
<table class="table">
<thead>
<th> Find out more in this section: </th>
<th>Find out more in this section:</th>
</thead>
<tbody>
{%- for child in entry.children %}
<tr><td>
<a href="{{ child.url }}">{{ child.title }}</a>
</tr></td>
{%- endfor %}
{%- for child in entry.children %}
<tr>
<td><a href="{{ child.url }}">{{ child.title }}</a></td>
</tr>
{%- endfor %}
</tbody>
</table>
</table>
{% endif %}
{% endif %}
{%- endfor %}

View file

@ -28,18 +28,18 @@ look them up and learn more about Markdown.
{% if entry.url == page.url %}
{%- if entry.children.length -%}
<table class="table">
<table class="table">
<thead>
<th> Find out more in this section: </th>
<th>Find out more in this section:</th>
</thead>
<tbody>
{%- for child in entry.children %}
<tr><td>
<a href="{{ child.url }}">{{ child.title }}</a>
</tr></td>
{%- endfor %}
{%- for child in entry.children %}
<tr>
<td><a href="{{ child.url }}">{{ child.title }}</a></td>
</tr>
{%- endfor %}
</tbody>
</table>
</table>
{% endif %}
{% endif %}
{%- endfor %}

View file

@ -13,18 +13,18 @@ This section contains information on how to securely use Codeberg.
{% if entry.url == page.url %}
{%- if entry.children.length -%}
<table class="table">
<table class="table">
<thead>
<th> Find out more in this section: </th>
<th>Find out more in this section:</th>
</thead>
<tbody>
{%- for child in entry.children %}
<tr><td>
<a href="{{ child.url }}">{{ child.title }}</a>
</tr></td>
{%- endfor %}
{%- for child in entry.children %}
<tr>
<td><a href="{{ child.url }}">{{ child.title }}</a></td>
</tr>
{%- endfor %}
</tbody>
</table>
</table>
{% endif %}
{% endif %}
{%- endfor %}