Kaynağa Gözat

properly use base_url macro and set it for github mirror

Thomas B 1 ay ö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,6 +30,7 @@ jobs:
30 30
         run: |
31 31
           rm -rf output
32 32
           mkdir output
33
+          sed -i 's|https://www.xythobuz.de|https://xythobuz.github.io|g' macros.py
33 34
           ./poole.py --build
34 35
           cp -r static/* output/
35 36
 

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

@@ -6,7 +6,9 @@ It uses an (old, modified) version of [poole](https://hg.sr.ht/~obensonne/poole)
6 6
 To run a local test instance call the `localtest.sh` script.
7 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 13
 ## To Do
12 14
 

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

@@ -601,7 +601,7 @@ def hook_preconvert_compat():
601 601
     fp = open(os.path.join(options.project, "output", "index.php"), 'w')
602 602
     fp.write("<?\n")
603 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 605
     fp.write("if (isset($_GET['p'])) {\n")
606 606
     fp.write("    if (isset($_GET['lang'])) {\n")
607 607
     fp.write("        $_GET['p'] .= 'EN';\n")
@@ -612,7 +612,7 @@ def hook_preconvert_compat():
612 612
             tmp = p["compat"]
613 613
             if p.get("lang", DEFAULT_LANG) == DEFAULT_LANG:
614 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 616
             fp.write("\n")
617 617
     fp.write(_COMPAT_404 % "/404.html")
618 618
     fp.write("    }\n")
@@ -765,7 +765,7 @@ def hook_postconvert_mobilecompat():
765 765
     fp = codecs.open(os.path.join(directory, "index.php"), "w", "utf-8")
766 766
     fp.write("<?\n")
767 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 769
     fp.write("if (isset($_GET['p'])) {\n")
770 770
     fp.write("    if (isset($_GET['lang'])) {\n")
771 771
     fp.write("        $_GET['p'] .= 'EN';\n")
@@ -776,7 +776,7 @@ def hook_postconvert_mobilecompat():
776 776
             tmp = p["compat"]
777 777
             if p.get("lang", DEFAULT_LANG) == DEFAULT_LANG:
778 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 780
             fp.write("\n")
781 781
     fp.write(_COMPAT_404_MOB % "/404.mob.html")
782 782
     fp.write("    }\n")

Loading…
İptal
Kaydet