[gimp-web/migrate/py3] Add static build environment and build rules for static and local



commit a331fe7184de4b3c41653cbdbb8d205d091544c8
Author: Michael Schumacher <schumaml gmx de>
Date:   Sat Apr 18 22:19:14 2020 +0200

    Add static build environment and build rules for static and local

 Makefile              | 10 ++++++++++
 pelicanconf_common.py |  5 ++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/Makefile b/Makefile
index 22b5d03d..9cde37e7 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,8 @@ CONFFILE=$(BASEDIR)/pelicanconf.py
 PUBLISHCONF=$(BASEDIR)/publishconf.py
 
 TESTINGCONF=$(BASEDIR)/pelicanconf.testing.py
+STATICCONF=$(BASEDIR)/pelicanconf.static.py
+LOCALCONF=$(BASEDIR)/pelicanconf.local.py
 
 FTP_HOST=localhost
 FTP_USER=anonymous
@@ -43,6 +45,8 @@ help:
        @echo '   make regenerate                  regenerate files upon modification '
        @echo '   make publish                     generate using production settings '
        @echo '   make testing                     generate using testing settings    '
+       @echo '   make static                      generate using static settings     '
+       @echo '   make local                       generate using local settings      '
        @echo '   make serve [PORT=8000]           serve site at http://localhost:8000'
        @echo '   make devserver [PORT=8000]       start/restart develop_server.sh    '
        @echo '   make stopserver                  stop local server                  '
@@ -63,6 +67,12 @@ html:
 testing:
        $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(TESTINGCONF) $(PELICANOPTS)
 
+static:
+       $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(STATICCONF) $(PELICANOPTS)
+
+local:
+       $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(LOCALCONF) $(PELICANOPTS)
+
 clean:
        [ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
 
diff --git a/pelicanconf_common.py b/pelicanconf_common.py
index 8a93b614..95361e38 100644
--- a/pelicanconf_common.py
+++ b/pelicanconf_common.py
@@ -41,7 +41,7 @@ def customize_environment(environment):
     global DELETE_OUTPUT_DIRECTORY
     global RELATIVE_URLS
 
-    valid_environments = [ 'local', 'testing', 'production' ]
+    valid_environments = [ 'local', 'testing', 'static', 'production' ]
     if environment not in valid_environments:
         print("customize_environment() must be called with one of: {}".format(', '.join(valid_environments)))
         exit(1)
@@ -49,6 +49,9 @@ def customize_environment(environment):
     if environment == 'testing':
         SITEURL = 'https://testing.gimp.org'
         SITEMAP_SITEURL = 'https://testing.gimp.org'
+    elif environment == 'static':
+        SITEURL = 'https://static.gimp.org'
+        SITEMAP_SITEURL = 'https://static.gimp.org'
     else:
         SITEURL = 'https://www.gimp.org'
         SITEMAP_SITEURL = 'https://www.gimp.org'


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