Skip to content

Commit

Permalink
Add a shortcode for paragraph with a side image (left or right).
Browse files Browse the repository at this point in the history
This shortcode is a bit different from the `floating` shortcode. The content
is not floating around the image, but is rather visually put on a separate
column.
  • Loading branch information
gmantele committed Sep 30, 2024
1 parent 0796c88 commit ab52d74
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
12 changes: 12 additions & 0 deletions layouts/shortcodes/side-image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<section class="with-image {{ .Get "position" }}">
<aside>
{{- if (.Get "thumbnail") }}
<a href="{{ .Get "image" }}"><img src="{{- .Get "thumbnail" }}" /></a>
{{- else }}
<img src="{{- .Get "image" }}" />
{{- end }}
</aside>
<main>
{{- .Inner | markdownify }}
</main>
</section>
25 changes: 25 additions & 0 deletions static/css/ivoa.css
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,31 @@ section > main + aside { margin-left: 1em }
}


/* =============================================================================
SECTION WITH A SIDE IMAGE
*/

.with-image {
display : grid;
grid-template-columns: auto 1fr;
grid-template-areas : "image content";
column-gap: 1em;
}

.with-image.right {
grid-template-columns: 1fr auto;
grid-template-areas : "content image";
}

.with-image > aside {
grid-area : image;
margin-top: 1em;
}

.with-image > aside > img { max-width: 30vw }
.with-image > main { grid-area: content }


/* =============================================================================
CARROUSEL
*/
Expand Down

0 comments on commit ab52d74

Please sign in to comment.