-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added figgallery -- still needs work
- Loading branch information
1 parent
0042330
commit 254683f
Showing
6 changed files
with
213 additions
and
1 deletion.
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,126 @@ | ||
/* Part of figset module */ | ||
div.figrow { | ||
margin: 0; | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
} | ||
|
||
figure.figset { | ||
margin: 0 1em 0.5em; | ||
width: fit-content; | ||
display: table; | ||
} | ||
figure.figset figcaption { | ||
display: table-caption; | ||
caption-side: bottom; | ||
} | ||
figure.figset img, figure.figset video { | ||
max-width: 100%; | ||
display: table-cell; | ||
} | ||
|
||
div.figrow.figrow-jccenter { | ||
justify-content: center; | ||
} | ||
div.figrow.figrow-jccenter figcaption.figset-caption { | ||
text-align: center; | ||
} | ||
|
||
div.figrow.figrow-jcstart { | ||
justify-content: flex-start; | ||
} | ||
div.figrow.figrow-jcstart figcaption.figset-caption { | ||
text-align: start; | ||
} | ||
|
||
div.figrow.figrow-jcend { | ||
justify-content: flex-end; | ||
} | ||
div.figrow.figrow-jcend figcaption.figset-caption { | ||
text-align: end; | ||
} | ||
|
||
div.figrow.figrow-jcaround { | ||
justify-content: space-around; | ||
} | ||
div.figrow.figrow-jcaround figcaption.figset-caption { | ||
text-align: center; | ||
} | ||
|
||
div.figrow.figrow-jcbetween { | ||
justify-content: space-between; | ||
} | ||
div.figrow.figrow-jcbetween figcaption.figset-caption { | ||
text-align: center; | ||
} | ||
|
||
div.figrow.figrow-jcevenly { | ||
justify-content: space-evenly; | ||
} | ||
div.figrow.figrow-jcevenly figcaption.figset-caption { | ||
text-align: center; | ||
} | ||
|
||
figure.figset.figset-ascenter { | ||
align-self: center; | ||
} | ||
|
||
figure.figset.figset-asstretch { | ||
align-self: stretch; | ||
} | ||
|
||
figure.figset.figset-asbaseline { | ||
align-self: baseline; | ||
} | ||
|
||
figure.figset.figset-asstart { | ||
align-self: flex-start; | ||
} | ||
|
||
figure.figset.figset-asend { | ||
align-self: flex-end; | ||
} | ||
|
||
figure.figset.figset-posstart { | ||
float: left !important; | ||
float: inline-start !important; | ||
margin-left: 0 !important; | ||
margin-inline-start: 0 !important; | ||
} | ||
figure.figset.figset-posstart figcaption.figset-caption { | ||
text-align: left !important; | ||
text-align: start !important; | ||
} | ||
|
||
figure.figset.figset-posend { | ||
float: right !important; | ||
float: inline-end !important; | ||
margin-right: 0 !important; | ||
margin-inline-end: 0 !important; | ||
} | ||
figure.figset.figset-posend figcaption.figset-caption { | ||
text-align: right !important; | ||
text-align: end !important; | ||
} | ||
|
||
figure.figset.figset-poscenter { | ||
margin-right: auto !important; | ||
margin-left: auto !important; | ||
} | ||
figure.figset.figset-poscenter figcaption.figset-caption { | ||
text-align: center !important; | ||
} | ||
|
||
/* Classes for testing: */ | ||
.figset-test1 { | ||
background: blue; | ||
padding: 1em; | ||
} | ||
|
||
.figset-test2 { | ||
background: green; | ||
padding: 1em; | ||
} | ||
|
||
/*# sourceMappingURL=figset.css.map */ |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{{- /* | ||
|
||
figgallery partial | ||
|
||
Generates a figrow from all the images in a folder (or other source). | ||
|
||
Can be called directly, or via the figgallery shortcode. | ||
Note that the shortcode can put more things in the dict to be accessed | ||
from the figset shortcode: this doesn't work when using the partials directly, | ||
so common values, e.g. gallery or size, have to be in each invocation of figset. | ||
|
||
Parameters (in the dict/context): | ||
* sort - "date" or "name" or "shuffle" | ||
* order - "asc" or "desc", default "asc" | ||
|
||
* justify - values as for CSS's justify-content | ||
Accepts these values: | ||
center*|centre* start*|left*|flex-start end*|right*|flex-end around*|space-around between*|space-between evenly*|space-evenly | ||
where values with an asterisk can be abbreviated as long as they're not ambiguous. | ||
* id - CSS id for the figrow div | ||
* class -- CSS class(es) for the figrow div | ||
|
||
If from another template (rather than via shortcodes), do this: | ||
(note use of "figrow true" to tell figset that it's in a row) | ||
{{ partial "figrow_start.html" (dict "site" .Site "page" .Page "justify-contents" "center" "align-items" "top" "size" "small" ...) }} | ||
{{ partial "figset.html" (dict "site" .Site "page" .Page "figrow" true "gallery" "foo" "name" "image1.jpg" "caption" "a photo" ...) }} | ||
{{ partial "figset.html" (dict "site" .Site "page" .Page "figrow" true "gallery" "foo" "name" "image2.jpg" "caption" "another photo" ...) }} | ||
{{ partial "figrow_end.html" (dict "site" .Site "page" .Page) }} | ||
|
||
*/ -}} | ||
|
||
{{ $site := .site }} | ||
{{ $page := .page }} | ||
|
||
{{- $sort := lower .sort | default "shuffle" -}} | ||
{{- $order := lower .order | default "asc" -}} | ||
|
||
{{ $images := $page.Resources.ByType "image" }} | ||
{{ if eq $sort "shuffle" }} | ||
{{ $images = shuffle $images }} | ||
{{ else }} | ||
{{ $images = sort $images $sort $order }} | ||
{{ end }} | ||
|
||
{{ partial "figrow_start.html" (dict "site" $site "page" $page "justify-contents" "center" "align-items" "center" ) }} | ||
{{/* range ($page.Resources.ByType "image") | shuffle */}} | ||
{{ range $images }} | ||
{{ partial "figset.html" (dict "site" $site "page" $page "figrow" true "gallery" "foo" "xname" "image1.jpg" "image" . "size" "small" ) }} | ||
{{ end }}{{/* range */}} | ||
{{ partial "figrow_end.html" (dict "site" $site "page" $page) }} |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{{- /* figgallery.html -- shortcode for | ||
|
||
... | ||
TODO what about clearing before the row? | ||
Parameters: -- see partials/figrow_start.html | ||
* justify - values as for CSS's justify-content | ||
* clear - if true, adds a clear=both after the figrow. | ||
* id | ||
* class | ||
* figsetclass | ||
* debug - set true to output debug information as warnings | ||
NOTE Other figset options can be set for figrow and will be used in figset | ||
e.g. {{< figrow size=large >}}{{ figset name="x.png" }}{{ figset name="y.jpg" size=small }}... | ||
sets size for x.png to large without any work here. For y.jpg, small will override the setting in figrow. | ||
These are obtained in partials/figset.html via e.g. {{ .Parent.Get "size" }} | ||
|
||
*/ -}} | ||
|
||
{{- /* Get parameters and apply defaults */ -}} | ||
{{- $justify := .Get "justify" -}} | ||
{{- $clear := .Get "clear" -}} | ||
{{- $id := .Get "id" -}} | ||
{{- $class := .Get "class" -}} | ||
{{- $figsetclass := .Get "figsetclass" -}} | ||
{{- $debug := .Get "debug" -}} | ||
|
||
{{- /* We DON'T need to deal with parameters used by figset via its .Parent -- the shortcode mechanism handles that automatically. */ -}} | ||
|
||
{{- partial "figgallery.html" (dict "site" .Site "page" .Page ) -}} | ||
|