cache local instance (#572)

* cache local instance

fix #564

* don't use local instance cache for plm

* use instance cache for plm, but initialize it

* cargo fmt
This commit is contained in:
fdb-hiroshima
2019-05-10 22:59:34 +02:00
committed by Baptiste Gelez
parent 5b50f90d2b
commit 773fbfe7c8
20 changed files with 123 additions and 88 deletions
+2 -2
View File
@@ -14,7 +14,7 @@
<section>
<figure class="media">
@Html(media.html(ctx.0).unwrap_or_else(|_| SafeString::new("")))
@Html(media.html().unwrap_or_else(|_| SafeString::new("")))
<figcaption>@media.alt_text</figcaption>
</figure>
<div>
@@ -22,7 +22,7 @@
@i18n!(ctx.1, "Markdown syntax")
<small>@i18n!(ctx.1, "Copy it into your articles, to insert this media:")</small>
</p>
<code>@media.markdown(ctx.0).unwrap_or_else(|_| SafeString::new(""))</code>
<code>@media.markdown().unwrap_or_else(|_| SafeString::new(""))</code>
</div>
<div>
@if media.category() == MediaCategory::Image {
+1 -1
View File
@@ -20,7 +20,7 @@
<div class="card">
<div class="cover media-preview @media.category().to_string()"
@if media.category() == MediaCategory::Image {
style="background-image: url('@media.url(ctx.0).unwrap_or_default()')"
style="background-image: url('@media.url().unwrap_or_default()')"
}
></div>
<main>