[gimp-web/wip/Jehan/issue-236-new-sponsor-page] content, plugins: add the mirror list in the sponsors page.



commit 5224d83c44540bc48408eedccc850aa3a1a496c2
Author: Jehan <jehan girinstud io>
Date:   Sat Aug 28 15:34:59 2021 +0200

    content, plugins: add the mirror list in the sponsors page.

 content/donating/sponsors.md         | 14 ++++++++++++++
 plugins/gimp_mirrors/gimp_mirrors.py |  6 +++++-
 2 files changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/content/donating/sponsors.md b/content/donating/sponsors.md
index a326ebdd..c2430459 100644
--- a/content/donating/sponsors.md
+++ b/content/donating/sponsors.md
@@ -10,6 +10,20 @@ GIMP across the years. In particular, we want to thank the numerous
 people who made small donations. With small drops, you created a huge
 river!*
 
+## Official Mirrors
+
+These are the entities sponsoring GIMP by mirroring the
+downloads, hence lessening burden on our servers.
+As of <!-- DATE -->, the official mirrors of GIMP are the following:
+
+<!-- MIRRORS -->
+
+If you wish to be a part of this list by creating an official
+GIMP mirror and get rsync credentials, follow the [GNOME mirror
+process](https://wiki.gnome.org/Infrastructure/Mirrors), except that you
+must explicitly say you wish to mirror *download.gimp.org*, by [opening
+a report on the Infrastructure 
tracker](https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/new?issuable_template=new-mirror).
+
 ## Legacy sponsor list
 
 This is a legacy list of sponsors. As of 2021, we are not sure anymore
diff --git a/plugins/gimp_mirrors/gimp_mirrors.py b/plugins/gimp_mirrors/gimp_mirrors.py
index 15af69ec..6894b9bc 100644
--- a/plugins/gimp_mirrors/gimp_mirrors.py
+++ b/plugins/gimp_mirrors/gimp_mirrors.py
@@ -1,4 +1,5 @@
 from pelican import signals, contents
+import datetime
 import os.path
 from os.path import basename
 import socket
@@ -58,7 +59,7 @@ def do_mirrors(path, context):
 
     # if we are on a downloads page
     #if '/downloads/index.html' in path:
-    if '/downloads/' in path:
+    if '/downloads/' in path or '/sponsors' in path:
 
         # create mirrors dict
         mirrors = {}
@@ -88,6 +89,9 @@ def do_mirrors(path, context):
                         s = f.read()
                         #print(s.decode('utf-8'))
                         s = s.decode('utf-8').replace(u"<!-- MIRRORS -->", html_output(mirrors))
+                        day = datetime.date.today().isoformat()
+                        # Embed the day of generating the mirror list in ISO format.
+                        s = s.replace(u"<!-- DATE -->", day)
 
                     with open( path, 'wb') as f:
                         f.write(s.encode('utf-8'))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]