Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure documentation. Now the documentation has installation, administration, usage, development, contributing the 5 main parts #23629

Merged
merged 10 commits into from
Mar 23, 2023
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ ifeq ($(RACE_ENABLED),true)
endif

STORED_VERSION_FILE := VERSION
HUGO_VERSION ?= 0.111.3

ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
Expand Down Expand Up @@ -817,7 +818,7 @@ release-docs: | $(DIST_DIRS) docs
.PHONY: docs
docs:
@hash hugo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
curl -sL https://github.com/gohugoio/hugo/releases/download/v0.74.3/hugo_0.74.3_Linux-64bit.tar.gz | tar zxf - -C /tmp && mv /tmp/hugo /usr/bin/hugo && chmod +x /usr/bin/hugo; \
curl -sL https://github.com/gohugoio/hugo/releases/download/v$(HUGO_VERSION)/hugo_$(HUGO_VERSION)_Linux-64bit.tar.gz | tar zxf - -C /tmp && mv /tmp/hugo /usr/bin/hugo && chmod +x /usr/bin/hugo; \
Copy link
Member

Choose a reason for hiding this comment

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

This will break Gitpod. It's fine, I guess I will fix it after this is merged

Copy link
Member

Choose a reason for hiding this comment

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

Actually, this variable isn't used anywhere else so I'd rather just keeping the version hardcoded here

Copy link
Member Author

Choose a reason for hiding this comment

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

Since I have changed that and if it's equal. Maybe just leave it.

fi
cd docs; make trans-copy clean build-offline;

Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
lunny marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ THEME := themes/gitea
PUBLIC := public
ARCHIVE := https://dl.gitea.com/theme/main.tar.gz

HUGO_PACKAGE := github.com/gohugoio/hugo@v0.82.0
HUGO_PACKAGE := github.com/gohugoio/hugo@v0.111.3

.PHONY: all
all: build
Expand Down
5 changes: 5 additions & 0 deletions docs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ params:
repo: "https://github.com/go-gitea/gitea"
docContentPath: "docs/content"

markup:
tableOfContents:
startLevel: 1
endLevel: 9

outputs:
home:
- HTML
Expand Down
14 changes: 14 additions & 0 deletions docs/content/doc/administration.en-us.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
date: "2016-12-01T16:00:00+02:00"
title: "Administration"
slug: "administration"
weight: 30
toc: false
draft: false
menu:
sidebar:
name: "Administration"
weight: 20
collapse: true
identifier: "administration"
---
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
date: "2017-08-23T09:00:00+02:00"
title: "Avancé"
slug: "advanced"
slug: "administration"
weight: 30
toc: false
draft: false
menu:
sidebar:
name: "Avancé"
weight: 40
identifier: "advanced"
weight: 20
identifier: "administration"
---
13 changes: 13 additions & 0 deletions docs/content/doc/administration.zh-cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
date: "2016-12-01T16:00:00+02:00"
title: "运维"
slug: "administration"
weight: 30
toc: false
draft: false
menu:
sidebar:
name: "运维"
weight: 20
identifier: "administration"
---
13 changes: 13 additions & 0 deletions docs/content/doc/administration.zh-tw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
date: "2016-12-01T16:00:00+02:00"
title: "運維"
slug: "administration"
weight: 30
toc: false
draft: false
menu:
sidebar:
name: "運維"
weight: 20
identifier: "administration"
---
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ toc: false
draft: false
menu:
sidebar:
parent: "advanced"
parent: "administration"
name: "Adding Legal Pages"
identifier: "adding-legal-pages"
weight: 9
weight: 110
---

Some jurisdictions (such as EU), requires certain legal pages (e.g. Privacy Policy) to be added to website. Follow these steps to add them to your Gitea instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toc: false
draft: false
menu:
sidebar:
parent: "usage"
parent: "administration"
name: "Backup and Restore"
weight: 11
identifier: "backup-and-restore"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toc: false
draft: false
menu:
sidebar:
parent: "usage"
parent: "administration"
name: "备份与恢复"
weight: 11
identifier: "backup-and-restore"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toc: false
draft: false
menu:
sidebar:
parent: "usage"
parent: "administration"
name: "備份與還原"
weight: 11
identifier: "backup-and-restore"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ toc: false
draft: false
menu:
sidebar:
parent: "advanced"
parent: "administration"
name: "Embedded data extraction tool"
weight: 40
weight: 20
identifier: "cmd-embedded"
---

Expand All @@ -21,7 +21,7 @@ menu:

Gitea's executable contains all the resources required to run: templates, images, style-sheets
and translations. Any of them can be overridden by placing a replacement in a matching path
inside the `custom` directory (see [Customizing Gitea]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}})).
inside the `custom` directory (see [Customizing Gitea]({{< relref "doc/administration/customizing-gitea.en-us.md" >}})).

To obtain a copy of the embedded resources ready for editing, the `embedded` command from the CLI
can be used from the OS shell interface.
Expand Down Expand Up @@ -85,7 +85,7 @@ The default is the current directory.
The `--custom` flag tells Gitea to extract the files directly into the `custom` directory.
For this to work, the command needs to know the location of the `app.ini` configuration
file (`--config`) and, depending of the configuration, be ran from the directory where
Gitea normally starts. See [Customizing Gitea]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}}) for details.
Gitea normally starts. See [Customizing Gitea]({{< relref "doc/administration/customizing-gitea.en-us.md" >}}) for details.

The `--overwrite` flag allows any existing files in the destination directory to be overwritten.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ toc: false
draft: false
menu:
sidebar:
parent: "usage"
parent: "administration"
name: "Command Line"
weight: 10
weight: 1
identifier: "command-line"
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ toc: false
draft: false
menu:
sidebar:
parent: "advanced"
parent: "administration"
name: "Config Cheat Sheet"
weight: 20
weight: 30
identifier: "config-cheat-sheet"
---

Expand Down Expand Up @@ -753,7 +753,7 @@ and
- `FORCE_TRUST_SERVER_CERT`: **false**: If set to `true`, completely ignores server certificate validation errors. This option is unsafe. Consider adding the certificate to the system trust store instead.
- `USER`: **\<empty\>**: Username of mailing user (usually the sender's e-mail address).
- `PASSWD`: **\<empty\>**: Password of mailing user. Use \`your password\` for quoting if you use special characters in the password.
- Please note: authentication is only supported when the SMTP server communication is encrypted with TLS (this can be via `STARTTLS`) or SMTP host is localhost. See [Email Setup]({{< relref "doc/usage/email-setup.en-us.md" >}}) for more information.
- Please note: authentication is only supported when the SMTP server communication is encrypted with TLS (this can be via `STARTTLS`) or SMTP host is localhost. See [Email Setup]({{< relref "doc/administration/email-setup.en-us.md" >}}) for more information.
- `ENABLE_HELO`: **true**: Enable HELO operation.
- `HELO_HOSTNAME`: **(retrieved from system)**: HELO hostname.
- `FROM`: **\<empty\>**: Mail from address, RFC 5322. This can be just an email address, or the "Name" \<email@example.com\> format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ toc: false
draft: false
menu:
sidebar:
parent: "advanced"
parent: "administration"
name: "配置说明"
weight: 20
weight: 30
identifier: "config-cheat-sheet"
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ toc: false
draft: false
menu:
sidebar:
parent: "advanced"
parent: "administration"
name: "Customizing Gitea"
identifier: "customizing-gitea"
weight: 9
weight: 100
---

# Customizing Gitea
Expand Down Expand Up @@ -84,7 +84,7 @@ directory at the top of this document).
Every single page of Gitea can be changed. Dynamic content is generated using [go templates](https://golang.org/pkg/html/template/),
which can be modified by placing replacements below the `$GITEA_CUSTOM/templates` directory.

To obtain any embedded file (including templates), the [`gitea embedded` tool]({{< relref "doc/advanced/cmd-embedded.en-us.md" >}}) can be used. Alternatively, they can be found in the [`templates`](https://github.com/go-gitea/gitea/tree/main/templates) directory of Gitea source (Note: the example link is from the `main` branch. Make sure to use templates compatible with the release you are using).
To obtain any embedded file (including templates), the [`gitea embedded` tool]({{< relref "doc/administration/cmd-embedded.en-us.md" >}}) can be used. Alternatively, they can be found in the [`templates`](https://github.com/go-gitea/gitea/tree/main/templates) directory of Gitea source (Note: the example link is from the `main` branch. Make sure to use templates compatible with the release you are using).

Be aware that any statement contained inside `{{` and `}}` are Gitea's template syntax and
shouldn't be touched without fully understanding these components.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ toc: false
draft: false
menu:
sidebar:
parent: "advanced"
parent: "administration"
name: "自定义 Gitea 配置"
weight: 9
weight: 100
identifier: "customizing-gitea"
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toc: false
draft: false
menu:
sidebar:
parent: "usage"
parent: "administration"
name: "Email setup"
weight: 12
identifier: "email-setup"
Expand Down Expand Up @@ -58,7 +58,7 @@ Restart Gitea for the configuration changes to take effect.

To send a test email to validate the settings, go to Gitea > Site Administration > Configuration > SMTP Mailer Configuration.

For the full list of options check the [Config Cheat Sheet]({{< relref "doc/advanced/config-cheat-sheet.en-us.md" >}})
For the full list of options check the [Config Cheat Sheet]({{< relref "doc/administration/config-cheat-sheet.en-us.md" >}})

Please note: authentication is only supported when the SMTP server communication is encrypted with TLS or `HOST=localhost`. TLS encryption can be through:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ toc: false
draft: false
menu:
sidebar:
parent: "advanced"
parent: "administration"
name: "Environment variables"
weight: 20
weight: 10
identifier: "environment-variables"
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ toc: false
draft: false
menu:
sidebar:
parent: "advanced"
parent: "administration"
name: "环境变量清单"
weight: 20
weight: 10
identifier: "environment-variables"
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ toc: false
draft: false
menu:
sidebar:
parent: "advanced"
parent: "administration"
name: "External renderers"
weight: 40
weight: 60
identifier: "external-renderers"
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toc: false
draft: false
menu:
sidebar:
parent: "usage"
parent: "administration"
name: "Fail2ban setup"
weight: 16
identifier: "fail2ban-setup"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toc: false
draft: false
menu:
sidebar:
parent: "usage"
parent: "administration"
name: "设置 Fail2ban"
weight: 16
identifier: "fail2ban-setup"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toc: false
draft: false
menu:
sidebar:
parent: "usage"
parent: "administration"
name: "Git LFS setup"
weight: 12
identifier: "git-lfs-setup"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toc: false
draft: false
menu:
sidebar:
parent: "usage"
parent: "administration"
name: "HTTPS setup"
weight: 12
identifier: "https-setup"
Expand All @@ -24,7 +24,7 @@ menu:
Before you enable HTTPS, make sure that you have valid SSL/TLS certificates.
You could use self-generated certificates for evaluation and testing. Please run `gitea cert --host [HOST]` to generate a self signed certificate.

If you are using Apache or nginx on the server, it's recommended to check the [reverse proxy guide]({{< relref "doc/usage/reverse-proxies.en-us.md" >}}).
If you are using Apache or nginx on the server, it's recommended to check the [reverse proxy guide]({{< relref "doc/administration/reverse-proxies.en-us.md" >}}).

To use Gitea's built-in HTTPS support, you must change your `app.ini` file:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ toc: false
draft: false
menu:
sidebar:
parent: "advanced"
parent: "administration"
name: "Logging Configuration"
weight: 55
weight: 40
identifier: "logging-configuration"
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toc: false
draft: false
menu:
sidebar:
parent: "advanced"
parent: "administration"
name: "Mail templates"
weight: 45
identifier: "mail-templates"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toc: false
draft: false
menu:
sidebar:
parent: "advanced"
parent: "administration"
name: "Repository indexer"
weight: 45
identifier: "repo-indexer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toc: false
draft: false
menu:
sidebar:
parent: "usage"
parent: "administration"
name: "Reverse Proxies"
weight: 16
identifier: "reverse-proxies"
Expand Down Expand Up @@ -48,7 +48,7 @@ server {
server_name git.example.com;

# Note: Trailing slash
location /git/ {
location /git/ {
# Note: Trailing slash
proxy_pass http://localhost:3000/;
proxy_set_header Host $host;
Expand Down
Loading