]> Lady’s Gitweb - x_status_git/blobdiff - Caddyfile
Fail on git clone error
[x_status_git] / Caddyfile
index b4bcbffd690cfa6c9a8d86d7900d88eca6168fbb..03420b830e05f4eb0b4ee6cf5f21947c5067a1b9 100644 (file)
--- a/Caddyfile
+++ b/Caddyfile
@@ -18,6 +18,11 @@ status.site.example {
                expression {re.matcher.suffix} == ""
        }
 
+       handle / {
+               rewrite * /index.html
+               header Link </about.jsonld>;rel=meta;type="application/ld+json"
+       }
+
        handle /about {
                rewrite * /.about.html
                header Link </about.jsonld>;rel=meta;type="application/ld+json"
@@ -32,51 +37,39 @@ status.site.example {
                header Link </statuses.jsonld>;rel=meta;type="application/ld+json"
        }
 
-       @statusroot {
-               path_regexp matcher ^/statuses/(?P<path>.*)
-               not path_regexp ^/statuses/index\.
-       }
-
-       handle @statusroot {
-               handle /statuses/ {
-                       redir * /statuses
-               }
-
-               handle {
-                       redir * /{re.matcher.path}
-               }
-       }
+       redir /statuses/ /statuses
 
        rewrite /statuses.jsonld /statuses/index.jsonld
 
        @dated {
-               path_regexp matcher ^/(?P<ym>\d{4}-\d{2})(?P<suffix>/[^/.]+)?(?:\..*|/)?$
+               path_regexp matcher ^/statuses/(?P<ym>\d{4}-\d{2})(?P<suffix>/[^/.]+)?(?:\..*|/)?$
+               not path_regexp ^/statuses/index[/.]?
        }
 
        handle @dated {
                handle @empty {
                        handle @bare {
                                rewrite * /.topic.html
-                               header Link </{re.matcher.ym}.jsonld>;rel=meta;type="application/ld+json"
+                               header Link </statuses/{re.matcher.ym}.jsonld>;rel=meta;type="application/ld+json"
                        }
 
                        handle @slash {
-                               redir * /{re.matcher.ym}
+                               redir * /statuses/{re.matcher.ym}
                        }
 
                        handle @jsonld {
-                               rewrite * /{re.matcher.ym}/index.jsonld
+                               rewrite * /statuses/{re.matcher.ym}/index.jsonld
                        }
                }
 
                handle {
                        handle @bare {
                                rewrite * /.status.html
-                               header Link </{re.matcher.ym}.jsonld>;rel=meta;type="application/ld+json"
+                               header Link </statuses/{re.matcher.ym}.jsonld>;rel=meta;type="application/ld+json"
                        }
 
                        handle @slash {
-                               redir * /{re.matcher.ym}{re.matcher.suffix}
+                               redir * /statuses/{re.matcher.ym}{re.matcher.suffix}
                        }
                }
        }
@@ -91,7 +84,7 @@ status.site.example {
        rewrite /topics.jsonld /topics/index.jsonld
 
        @topics {
-               path_regexp matcher ^/(?:topics/(?P<topic>[0-9A-Za-z_-]+))(?P<suffix>/[^/.]+)?(?:\..*|/)?$
+               path_regexp matcher ^/topics/(?P<topic>[0-9A-Za-z_-]+)(?P<suffix>/[^/.]+)?(?:\..*|/)?$
                not path_regexp ^/topics/index[/.]?
        }
 
This page took 0.020807 seconds and 4 git commands to generate.