]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
web: fix how resources are located
authorVincent Bernat <bernat@luffy.cx>
Sun, 13 Jan 2013 00:07:50 +0000 (01:07 +0100)
committerVincent Bernat <bernat@luffy.cx>
Sun, 13 Jan 2013 00:16:33 +0000 (01:16 +0100)
In Github pages, resources are under /lldpd. So, we use a specific
base for this.

content/index.html
fabfile.py
layout/menu.j2
site-production.yaml [new file with mode: 0644]
site.yaml

index 37fa6ce92fbe4a54c03be694cc323430dfebbd99..4d68faef87fabd0390e23898caeabb1c39f0224f 100644 (file)
@@ -17,7 +17,7 @@ Unixes. It also supports some proprietary protocols.
 
  - Download the latest version ([{{ resource.meta.latestversion }}][last]).
  - Check the [list of features]([[features.html]]).
- - Learn [how to install _lldpd_]([[install.html]]).
+ - Learn [how to install _lldpd_]([[installation.html]]).
  - Learn [how to configure and use _lldpd_]([[usage.html]]).
  - [Get the code on GitHub](https://github.com/vincentbernat/lldpd).
  - [Add issues and feature requests](https://github.com/vincentbernat/lldpd/issues).
index 6bc1e737e2d6df22e5114b0e47ac1659309bb029..eda481e4781d5003d50268c9a9b91d82dd396953 100644 (file)
@@ -26,7 +26,8 @@ def build():
     """Build production content"""
     # Generate the website from scratch
     local("rm -rf deploy")
-    gen()
+    conf = "site-production.yaml"
+    _hyde('gen -c %s' % conf)
 
     # Compute hash for media files
     with lcd("deploy"):
@@ -48,7 +49,7 @@ def build():
                 # Fix HTML
                 local(r"find . -name '*.html' -type f -print0 | xargs -r0 sed -i "
                       '"'
-                      r"s@\([\"']\)%s\1@\1%s\1@g"
+                      r"s@\([\"']\)\([^\"']*\)%s\1@\1\2%s\1@g"
                       '"' % (f, newname))
 
     lldpdir = os.getcwd()
index c61ddc918703913f7298998741a5931fc57a78b9..90b68b49858d2cda7ee65d51efb5842f51abec72 100644 (file)
@@ -6,10 +6,10 @@
   </p>
 
   <ul>
-    <li><a href="index.html">Overview</a></li>
-    <li><a href="features.html">Features</a></li>
-    <li><a href="installation.html">Installation</a></li>
-    <li><a href="usage.html">Usage</a></li>
+    <li><a href="{{ content_url('index.html') }}">Overview</a></li>
+    <li><a href="{{ content_url('features.html') }}">Features</a></li>
+    <li><a href="{{ content_url('installation.html') }}">Installation</a></li>
+    <li><a href="{{ content_url('usage.html') }}">Usage</a></li>
   </ul>
 </nav>
 
diff --git a/site-production.yaml b/site-production.yaml
new file mode 100644 (file)
index 0000000..2fd4fd1
--- /dev/null
@@ -0,0 +1,4 @@
+extends: "site.yaml"
+mode: production
+base_url: /lldpd
+media_url: /lldpd/media
index a7ac4d993df9cc5ca4ca3d9d12746b228cd235ec..fe6dacc2e5990ec29bf6bdd52a0206d412c1569d 100644 (file)
--- a/site.yaml
+++ b/site.yaml
@@ -1,6 +1,6 @@
-mode: production
+mode: development
 media_root: media
-media_url: media
+media_url: /media
 base_url: /
 plugins:
   - hyde.ext.plugins.meta.MetaPlugin