feat: serve list.js from local

This commit is contained in:
Anna 2022-07-04 15:44:58 -04:00
parent 06e6a396d2
commit dcd0143b80
3 changed files with 11 additions and 1 deletions

2
server/assets/list.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -152,6 +152,7 @@ fn assets() -> BoxedFilter<(impl Reply, )> {
.or(d3())
.or(pico())
.or(common_js())
.or(list_js())
)
.boxed()
}
@ -232,6 +233,13 @@ fn index() -> BoxedFilter<(impl Reply, )> {
warp::get().and(route).boxed()
}
fn list_js() -> BoxedFilter<(impl Reply, )> {
warp::path("list.js")
.and(warp::path::end())
.and(warp::fs::file("./assets/list.min.js"))
.boxed()
}
fn listings(state: Arc<State>) -> BoxedFilter<(impl Reply, )> {
async fn logic(state: Arc<State>, codes: Option<String>) -> std::result::Result<impl Reply, Infallible> {
let lang = Language::from_codes(codes.as_deref());

View File

@ -7,7 +7,7 @@ xivpf - listings
{% block head %}
<link rel="stylesheet" href="/assets/common.css"/>
<link rel="stylesheet" href="/assets/listings.css"/>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js"></script>
<script defer src="/assets/list.js"></script>
<script defer src="/assets/listings.js"></script>
{% endblock %}