From 8456a34389eb42535c6987250c34405b2d1d6a53 Mon Sep 17 00:00:00 2001
From: gravel
Date: Tue, 12 Mar 2024 14:51:10 +0000
Subject: [PATCH] refactor: reorganize custom content I
---
.gitignore | 5 +--
.phpenv.php | 28 ++++++++++++-----
.../config}/room-overrides.ini.sample | 0
.../languages}/language-flags.php | 0
.../site-components/issue-banner.php.sample | 4 +--
languages/README.md | 31 -------------------
php/fetch-servers.php | 2 +-
php/servers/servers-rooms.php | 2 +-
sites/+components/qr-modals.php | 6 +---
sites/+templates/index.php | 2 +-
10 files changed, 29 insertions(+), 51 deletions(-)
rename {config => custom/config}/room-overrides.ini.sample (100%)
rename {languages => custom/languages}/language-flags.php (100%)
rename sites/+components/issue-banner.php => custom/site-components/issue-banner.php.sample (58%)
delete mode 100644 languages/README.md
diff --git a/.gitignore b/.gitignore
index 8dc6169..d0f43f4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,8 +21,9 @@ listings/lp-output/*
cache
cache-lt
-# Local config
-config/*.ini
+# Custom content
+/custom/config/*.ini
+/custom/site-components/*.php
# Archives
/etc/archives/logrotate.status
diff --git a/.phpenv.php b/.phpenv.php
index 14befcb..cdc64f6 100644
--- a/.phpenv.php
+++ b/.phpenv.php
@@ -46,12 +46,6 @@
*/
$TEMPLATES_ROOT="$PROJECT_ROOT/sites";
- /**
- * @var string $LANGUAGES_ROOT
- * Directory containing languages module.
- */
- $LANGUAGES_ROOT="$PROJECT_ROOT/languages";
-
/**
* @var string $QR_CODES
* Directory containing served QR codes.
@@ -94,11 +88,29 @@
*/
$SOURCES_CACHE="$LONG_TERM_CACHE_ROOT/sources";
+ /**
+ * @var string $CUSTOM_CONTENT_ROOT
+ * Directory containing custom site content.
+ */
+ $CUSTOM_CONTENT_ROOT="$PROJECT_ROOT/custom";
+
/**
* @var string $CONFIG_ROOT
- * Directory containing local config files.
+ * Directory containing custom config files.
+ */
+ $CONFIG_ROOT="$CUSTOM_CONTENT_ROOT/config";
+
+ /**
+ * @var string $LANGUAGES_ROOT
+ * Directory containing languages module.
+ */
+ $LANGUAGES_ROOT="$CUSTOM_CONTENT_ROOT/languages";
+
+ /**
+ * @var string $CUSTOM_COMPONENTS_ROOT
+ * Directory containing custom site components.
*/
- $CONFIG_ROOT="$PROJECT_ROOT/config";
+ $CUSTOM_COMPONENTS_ROOT="$CUSTOM_CONTENT_ROOT/site-components";
/**
* @var string $LISTING_PROVIDER_ROOT
diff --git a/config/room-overrides.ini.sample b/custom/config/room-overrides.ini.sample
similarity index 100%
rename from config/room-overrides.ini.sample
rename to custom/config/room-overrides.ini.sample
diff --git a/languages/language-flags.php b/custom/languages/language-flags.php
similarity index 100%
rename from languages/language-flags.php
rename to custom/languages/language-flags.php
diff --git a/sites/+components/issue-banner.php b/custom/site-components/issue-banner.php.sample
similarity index 58%
rename from sites/+components/issue-banner.php
rename to custom/site-components/issue-banner.php.sample
index 90e2c82..38a91b4 100644
--- a/sites/+components/issue-banner.php
+++ b/custom/site-components/issue-banner.php.sample
@@ -8,9 +8,9 @@
news banner
- Search rankings? Check. ✔️
+ Title
Next stop? You decide.
+ >Description with link.
diff --git a/languages/README.md b/languages/README.md
deleted file mode 100644
index a47a0b9..0000000
--- a/languages/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# Language information on sessioncommunities.online
-
-## Contribute
-
-To help label Communities by language, send your labelings to us ([see contact info](../README.md#contact-us)), or fork this repository and submit a pull request with your changes (account required).
-
-To make language tags a native feature, support this issue on Oxen Github.
-
--
-
-## File format
-
-Communities are each identified by a short string. You can copy this identifier using the "Copy Community ID" button from within Community details. It should be of the form `roomname+xxxx`.
-
-Language labels for communities are grouped by server for easy navigation:
-
-```php
-// https://open.getsession.org/
-$server_languages[] = array(
- "crypto+a03c" => "🇬🇧",
- "lokinet+a03c" => "🇬🇧",
- "oxen+a03c" => "🇬🇧",
- "session-farsi+a03c" => "🇮🇷",
- "session-updates+a03c" => "🇬🇧",
- "session+a03c" => "🇬🇧"
-);
-```
-
-To label a Community, you would search for the `xxxx` suffix (in this case `a03c`) in the [flags file](./language-flags.php) and add the appropriate entry.
-
-If you cannot find any entries for this code, copy an existing block from another server & replace the entries with your own. If you have trouble entering language flags on your keyboard, you may find it helpful to copy them from .
diff --git a/php/fetch-servers.php b/php/fetch-servers.php
index fd6ecef..aba8104 100644
--- a/php/fetch-servers.php
+++ b/php/fetch-servers.php
@@ -12,7 +12,7 @@
require_once 'servers/known-servers.php';
require_once 'servers/servers-rooms.php';
require_once 'servers/sources.php';
- require_once 'languages/language-flags.php';
+ require_once 'custom/languages/language-flags.php';
/**
* Fetch online Communities and write the resulting data to disk.
diff --git a/php/servers/servers-rooms.php b/php/servers/servers-rooms.php
index 7a5da5a..fe02f7b 100644
--- a/php/servers/servers-rooms.php
+++ b/php/servers/servers-rooms.php
@@ -4,7 +4,7 @@
* Represent Session Communities and Session Open Group Servers.
*/
- require_once 'languages/language-flags.php';
+ require_once 'custom/languages/language-flags.php';
require_once 'servers/known-servers.php';
require_once 'servers/tags.php';
require_once 'utils/fetching-coroutines.php';
diff --git a/sites/+components/qr-modals.php b/sites/+components/qr-modals.php
index 45b1b55..aacbe22 100644
--- a/sites/+components/qr-modals.php
+++ b/sites/+components/qr-modals.php
@@ -52,11 +52,7 @@
- Languagehelp us label:
diff --git a/sites/+templates/index.php b/sites/+templates/index.php
index 0091b15..5bf9a7e 100644
--- a/sites/+templates/index.php
+++ b/sites/+templates/index.php
@@ -60,7 +60,7 @@
class="non-anchorstyle"
>
-
+