[gimp-web/testing] Make download page as auto-updated as possible.



commit 2070290bd41270fd3fe9eeba44924f1fd34b535b
Author: Jehan <jehan girinstud io>
Date:   Tue Oct 24 01:09:19 2017 +0200

    Make download page as auto-updated as possible.
    
    There were still a bunch of "2.8" hardcoded strings here and there which
    would force us to update the html page at each major release. I use the
    new GIMP_MAJOR_MINOR_VERSION when possible, and also created
    WINDOWS_MAJOR_MINOR_VER and MACOS_MAJOR_MINOR_VER variables. Indeed
    since Windows and MacOS binaries are not necessarily immediately made
    together with the main release (though ideally they should, but history
    showed that's not always happening), I can't rely on the same
    major.minor version either for links and texts.
    Now only the user manual links are still using hardcoded links and
    versions in the download page (none of this seems automatized yet). All
    the rest will just update cleanly when updating the file GIMP_VERSIONS.

 pelicanconf.local.py                    |    2 +
 pelicanconf.py                          |    2 +
 pelicanconf.testing.py                  |    2 +
 themes/newgimp/templates/downloads.html |   38 ++++++++++++++++++------------
 4 files changed, 29 insertions(+), 15 deletions(-)
---
diff --git a/pelicanconf.local.py b/pelicanconf.local.py
index 55525a6..44db8ab 100644
--- a/pelicanconf.local.py
+++ b/pelicanconf.local.py
@@ -166,6 +166,7 @@ if 'STABLE' in GIMP:
                 WINDOWS_FILE
             except NameError:
                 WINDOWS_VER = version
+                WINDOWS_MAJOR_MINOR_VER = version[:version.index('.', version.index('.') + 1)]
                 WINDOWS_FILE = info['windows'].keys()[0]
                 WINDOWS_HASH = info['windows'].values()[0]
         if 'macos' in info:
@@ -173,6 +174,7 @@ if 'STABLE' in GIMP:
                 MACOS_FILE
             except NameError:
                 MACOS_VER = version
+                MACOS_MAJOR_MINOR_VER = version[:version.index('.', version.index('.') + 1)]
                 MACOS_FILE = info['macos'].keys()[0]
                 MACOS_HASH = info['macos'].values()[0]
 else:
diff --git a/pelicanconf.py b/pelicanconf.py
index 41d466f..ce3031b 100644
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -153,6 +153,7 @@ if 'STABLE' in GIMP:
                 WINDOWS_FILE
             except NameError:
                 WINDOWS_VER = version
+                WINDOWS_MAJOR_MINOR_VER = version[:version.index('.', version.index('.') + 1)]
                 WINDOWS_FILE = info['windows'].keys()[0]
                 WINDOWS_HASH = info['windows'].values()[0]
         if 'macos' in info:
@@ -160,6 +161,7 @@ if 'STABLE' in GIMP:
                 MACOS_FILE
             except NameError:
                 MACOS_VER = version
+                MACOS_MAJOR_MINOR_VER = version[:version.index('.', version.index('.') + 1)]
                 MACOS_FILE = info['macos'].keys()[0]
                 MACOS_HASH = info['macos'].values()[0]
 else:
diff --git a/pelicanconf.testing.py b/pelicanconf.testing.py
index c3595b6..9b40e4e 100644
--- a/pelicanconf.testing.py
+++ b/pelicanconf.testing.py
@@ -153,6 +153,7 @@ if 'STABLE' in GIMP:
                 WINDOWS_FILE
             except NameError:
                 WINDOWS_VER = version
+                WINDOWS_MAJOR_MINOR_VER = version[:version.index('.', version.index('.') + 1)]
                 WINDOWS_FILE = info['windows'].keys()[0]
                 WINDOWS_HASH = info['windows'].values()[0]
         if 'macos' in info:
@@ -160,6 +161,7 @@ if 'STABLE' in GIMP:
                 MACOS_FILE
             except NameError:
                 MACOS_VER = version
+                MACOS_MAJOR_MINOR_VER = version[:version.index('.', version.index('.') + 1)]
                 MACOS_FILE = info['macos'].keys()[0]
                 MACOS_HASH = info['macos'].values()[0]
 else:
diff --git a/themes/newgimp/templates/downloads.html b/themes/newgimp/templates/downloads.html
index 229eb0e..afb2be9 100644
--- a/themes/newgimp/templates/downloads.html
+++ b/themes/newgimp/templates/downloads.html
@@ -72,13 +72,13 @@
 
         <p>
             <span class='win-button' id='osx-torrent'>
-                <a href="//download.gimp.org/pub/gimp/v2.8/osx/{{ MACOS_FILE }}.torrent">
+                <a href="//download.gimp.org/pub/gimp/v{{ MACOS_MAJOR_MINOR_VER }}/osx/{{ MACOS_FILE 
}}.torrent">
                     Download GIMP&nbsp;{{ MACOS_VER }}<br/>
                     via BitTorrent
                 </a>
             </span>
             <span class='win-button'>
-                <a href="//download.gimp.org/mirror/pub/gimp/v2.8/osx/{{ MACOS_FILE }}">
+                <a href="//download.gimp.org/mirror/pub/gimp/v{{ MACOS_MAJOR_MINOR_VER }}/osx/{{ MACOS_FILE 
}}">
                     Download GIMP&nbsp;{{ MACOS_VER }}<br/>
                     directly
                 </a>
@@ -88,7 +88,8 @@
         <small>
             <p>
                 The download links above will attempt to download GIMP from one of our trusted mirror 
servers.
-                If the mirrors do not work or you would rather download directly from our server, you can 
get the <a href='//download.gimp.org/pub/gimp/v2.8/osx/'>direct download here</a>.
+                If the mirrors do not work or you would rather download directly from our server, you can 
get the <a
+                href='//download.gimp.org/pub/gimp/v{{ MACOS_MAJOR_MINOR_VER }}/osx/'>direct download 
here</a>.
             </p>
         </small>
 
@@ -96,8 +97,7 @@
 
         <h3>Native build</h3>
 
-        <p>The official GIMP 2.8 DMG installer (linked above) is a stock GIMP build without any add-ons. It 
works on OS X 10.6 Snow Leopard and later. Just open the downloaded DMG and drag and drop GIMP into your 
"Applications" folder.</p>
-
+        <p>The official GIMP {{ MACOS_MAJOR_MINOR_VER }} DMG installer (linked above) is a stock GIMP build 
without any add-ons. It works on OS X 10.6 Snow Leopard and later. Just open the downloaded DMG and drag and 
drop GIMP into your "Applications" folder.</p>
         <p>
             The MD5 hash sum for <code>{{ MACOS_FILE }}</code> is:
             <kbd>{{ MACOS_HASH }}</kbd>
@@ -106,7 +106,7 @@
 
 
         <h3>Older Downloads</h3>
-        <p>Previous installers for OSX can be found here: <a 
href='//download.gimp.org/mirror/pub/gimp/v2.8/osx/'>download.gimp.org</a>.</p>
+        <p>Previous installers for OSX can be found here: <a href='//download.gimp.org/mirror/pub/gimp/v{{ 
MACOS_MAJOR_MINOR_VER }}/osx/'>download.gimp.org</a>.</p>
 
 
 
@@ -116,8 +116,8 @@
         </p>
 
         <p>
-            The <a href="https://github.com/macports/macports-ports/blob/master/graphics/gimp/Portfile";>GIMP
-            port file</a> points to the current stable 2.8.18 release
+            Last we checked, the <a 
href="https://github.com/macports/macports-ports/blob/master/graphics/gimp/Portfile";>GIMP
+            port file</a> pointed to the current stable release
             and we have reports from people who've built GIMP
             successfully this way.
         </p>
@@ -149,7 +149,9 @@
         </p>
 
         <p>
-            Disclaimer: we haven't been able to determine if it is possible to install or build GIMP 2.8 
from Fink. GIMP 2.6.12 appears to be the most recent <a 
href="http://pdb.finkproject.org/pdb/browse.php?summary=gimp";>GIMP package</a> that is <a 
href="http://pdb.finkproject.org/pdb/package.php/gimp2";>offered there</a>.
+            Disclaimer: we haven't been able to determine if it is
+            possible to install or build recent GIMP from Fink.
+            Last we checked, GIMP 2.6.12 appears to be the most recent <a 
href="http://pdb.finkproject.org/pdb/browse.php?summary=gimp";>GIMP package</a> that is <a 
href="http://pdb.finkproject.org/pdb/package.php/gimp2";>offered there</a>.
         </p>
 
         <ul>
@@ -167,13 +169,17 @@
 
     <p>
         <span class='win-button' id='win-torrent'>
-            <a href="//download.gimp.org/pub/gimp/v2.8/windows/{{ WINDOWS_FILE }}.torrent" title="Download 
GIMP via BitTorrent" id="win-torrent-link">
+            <a
+            href="//download.gimp.org/pub/gimp/v{{ WINDOWS_MAJOR_MINOR_VER }}/windows/{{ WINDOWS_FILE 
}}.torrent"
+            title="Download GIMP via BitTorrent" id="win-torrent-link">
                 Download GIMP&nbsp;{{ WINDOWS_VER }}<br/>
                 via BitTorrent
             </a>  
         </span>
         <span class='win-button'>
-            <a href="//download.gimp.org/mirror/pub/gimp/v2.8/windows/{{ WINDOWS_FILE }}" title="Download 
GIMP via HTTP" id='win-download-link' >
+            <a
+            href="//download.gimp.org/mirror/pub/gimp/v{{ WINDOWS_MAJOR_MINOR_VER }}/windows/{{ WINDOWS_FILE 
}}"
+            title="Download GIMP via HTTP" id='win-download-link' >
                 Download GIMP&nbsp;{{ WINDOWS_VER }}<br/>
                 directly
             </a>
@@ -183,7 +189,7 @@
     <small>
         <p>
             The download links above will attempt to download GIMP from one of our trusted mirror servers.
-            If the mirrors do not work or you would rather download directly from our server, you can get 
the <a href="//download.gimp.org/pub/gimp/v2.8/windows/">direct download here</a>.
+            If the mirrors do not work or you would rather download directly from our server, you can get 
the <a href="//download.gimp.org/pub/gimp/v{{ WINDOWS_MAJOR_MINOR_VER }}/windows/">direct download here</a>.
         </p>
     </small>
 
@@ -205,7 +211,7 @@
 
     <h3>Older Downloads</h3>
     <p>
-        Previous installers for Windows can be found here: <a 
href='//download.gimp.org/mirror/pub/gimp/v2.8/windows/'>download.gimp.org</a>.
+        Previous installers for Windows can be found here: <a href='//download.gimp.org/mirror/pub/gimp/v{{ 
WINDOWS_MAJOR_MINOR_VER }}/windows/'>download.gimp.org</a>.
     </p>
 
     <h3>GIMP User Manual</h3>
@@ -253,13 +259,15 @@
     <hr>
 
     <div id='source'>
-    <h2>Source for version 2.8 (Stable)</h2>
+    <h2>Source for version {{ GIMP_MAJOR_MINOR_VERSION }} (Stable)</h2>
 
     <p>GIMP releases available from gimp.org and its <a href='#mirrors'>mirrors</a> contain the source code 
and have to be compiled in order to be installed on your system.</p>
 
     <p>For instructions, how to build GIMP from source code, please see <a href='/source/'>this page</a>.</p>
 
-    <p>GIMP {{ GIMP_VERSION }} is now available at <a 
href='//download.gimp.org/mirror/pub/gimp/v2.8/'>https://download.gimp.org/mirror/pub/gimp/v2.8/</a>. You may 
want to read the <a href='/release-notes/gimp-2.8.html'>Release Notes for GIMP 2.8</a>.</p>
+    <p>GIMP {{ GIMP_VERSION }} is now available at <a
+    href='//download.gimp.org/mirror/pub/gimp/v{{ GIMP_MAJOR_MINOR_VERSION 
}}/'>https://download.gimp.org/mirror/pub/gimp/v{{ GIMP_MAJOR_MINOR_VERSION }}/</a>. You may want to read the 
<a
+    href='/release-notes/gimp-{{ GIMP_MAJOR_MINOR_VERSION }}.html'>Release Notes for GIMP {{ 
GIMP_MAJOR_MINOR_VERSION }}</a>.</p>
 
     <p>To allow you to check the integrity of the tarballs, here are the MD5 sums of the latest releases:</p>
 


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