diff options
author | Rafed Muhammad Yasir <rafed123@yahoo.com> | 2020-05-09 02:39:30 +0300 |
---|---|---|
committer | Rafed Muhammad Yasir <rafed123@yahoo.com> | 2020-05-09 02:39:30 +0300 |
commit | 5c0f778888a3cddc67f1f0c88dc26137aa112235 (patch) | |
tree | d5c2780d789860b216796f2b8014e6930e35aeb9 | |
parent | 2741f3632c2a634ce782a6c02d253fa03302cb00 (diff) |
Added shortcode for local image
-rw-r--r-- | layouts/_default/single.html | 4 | ||||
-rw-r--r-- | layouts/shortcodes/local-img.html | 14 | ||||
-rw-r--r-- | layouts/shortcodes/local-link.html (renamed from layouts/shortcodes/local.html) | 0 | ||||
-rw-r--r-- | static/css/ramium.css | 6 |
4 files changed, 20 insertions, 4 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 0c953be..3a30fb3 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -36,7 +36,9 @@ <div class="blog-text"> {{ with .Params.image }} - <img src="{{ . | relURL }}"> + <figure> + <img src="{{ . | relURL }}"> + </figure> {{ end }} {{ .Content }} diff --git a/layouts/shortcodes/local-img.html b/layouts/shortcodes/local-img.html new file mode 100644 index 0000000..3fe9e52 --- /dev/null +++ b/layouts/shortcodes/local-img.html @@ -0,0 +1,14 @@ +{{ if .IsNamedParams }} + +<figure> + <img src="{{.Get "src" | relURL }}" + {{ if .Get "caption" }} + alt="{{.Get "caption"}}" + {{ end }} + > + {{ if .Get "caption" }} + <figcaption>{{.Get "caption"}}</figcaption> + {{ end }} +</figure> + +{{ end }}
\ No newline at end of file diff --git a/layouts/shortcodes/local.html b/layouts/shortcodes/local-link.html index 75938ea..75938ea 100644 --- a/layouts/shortcodes/local.html +++ b/layouts/shortcodes/local-link.html diff --git a/static/css/ramium.css b/static/css/ramium.css index 1f6fa5f..c9ad24d 100644 --- a/static/css/ramium.css +++ b/static/css/ramium.css @@ -84,12 +84,12 @@ input:focus::placeholder { } .blog-text img { - max-width: 85%; + /* max-width: 85%; */ display: block; margin-left: auto; margin-right: auto; - margin-top: 1em; - margin-bottom: 1.5em; + /* margin-top: 1em; + margin-bottom: 1.5em; */ } .blog .blog-text p { |