From 37a39b98ce136c7ec53ce06e03b285f3fb33ccb5 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 23 Feb 2024 16:08:32 +0100 Subject: [PATCH] [feature] Add "what is this" section to index template (#2680) --- web/template/about.tmpl | 48 ++++++++++++++--------- web/template/index.tmpl | 1 + web/template/index_what_is_this.tmpl | 58 ++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 18 deletions(-) create mode 100644 web/template/index_what_is_this.tmpl diff --git a/web/template/about.tmpl b/web/template/about.tmpl index 46349a4c3..04b0b095f 100644 --- a/web/template/about.tmpl +++ b/web/template/about.tmpl @@ -33,6 +33,32 @@ {{- end }} {{- end -}} +{{- define "languages" -}} +{{- if .languages }} +

This instance prefers the following languages:

+
    + {{- range .languages }} +
  1. {{- . -}}
  2. + {{- end }} +
+{{- else }} +

No preferred languages have yet been set for this instance.

+{{- end }} +{{- end -}} + +{{- define "rules" -}} +{{- if .instance.Rules }} +

This instance has the following rules:

+
    + {{- range .instance.Rules }} +
  1. {{- .Text -}}
  2. + {{- end }} +
+{{- else }} +

No rules have yet been set for this instance.

+{{- end }} +{{- end -}} + {{- define "registrationLimits" -}} {{- if .instance.Registrations -}} Registration is enabled; new signups can be submitted to this instance.
@@ -129,30 +155,16 @@ Polls can have up to 

Languages

- {{- if .languages }} -

This instance prefers the following languages:

-
    - {{- range .languages }} -
  1. {{- . -}}
  2. - {{- end }} -
- {{- else }} -

This instance does not have any preferred languages.

+ {{- with . }} + {{- include "languages" . | indent 3 }} {{- end }}

Instance Rules

-

This instance has the following rules:

- {{- if .instance.Rules }} -
    - {{- range .instance.Rules }} -
  1. {{- .Text -}}
  2. - {{- end }} -
- {{- else }} -

This instance has not yet set any rules.

+ {{- with . }} + {{- include "rules" . | indent 3 }} {{- end }}
diff --git a/web/template/index.tmpl b/web/template/index.tmpl index 7e7b7118e..80245fe5a 100644 --- a/web/template/index.tmpl +++ b/web/template/index.tmpl @@ -34,6 +34,7 @@ See more details + {{- include "index_what_is_this.tmpl" . | indent 1 }} {{- include "index_apps.tmpl" . | indent 1 }} {{- end }} \ No newline at end of file diff --git a/web/template/index_what_is_this.tmpl b/web/template/index_what_is_this.tmpl new file mode 100644 index 000000000..ff6eb4886 --- /dev/null +++ b/web/template/index_what_is_this.tmpl @@ -0,0 +1,58 @@ +{{- /* +// GoToSocial +// Copyright (C) GoToSocial Authors admin@gotosocial.org +// SPDX-License-Identifier: AGPL-3.0-or-later +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +*/ -}} + +{{- with . }} +
+

What is this?

+
+

+ The web page you're reading right now is served by an instance of GoToSocial, + a federated, distributed, open-source microblogging software which connects + to other instances across a network known as the "fediverse". +

+

What is an "instance"?

+

+ "Instance" is a term commonly used for one node in the fediverse. Each instance + has its own web address, user(s), culture, rules, and settings. Instances exchange + data by "talking" to each other over the internet using a protocol called + ActivityPub (opens in a new tab). +

+

+ Each instance can, in theory, talk to each other instance, allowing people to talk + to one another across a decentralized network that has no single authority in charge. +

+

+ There are thousands of fediverse instances, connecting millions of people together. +

+

How do I join the fediverse?

+

+ You can join the fediverse by running your own instance of an ActivityPub software, + or by finding an existing instance that aligns with your values and expectations, + and registering an account there. +

+

+ To help you find an instance that suits you, you can try one of the following tools: +

+ +
+
+{{- end }} \ No newline at end of file