Kaynağa Gözat

properly use base_url macro and set it for github mirror

Thomas B 20 saat önce
ebeveyn
işleme
059b9bd7c5
3 değiştirilmiş dosya ile 8 ekleme ve 5 silme
  1. 1
    0
      .github/workflows/docs.yml
  2. 3
    1
      README.md
  3. 4
    4
      macros.py

+ 1
- 0
.github/workflows/docs.yml Dosyayı Görüntüle

30
         run: |
30
         run: |
31
           rm -rf output
31
           rm -rf output
32
           mkdir output
32
           mkdir output
33
+          sed -i 's|https://www.xythobuz.de|https://xythobuz.github.io|g' macros.py
33
           ./poole.py --build
34
           ./poole.py --build
34
           cp -r static/* output/
35
           cp -r static/* output/
35
 
36
 

+ 3
- 1
README.md Dosyayı Görüntüle

6
 To run a local test instance call the `localtest.sh` script.
6
 To run a local test instance call the `localtest.sh` script.
7
 This is also a good starting point for integration into a CI workflow.
7
 This is also a good starting point for integration into a CI workflow.
8
 
8
 
9
-Includes [SHJS](https://shjs.sourceforge.net/) and [llightGallery](https://github.com/sachinchoolur/lightGallery).
9
+An automated cloud mirror on GitHub is available on [xythobuz.github.io](https://xythobuz.github.io).
10
+
11
+Includes [SHJS](https://shjs.sourceforge.net/) and [lightGallery](https://github.com/sachinchoolur/lightGallery).
10
 
12
 
11
 ## To Do
13
 ## To Do
12
 
14
 

+ 4
- 4
macros.py Dosyayı Görüntüle

601
     fp = open(os.path.join(options.project, "output", "index.php"), 'w')
601
     fp = open(os.path.join(options.project, "output", "index.php"), 'w')
602
     fp.write("<?\n")
602
     fp.write("<?\n")
603
     fp.write("// Auto generated xyCMS compatibility index.php\n")
603
     fp.write("// Auto generated xyCMS compatibility index.php\n")
604
-    fp.write("$loc = 'https://www.xythobuz.de/index.de.html';\n")
604
+    fp.write("$loc = '" + get_conf("base_url") + "/index.de.html';\n")
605
     fp.write("if (isset($_GET['p'])) {\n")
605
     fp.write("if (isset($_GET['p'])) {\n")
606
     fp.write("    if (isset($_GET['lang'])) {\n")
606
     fp.write("    if (isset($_GET['lang'])) {\n")
607
     fp.write("        $_GET['p'] .= 'EN';\n")
607
     fp.write("        $_GET['p'] .= 'EN';\n")
612
             tmp = p["compat"]
612
             tmp = p["compat"]
613
             if p.get("lang", DEFAULT_LANG) == DEFAULT_LANG:
613
             if p.get("lang", DEFAULT_LANG) == DEFAULT_LANG:
614
                 tmp = tmp + "EN"
614
                 tmp = tmp + "EN"
615
-            fp.write(_COMPAT % (tmp, "https://www.xythobuz.de", p.url))
615
+            fp.write(_COMPAT % (tmp, get_conf("base_url"), p.url))
616
             fp.write("\n")
616
             fp.write("\n")
617
     fp.write(_COMPAT_404 % "/404.html")
617
     fp.write(_COMPAT_404 % "/404.html")
618
     fp.write("    }\n")
618
     fp.write("    }\n")
765
     fp = codecs.open(os.path.join(directory, "index.php"), "w", "utf-8")
765
     fp = codecs.open(os.path.join(directory, "index.php"), "w", "utf-8")
766
     fp.write("<?\n")
766
     fp.write("<?\n")
767
     fp.write("// Auto generated xyCMS compatibility mobile/index.php\n")
767
     fp.write("// Auto generated xyCMS compatibility mobile/index.php\n")
768
-    fp.write("$loc = 'https://www.xythobuz.de/index.de.html';\n")
768
+    fp.write("$loc = '" + get_conf("base_url") + "/index.de.html';\n")
769
     fp.write("if (isset($_GET['p'])) {\n")
769
     fp.write("if (isset($_GET['p'])) {\n")
770
     fp.write("    if (isset($_GET['lang'])) {\n")
770
     fp.write("    if (isset($_GET['lang'])) {\n")
771
     fp.write("        $_GET['p'] .= 'EN';\n")
771
     fp.write("        $_GET['p'] .= 'EN';\n")
776
             tmp = p["compat"]
776
             tmp = p["compat"]
777
             if p.get("lang", DEFAULT_LANG) == DEFAULT_LANG:
777
             if p.get("lang", DEFAULT_LANG) == DEFAULT_LANG:
778
                 tmp = tmp + "EN"
778
                 tmp = tmp + "EN"
779
-            fp.write(_COMPAT_MOB % (tmp, "https://www.xythobuz.de", re.sub(".html", ".html", p.url)))
779
+            fp.write(_COMPAT_MOB % (tmp, get_conf("base_url"), re.sub(".html", ".html", p.url)))
780
             fp.write("\n")
780
             fp.write("\n")
781
     fp.write(_COMPAT_404_MOB % "/404.mob.html")
781
     fp.write(_COMPAT_404_MOB % "/404.mob.html")
782
     fp.write("    }\n")
782
     fp.write("    }\n")

Loading…
İptal
Kaydet