-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡ update image render hook (embed, inline svg images)
📄 README.MD update
- Loading branch information
1 parent
5afc9d3
commit 18f6d35
Showing
5 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,8 @@ a { | |
} | ||
p { | ||
line-height: 1.6; | ||
} | ||
} | ||
img { | ||
width: 100%; | ||
height: auto; | ||
} |
Binary file renamed
BIN
+98.2 KB
assets/images/Lotus Docs Screenshot.png → assets/images/lotus_docs_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,33 @@ | ||
{{ $dest := .Destination }} | ||
{{ $text := .PlainText }} | ||
{{ $url := urls.Parse $dest }} | ||
|
||
{{ $image := newScratch }} | ||
{{ with $url.Scheme }} | ||
{{ $image.Set "resource" (resources.GetRemote $dest) }} | ||
{{ else }} | ||
{{ $image.Set "resource" (resources.Get $dest) }} | ||
{{ end }} | ||
|
||
{{ if .Title }} | ||
<figure> | ||
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" loading="lazy"> | ||
{{ with ($image.Get "resource") }} | ||
{{ if eq .MediaType.SubType "svg" }} | ||
{{ .Content | safeHTML }} | ||
{{ else }} | ||
<img src="{{ .RelPermalink | safeURL }}" alt="{{ $text }}" width="{{ .Width }}" height="{{ .Height }}" loading="lazy"> | ||
{{ end }} | ||
{{ else }} | ||
<img src="{{ .Destination | safeURL }}" alt="{{ $text }}" width="{{ .Width }}" height="{{ .Height }}" loading="lazy"> | ||
{{ end }} | ||
<figcaption>{{ .Title | markdownify }}</figcaption> | ||
</figure> | ||
{{ else }} | ||
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" loading="lazy"> | ||
{{ with ($image.Get "resource") }} | ||
{{ if eq .MediaType.SubType "svg" }} | ||
{{ .Content | safeHTML }} | ||
{{ else }} | ||
<img src="{{ .RelPermalink | safeURL }}" alt="{{ $text }}" width="{{ .Width }}" height="{{ .Height }}" loading="lazy"> | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} |