simplify figure cache (#11)

pull/12/head
septs 2023-03-30 17:14:01 +08:00 committed by GitHub
parent ebc9c105ce
commit 27cdd6a880
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -142,7 +142,7 @@ keywords: [补佳乐, 戊酸雌二醇片, 舌下含服, 用法用量]
[wiki17]: https://en.wiktionary.org/wiki/concentration-time_curve
[wiki18]: https://en.wikipedia.org/wiki/Premenopause
[wiki19]: https://en.wikipedia.org/wiki/Menstrual_cycle
[fig1]: fig1.png
[fig1]: https://upload.wikimedia.org/wikipedia/commons/0/0c/Hormone_levels_with_oral_estradiol_valerate_tablets_%28Progynova%29_taken_sublingually_in_premenopausal_women.png
[wiki20]: https://en.wikipedia.org/wiki/Progesterone
[wiki21]: https://en.wikipedia.org/wiki/Luteinizing_hormone
[wiki22]: https://en.wikipedia.org/wiki/Follicle-stimulating_hormone

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 KiB

View File

@ -1,5 +1,10 @@
{{- $src := .Destination -}}
{{- if and (getenv "CI") (hasPrefix $src "https://transfemscience.org/assets/images/") -}}
{{-
$cachable := or
(hasPrefix $src "https://transfemscience.org/assets/images/")
(hasPrefix $src "https://upload.wikimedia.org/wikipedia/commons/")
-}}
{{- if and (getenv "CI") $cachable -}}
{{- $image := resources.GetRemote $src -}}
{{- if $image -}}
{{- if eq $image.MediaType.SubType "svg" -}}