diff options
author | Chen Zhe <chenzhesg@gmail.com> | 2020-02-19 18:55:27 +0300 |
---|---|---|
committer | Chen Zhe <chenzhesg@gmail.com> | 2020-02-19 18:55:27 +0300 |
commit | c15ebde8032b2cf3c068174f713b8df6f28e3623 (patch) | |
tree | 62bbc0f51eba6a6a593c4b7ce9ea42acf3273c88 | |
parent | 8226251fb0f5980e76d17da242194e5141736ff7 (diff) |
add config to disable EXIF display
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | layouts/index.html | 3 |
3 files changed, 5 insertions, 1 deletions
@@ -57,6 +57,8 @@ After installing the theme successfully it requires a just a few more steps to g Take a look inside the [`exampleSite`](https://github.com/Chen-Zhe/photo-grid/blob/master/exampleSite) folder of this theme. You'll find a file called [`config.toml`](https://github.com/Chen-Zhe/photo-grid/blob/master/exampleSite/config.toml). To use it, copy the `config.toml` in the root folder of your Hugo site. Feel free to change the strings in this theme. +EXIF info display can be disabled by setting `no_exif = true` in the config + ### Photo Management All photos are stored in the [`photo`](https://github.com/Chen-Zhe/photo-grid/blob/master/exampleSite/content/photo) folder under the `content` folder. You can put multiple directories under it and the theme will enumerate all photos within in order of the directory listing. Within each subfolder, e.g. [`1-trip1`](https://github.com/Chen-Zhe/photo-grid/blob/master/exampleSite/content/photo/1-trip1), you can put all relevant photos in it and then copy over the `index.md` file. diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 8b30451..97f9ac4 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -9,6 +9,7 @@ theme = "photo-grid" [params] # Meta + no_exif = false title = "Photo Grid - Grid Gallery" subtitle = "A customized theme for showing your photography work with minimal effort and multiple customization options. Click on each image to find out more about this theme" author = "Chen Zhe" diff --git a/layouts/index.html b/layouts/index.html index 16ef071..3a41a46 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -16,6 +16,7 @@ data-title="{{ $image.Name }}" data-description="{{ $image.Params.description | markdownify }}" {{ if isset $image.Params "button_text" }}data-buttontext="{{ $image.Params.button_text }}"{{ end }} data-collection="{{ $page.Title }}" + {{ if not $.Site.Params.no_exif }} data-exif="{{ if in (slice "jpg" "jpeg" "tiff" "tif") $image.MediaType.SubType }} {{- with $image.Exif -}} {{- with .Tags -}} @@ -32,7 +33,7 @@ {{- end -}} <li>Taken at {{ if isset $image.Params "timestamp" }} {{ $image.Params.timestamp }} {{ else }}{{ .Date.Format "2006-1-2 15:04" }}{{ end }}</li> {{- end }} - {{- end }}"> + {{- end }}"{{ end }}> {{ $.Scratch.Set "thumbnail" ($image.Resize "x250") }} <img class="lazy" data-src="{{ ($.Scratch.Get "thumbnail").RelPermalink }}" style="width:{{ ($.Scratch.Get "thumbnail").Width }}px;" alt="Thumbnail of {{ $image.Name }}"/> </a> |