33(subproject) {
44 # Caddy doesn't know this is a directory, so redirect to trailing / as
55 # would usually happen for them.
6- redir /{args[0 ]} /{args[0 ]}/ permanent
6+ redir /{args[1 ]} /{args[1 ]}/ permanent
77
8- handle_path /{args[0 ]}/* {
8+ handle_path /{args[1 ]}/* {
99 root * {{ caddy.site_dir }}/{args[0]}
1010 try_files {path}.html {path}
1111 file_server {
@@ -70,8 +70,8 @@ http://{{ caddy.addresses.main }}, http://{{ ansible_fqdn }} {
7070
7171 root * {{ caddy.site_dir }}
7272
73- {% for site in repos %}
74- import subproject {{ site }}
73+ {% for site , path in repos . items () %}
74+ import subproject {{ site }} {{ path | default(site, true) }}
7575{% endfor %}
7676
7777 # Hide mpl-altair until the site is fixed.
@@ -96,6 +96,16 @@ http://{{ caddy.addresses.main }}, http://{{ ansible_fqdn }} {
9696 }
9797 }
9898
99+ # Redirect the repo-named third-party packages path to the more-generic path.
100+ redir /3pp /thirdpartypackages/ # And also add a shortcut.
101+ @mpl-third-party path /mpl-third-party /mpl-third-party/*
102+ handle @mpl-third-party {
103+ route {
104+ uri strip_prefix /mpl-third-party
105+ redir * /thirdpartypackages{uri}
106+ }
107+ }
108+
99109 # Place the brochure site at the top level.
100110 @brochure file {
101111 root {{ caddy.site_dir }}/mpl-brochure-site
0 commit comments