Skip to content

Commit

Permalink
example with scaled images
Browse files Browse the repository at this point in the history
  • Loading branch information
spi43984 committed Oct 9, 2023
1 parent 0f957c9 commit 7fa551a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
26 changes: 26 additions & 0 deletions exampleSite/content/homepage/scaleImage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: "Example to Scale Images"
header_menu_title: "Scale Image"
navigation_menu_title: "Scale Image"
weight: 5
header_menu: true
---

 

#### Full Size

![Jane Doe](images/happy-ethnic-woman_2000x2000_transparent.png)

#### 60% Size

![Jane Doe](images/happy-ethnic-woman_2000x2000_transparent.png "60%")

#### 20% Size

![Jane Doe](images/happy-ethnic-woman_2000x2000_transparent.png "20%")


#### Lorem ipsum

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- $image := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) -}}
<img
src="{{ .Destination | safeURL }}" alt="{{ .Text }}"
{{ with $image }}
width="{{ $image.Width }}" height="{{ $image.Height }}"
{{ end }}
{{ with .Title}} style="width: 100%; max-width: {{ . }};"{{ end }}
/>

0 comments on commit 7fa551a

Please sign in to comment.