|
6 | 6 | redir /{args.0} /{args.0}/ permanent |
7 | 7 |
|
8 | 8 | handle_path /{args.0}/* { |
9 | | - root * {$SITE_DIR:sites}/{args.0} |
| 9 | + root * {{ caddy.site_dir }}/{args.0} |
10 | 10 | try_files {path}.html {path} |
11 | 11 | file_server |
12 | 12 | } |
13 | 13 | } |
14 | 14 |
|
15 | | -# Set this variable in the environment when running in production. |
16 | | -{$SITE_ADDRESS::2015} { |
17 | | - # Set the variable in the environment to the Caddy directive for tls |
18 | | - # support. By default, this is empty so you can test it locally, but |
19 | | - # the Ansible config sets it up with the right certificate paths. |
20 | | - {$TLS_CONFIG:} |
| 15 | +{{ caddy.address }} { |
| 16 | +{% if caddy.tls_config is defined %} |
| 17 | + {{ caddy.tls_config }} |
| 18 | +{% endif %} |
21 | 19 |
|
22 | | - root * {$SITE_DIR:.} |
| 20 | + root * {{ caddy.site_dir }} |
23 | 21 |
|
24 | 22 | # Setup a webhook |
25 | 23 | handle /gh/* { |
|
49 | 47 | } |
50 | 48 | } |
51 | 49 |
|
52 | | - import subproject basemap |
53 | | - import subproject cheatsheets |
54 | | - import subproject cycler |
55 | | - import subproject devdocs |
56 | | - import subproject governance |
57 | | - import subproject matplotblog |
58 | | - import subproject mpl-altair |
59 | | - import subproject mpl-bench |
60 | | - import subproject mpl-gui |
61 | | - import subproject mpl-third-party |
| 50 | +{% for site in repos %} |
| 51 | + import subproject {{ site }} |
| 52 | +{% endfor %} |
62 | 53 |
|
63 | 54 | # redirect the objects.inv |
64 | 55 | redir /objects.inv /stable/objects.inv permanent |
65 | 56 |
|
66 | 57 | # Place the brochure site at the top level. |
67 | | - import subproject mpl-brochure-site |
68 | 58 | @brochure file { |
69 | | - root {$SITE_DIR:sites}/mpl-brochure-site |
| 59 | + root {{ caddy.site_dir }}/mpl-brochure-site |
70 | 60 | try_files {path}.html {path} |
71 | 61 | } |
72 | 62 | rewrite / /mpl-brochure-site/index.html |
73 | 63 | rewrite @brochure /mpl-brochure-site{http.matchers.file.relative} |
74 | 64 |
|
75 | 65 | # Finally try any of the versioned docs. |
76 | 66 | handle { |
77 | | - root * {$SITE_DIR:sites}/matplotlib.github.com |
| 67 | + root * {{ caddy.site_dir }}/matplotlib.github.com |
78 | 68 | try_files {path}.html {path} |
79 | 69 | file_server |
80 | 70 | } |
81 | 71 |
|
82 | 72 | # Use a custom 404 error page. |
83 | 73 | handle_errors { |
84 | 74 | @notfound expression {http.error.status_code} == 404 |
85 | | - root * {$SITE_DIR:sites}/mpl-brochure-site |
| 75 | + root * {{ caddy.site_dir }}/mpl-brochure-site |
86 | 76 | rewrite @notfound /404.html |
87 | 77 | file_server |
88 | 78 | } |
|
0 commit comments