Browse Source

initial commit

pull/2/head
Nicolas Massé 6 years ago
commit
9a9701467a
  1. 1
      .gitignore
  2. 20
      LICENSE
  3. 122
      README.md
  4. 19
      archetypes/album.md
  5. 430
      assets/css/master.scss
  6. 1
      exampleSite/.gitignore
  7. 4
      exampleSite/config.toml
  8. 1
      exampleSite/content/.gitignore
  9. 10
      exampleSite/content/animals/index.md
  10. 10
      exampleSite/content/architecture/index.md
  11. 7
      exampleSite/content/empty/index.md
  12. 10
      exampleSite/content/flowers/index.md
  13. 10
      exampleSite/content/food/index.md
  14. 7
      exampleSite/content/happy/index.md
  15. 10
      exampleSite/content/love/index.md
  16. 7
      exampleSite/content/people/index.md
  17. 7
      exampleSite/content/tints/index.md
  18. 7
      exampleSite/content/travel/index.md
  19. 130
      exampleSite/fetch-photos.sh
  20. 1
      exampleSite/themes/photo-stream
  21. 11
      i18n/en.yaml
  22. 10
      i18n/fr.yaml
  23. 8
      layouts/404.html
  24. 33
      layouts/_default/album.html
  25. 7
      layouts/_default/baseof.html
  26. 8
      layouts/_default/list.html
  27. 6
      layouts/_default/single.html
  28. 55
      layouts/partials/head.html
  29. 8
      layouts/partials/links.html
  30. 45
      layouts/partials/photos.html
  31. BIN
      static/favicon.png
  32. 12
      static/favicon.svg
  33. 7
      static/img/icon-github.svg
  34. 11
      static/img/icon-info.svg
  35. 14
      static/img/icon-left.svg
  36. 10
      static/img/icon-right.svg
  37. 7
      static/img/icon-rss.svg
  38. 10
      static/img/icon-twitter.svg
  39. 6
      static/js/lazy-loading.js
  40. 104
      static/js/photos.js
  41. BIN
      static/social-preview.png
  42. BIN
      static/touch-icon-iphone.png
  43. 20
      theme.toml

1
.gitignore

@ -0,0 +1 @@
.vscode

20
LICENSE

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2020 YOUR_NAME_HERE
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

122
README.md

@ -0,0 +1,122 @@
# Photo Stream
A theme to showcase your photo albums, powered by [Hugo](https://gohugo.io).
A live demo is available [at photo-stream.netlify.com](https://photo-stream.netlify.com/).
## Features
This theme is basically a port of [maxvoltar's photo-stream theme](https://github.com/maxvoltar/photo-stream).
Thanks to him for this nice creation!
This theme features:
* Lazy loading of photos (a photo is downloaded when it appears in the viewport)
* Albums containing photos
* Photos thumbnail are resized to fit 800x800
* The large version is resized to fit 2048x2048
* The background is filled with a tint matching the photo
* Keyboard shortcuts for previous / next / back to list
## Installation
You can install the theme either as a clone or submodule.
I recommend the latter. From the root of your Hugo site, type the following:
```sh
git submodule add https://github.com/nmasse-itix/photo-stream.git themes/photo-stream
git submodule init
git submodule update
```
Now you can get updates of this theme in the future by updating the submodule:
```sh
git submodule update --remote themes/photo-stream
```
## Configuration
After installation, take a look at the `exampleSite` folder inside `themes/photo-stream`.
To get started, copy the `config.toml` file inside `exampleSite` to the root of your Hugo site:
```sh
cp themes/photo-stream/exampleSite/config.toml .
```
Now edit this file and add your own information. Note that some fields can be omitted.
## Demo Website
A live demo is available [at photo-stream.netlify.com](https://photo-stream.netlify.com/) but you can have a look by yourself at the example site.
```sh
cd themes/photo-stream
./fetch-photos.sh
hugo serve
```
## How to create an album
The theme provides an **archetype** named `album`.
Create a new album with the `hugo new` command.
```sh
hugo new my-album/index.md -k album
```
## How to add photos
To add photos to an album, simply copy your JPEG files in the album directory, **under content, NOT static!**
```sh
cp path/to/DCIM_*.jpeg content/my-album/
```
## How to customize an album
A minimal `index.md` looks like this:
```yaml
---
date: "2016-01-01"
title: Animals
- src: '**.jpeg'
---
```
This index file defines an album with a date, a title and instructs to add all JPEG files to the album.
But a usual `index.md` would include more customization:
```yaml
---
date: "2016-01-01"
title: Animals
sort_by: "Exif.Date"
resources:
- src: 'camel.jpeg'
params:
cover: true
- src: '**.jpeg'
- src: '**.jpg'
---
```
This index also specifies:
* To sort photos by date (specified in the EXIF metadata).
* To also include files with `.jpg` extension.
* To set `camel.jpeg` as the cover photo for the album.
## Global configuration
The Date format for the album can be set in your `config.toml`.
```toml
[params]
album_date_format = "01/2006"
```
Check the Go documentation for possible formats: [time.Format](https://golang.org/pkg/time/#Time.Format).

19
archetypes/album.md

@ -0,0 +1,19 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
# By default, photos are sorted by filename
sort_by: Name
# But you can sort instead by EXIF date if you prefer
# sort_by: Exif.Date
resources:
#
# You can set the album cover image by setting the param 'cover: true'
# on a photo.
#
# - src: 'IMG_1234.jpeg'
# params:
# cover: true
#
- src: '**.jpeg'
- src: '**.jpg'
---

430
assets/css/master.scss

@ -0,0 +1,430 @@
* {
padding: 0;
margin: 0;
list-style: none;
font-size: 1em;
box-sizing: border-box;
}
@mixin dark {
@media (prefers-color-scheme: dark) {
@content
}
}
@mixin button {
display: block;
border-radius: 16px;
text-indent: 150%;
overflow: hidden;
white-space: nowrap;
width: 32px;
height: 32px;
background-repeat: no-repeat;
background-position: 8px;
background-size: 16px;
transition: background-color .1s linear;
-webkit-backdrop-filter: blur(20px);
-moz-backdrop-filter: blur(20px);
backdrop-filter: blur(20px);
background-color: rgba(200, 200, 200, .25);
// Disable until Safari supports `prefers-color-scheme` in SVG's
// @include dark {
// background-color: rgba(0, 0, 0, .25);
// }
&:hover,
&:focus {
background-color: rgba(200, 200, 200, .5);
// Disable until Safari supports `prefers-color-scheme` in SVG's
// @include dark {
// background-color: rgba(0, 0, 0, .5);
// }
}
&:active {
background-color: rgba(200, 200, 200, .25);
// Disable until Safari supports `prefers-color-scheme` in SVG's
// @include dark {
// background-color: rgba(0, 0, 0, .75);
// }
}
}
body,
html {
min-height: 100%;
display: flex;
}
body {
flex-grow: 1;
font: 16px/24px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
background: #fff;
color: #2e2f30;
@include dark {
background: #000;
color: #eee;
}
}
// PHOTO GRID
.grid {
display: flex;
flex-wrap: wrap;
position: relative;
align-content: flex-start;
&:after {
content: "";
display: block;
flex-grow: 10;
outline: 2px solid #fff;
position: relative;
@include dark {
outline-color: #000;
}
}
.item {
height: 40vh;
flex-grow: 1;
outline: 2px solid #fff;
position: relative;
background-size: 100%;
@include dark {
outline-color: #000;
}
img {
max-height: 100%;
min-width: 100%;
min-height: 100%;
width: auto;
object-fit: cover;
display: block;
}
.open,
.close {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
text-indent: 150%;
overflow: hidden;
white-space: nowrap;
}
.open {
cursor: zoom-in;
background-color: rgba(0, 0, 0, 0);
transition: background-color .15s ease-out;
&:hover,
&:focus {
background-color: rgba(0, 0, 0, .25);
}
&:active {
background-color: rgba(0, 0, 0, .5);
}
}
.close {
display: none;
cursor: zoom-out;
}
.full {
display: none;
}
.previous,
.next {
position: absolute;
top: 0;
bottom: 0;
left: 0;
z-index: 20;
width: 80px;
display: none;
align-items: center;
justify-content: center;
span {
@include button;
background-image: url(../img/icon-left.svg);
pointer-events: none;
}
&:hover,
&:focus {
span {
background-color: rgba(200, 200, 200, .5);
// Disable until Safari supports `prefers-color-scheme` in SVG's
// @include dark {
// background-color: rgba(0, 0, 0, .5);
// }
}
}
&:active {
span {
background-color: rgba(200, 200, 200, .25);
// Disable until Safari supports `prefers-color-scheme` in SVG's
// @include dark {
// background-color: rgba(0, 0, 0, .75);
// }
}
}
}
.next {
right: 0;
left: auto;
span {
background-image: url(../img/icon-right.svg);
}
}
.name {
display: flex;
position: absolute;
right: 4px;
bottom: 12px;
color: #fff;
text-shadow: #000 0 1px 1px, #000 0 2px 4px;
opacity: 1;
font-size: larger;
margin-right: 12px;
}
.date {
display: flex;
position: absolute;
left: 4px;
bottom: 12px;
color: #fff;
text-shadow: #000 0 1px 1px, #000 0 2px 4px;
opacity: 1;
margin-left: 12px;
}
// PHOTO DETAIL
&.target {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
height: 100%;
z-index: 10;
background: #fff;
display: flex;
align-items: center;
@media (prefers-color-scheme: dark) {
background: #000;
}
.open {
display: none;
}
.close {
display: block;
}
img {
object-fit: contain;
animation: fade-in .5s ease-out;
}
.full {
display: flex;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
animation: fade-in .5s ease-out;
span {
flex-grow: 1;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
}
.meta {
display: none !important;
}
.previous,
.next {
display: flex;
}
}
}
}
// SOCIAL LINKS
.links {
position: fixed;
bottom: 24px;
right: 24px;
display: flex;
flex-wrap: wrap;
margin-left: 16px;
li {
margin-left: 8px;
a {
@include button;
}
&.github {
a {
background-image: url(../img/icon-github.svg);
}
}
&.rss {
a {
background-image: url(../img/icon-rss.svg);
}
}
&.link {
a {
text-indent: 0;
width: auto;
font-size: 13px;
line-height: 32px;
text-transform: uppercase;
padding: 0 12px;
color: rgba(0, 0, 0, .75);
font-weight: 600;
text-decoration: none;
}
}
}
}
// 404
.four-oh-four {
flex-grow: 1;
display: flex;
flex-direction: column;
height: 100%;
padding: 64px;
align-items: center;
justify-content: center;
text-align: center;
img {
width: 64px;
vertical-align: bottom;
margin-bottom: 24px;
}
h1 {
font-size: 32px;
line-height: 48px;
font-weight: 700;
}
p {
margin-bottom: 32px;
}
a {
@include button;
text-indent: 0;
width: auto;
font-size: 13px;
line-height: 32px;
text-transform: uppercase;
padding: 0 12px;
color: rgba(0, 0, 0, .75);
font-weight: 600;
text-decoration: none;
}
}
// RESPONSIVE
@media (max-aspect-ratio: 1/1) {
.grid {
.item {
height: 30vh;
}
}
}
@media (max-height: 480px) {
.grid {
.item {
height: 80vh;
}
}
}
@media (max-aspect-ratio: 1/1) and (max-width: 480px) {
.grid {
flex-direction: row;
.item {
height: auto;
width: 100%;
img {
width: 100%;
height: auto;
}
.previous,
.next {
width: 25vw;
max-width: auto;
span {
display: none;
}
}
.previous {
cursor: w-resize;
}
.next {
cursor: e-resize;
}
}
}
}
// ANIMATIONS
@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

1
exampleSite/.gitignore

@ -0,0 +1 @@
resources

4
exampleSite/config.toml

@ -0,0 +1,4 @@
title = "Photo Stream"
theme = "photo-stream"
[params]
album_date_format = "2006"

1
exampleSite/content/.gitignore

@ -0,0 +1 @@
*.jpeg

10
exampleSite/content/animals/index.md

@ -0,0 +1,10 @@
---
date: "2016-01-01"
title: Animals
sort_by: "Name"
resources:
- src: 'camel.jpeg'
params:
cover: true
- src: '**.jpeg'
---

10
exampleSite/content/architecture/index.md

@ -0,0 +1,10 @@
---
date: "2020-01-01"
title: Architecture
sort_by: "Name"
resources:
- src: 'archi10.jpeg'
params:
cover: true
- src: '**.jpeg'
---

7
exampleSite/content/empty/index.md

@ -0,0 +1,7 @@
---
date: "2020-01-01"
title: Architecture
sort_by: "Exif.Date"
resources:
- src: '**.jpeg'
---

10
exampleSite/content/flowers/index.md

@ -0,0 +1,10 @@
---
date: "2019-01-01"
title: Flowers
sort_by: "Name"
resources:
- src: 'flower09.jpeg'
params:
cover: true
- src: '**.jpeg'
---

10
exampleSite/content/food/index.md

@ -0,0 +1,10 @@
---
date: "2017-01-01"
title: Food and drink
sort_by: "Name"
resources:
- src: 'food06.jpeg'
params:
cover: true
- src: '**.jpeg'
---

7
exampleSite/content/happy/index.md

@ -0,0 +1,7 @@
---
date: "2015-01-01"
title: Happy
sort_by: "Name"
resources:
- src: '**.jpeg'
---

10
exampleSite/content/love/index.md

@ -0,0 +1,10 @@
---
date: "2014-01-01"
title: Love
sort_by: "Name"
resources:
- src: 'love02.jpeg'
params:
cover: true
- src: '**.jpeg'
---

7
exampleSite/content/people/index.md

@ -0,0 +1,7 @@
---
date: "2013-01-01"
title: People
sort_by: "Name"
resources:
- src: '**.jpeg'
---

7
exampleSite/content/tints/index.md

@ -0,0 +1,7 @@
---
date: "2012-01-01"
title: Tints
sort_by: "Name"
resources:
- src: '**.jpeg'
---

7
exampleSite/content/travel/index.md

@ -0,0 +1,7 @@
---
date: "2011-01-01"
title: Travel
sort_by: "Name"
resources:
- src: '**.jpeg'
---

130
exampleSite/fetch-photos.sh

@ -0,0 +1,130 @@
#!/bin/bash
function fetch() {
file=$1
url=$2
if [ ! -e "$1" ]; then
echo "Fetching $1... "
curl -sL -o "$1" "$2"
if [ "$?" -gt 0 ]; then
echo "Failed !"
fi
else
echo "Skipping $1, the file already exists!"
fi
}
fetch "content/animals/hawk.jpeg" "https://unsplash.com/photos/H27PUqaJyHU/download?force=true"
fetch "content/animals/dog.jpeg" "https://unsplash.com/photos/Am3RoG7GEl0/download?force=true"
fetch "content/animals/cat.jpeg" "https://unsplash.com/photos/G21-GaAZrrs/download?force=true"
fetch "content/animals/bee.jpeg" "https://unsplash.com/photos/VeRn-bKfoVA/download?force=true"
fetch "content/animals/monkey.jpeg" "https://unsplash.com/photos/4nPq-CMKfvY/download?force=true"
fetch "content/animals/turtle.jpeg" "https://unsplash.com/photos/_x-PryfGq0Y/download?force=true"
fetch "content/animals/horse.jpeg" "https://unsplash.com/photos/dr1Hbu8Gwt8/download?force=true"
fetch "content/animals/bird.jpeg" "https://unsplash.com/photos/YezZZpufVL4/download?force=true"
fetch "content/animals/bird2.jpeg" "https://unsplash.com/photos/ZbMJ5VLrpQ4/download?force=true"
fetch "content/animals/spider.jpeg" "https://unsplash.com/photos/BkV2pxgof-U/download?force=true"
fetch "content/animals/wolf.jpeg" "https://unsplash.com/photos/9rloii_qmmw/download?force=true"
fetch "content/animals/dog2.jpeg" "https://unsplash.com/photos/Oq9NDnlFQzU/download?force=true"
fetch "content/animals/fox.jpeg" "https://unsplash.com/photos/oCxaclJklOI/download?force=true"
fetch "content/animals/dog3.jpeg" "https://unsplash.com/photos/8o5uCdOQtko/download?force=true"
fetch "content/animals/camel.jpeg" "https://unsplash.com/photos/i_Z1o10BPPk/download?force=true"
fetch "content/animals/bee2.jpeg" "https://unsplash.com/photos/UPJ0vTjPFXE/download?force=true"
fetch "content/animals/wasp.jpeg" "https://unsplash.com/photos/R_W86FHa-Sk/download?force=true"
fetch "content/animals/dog4.jpeg" "https://unsplash.com/photos/Ugg-EIfzy0c/download?force=true"
fetch "content/animals/rabbit.jpeg" "https://unsplash.com/photos/8bOwZ8ag9UY/download?force=true"
fetch "content/animals/fish.jpeg" "https://unsplash.com/photos/l-QdJMZX7PU/download?force=true"
fetch "content/architecture/archi01.jpeg" "https://unsplash.com/photos/37Hk9D4Ig_4/download?force=true"
fetch "content/architecture/archi02.jpeg" "https://unsplash.com/photos/3pk1VnBeTQQ/download?force=true"
fetch "content/architecture/archi03.jpeg" "https://unsplash.com/photos/t1tAOh-CaZ4/download?force=true"
fetch "content/architecture/archi04.jpeg" "https://unsplash.com/photos/w6OniVDCfn0/download?force=true"
fetch "content/architecture/archi05.jpeg" "https://unsplash.com/photos/zZ97YKTyj7s/download?force=true"
fetch "content/architecture/archi06.jpeg" "https://unsplash.com/photos/tNGfc-2KNrc/download?force=true"
fetch "content/architecture/archi07.jpeg" "https://unsplash.com/photos/LmS1g1fqyas/download?force=true"
fetch "content/architecture/archi08.jpeg" "https://unsplash.com/photos/I-LFXWk3vLI/download?force=true"
fetch "content/architecture/archi09.jpeg" "https://unsplash.com/photos/4VBFrMweUw8/download?force=true"
fetch "content/architecture/archi10.jpeg" "https://unsplash.com/photos/lLs02_axGOw/download?force=true"
fetch "content/architecture/archi11.jpeg" "https://unsplash.com/photos/NJ3JeCFwj9g/download?force=true"
fetch "content/architecture/archi12.jpeg" "https://unsplash.com/photos/R63O6UiUEzg/download?force=true"
fetch "content/architecture/archi13.jpeg" "https://unsplash.com/photos/IU1QUXkD-90/download?force=true"
fetch "content/architecture/archi14.jpeg" "https://unsplash.com/photos/8o_x-NjXIcQ/download?force=true"
fetch "content/architecture/archi15.jpeg" "https://unsplash.com/photos/YKAUA_Rt6xI/download?force=true"
fetch "content/architecture/archi16.jpeg" "https://unsplash.com/photos/zUOqjnO_ZvM/download?force=true"
fetch "content/architecture/archi17.jpeg" "https://unsplash.com/photos/s07In41ntgg/download?force=true"
fetch "content/architecture/archi18.jpeg" "https://unsplash.com/photos/QsDEa0qvk20/download?force=true"
fetch "content/architecture/archi19.jpeg" "https://unsplash.com/photos/cxyPcOcClSE/download?force=true"
fetch "content/architecture/archi20.jpeg" "https://unsplash.com/photos/fwsiAb2LLZE/download?force=true"
fetch "content/flowers/flower01.jpeg" "https://unsplash.com/photos/EfhCUc_fjrU/download?force=true"
fetch "content/flowers/flower02.jpeg" "https://unsplash.com/photos/9A_peGrSbZc/download?force=true"
fetch "content/flowers/flower03.jpeg" "https://unsplash.com/photos/tu_mv6p2p5U/download?force=true"
fetch "content/flowers/flower04.jpeg" "https://unsplash.com/photos/koy6FlCCy5s/download?force=true"
fetch "content/flowers/flower05.jpeg" "https://unsplash.com/photos/ct_zXHu8rcM/download?force=true"
fetch "content/flowers/flower06.jpeg" "https://unsplash.com/photos/5lRxNLHfZOY/download?force=true"
fetch "content/flowers/flower07.jpeg" "https://unsplash.com/photos/iMdsjoiftZo/download?force=true"
fetch "content/flowers/flower08.jpeg" "https://unsplash.com/photos/OWq8w3BYMFY/download?force=true"
fetch "content/flowers/flower09.jpeg" "https://unsplash.com/photos/ATgfRqpFfFI/download?force=true"
fetch "content/flowers/flower10.jpeg" "https://unsplash.com/photos/YmPqWIQcl9c/download?force=true"
fetch "content/flowers/flower11.jpeg" "https://unsplash.com/photos/urUdKCxsTUI/download?force=true"
fetch "content/flowers/flower12.jpeg" "https://unsplash.com/photos/p7mo8-CG5Gs/download?force=true"
fetch "content/flowers/flower13.jpeg" "https://unsplash.com/photos/f0heeiu-Ec0/download?force=true"
fetch "content/flowers/flower14.jpeg" "https://unsplash.com/photos/IicyiaPYGGI/download?force=true"
fetch "content/flowers/flower15.jpeg" "https://unsplash.com/photos/KQ6sO8m1ZDE/download?force=true"
fetch "content/flowers/flower16.jpeg" "https://unsplash.com/photos/kkJuQhp9Kw0/download?force=true"
fetch "content/flowers/flower17.jpeg" "https://unsplash.com/photos/aolmXcUxr7Y/download?force=true"
fetch "content/flowers/flower18.jpeg" "https://unsplash.com/photos/zb2vBaHYB2I/download?force=true"
fetch "content/flowers/flower19.jpeg" "https://unsplash.com/photos/BlMj6RYy3c0/download?force=true"
fetch "content/flowers/flower20.jpeg" "https://unsplash.com/photos/whOkVvf0_hU/download?force=true"
fetch "content/food/food01.jpeg" "https://unsplash.com/photos/oyr21Ey_DPI/download?force=true"
fetch "content/food/food02.jpeg" "https://unsplash.com/photos/8CSYziKPFV4/download?force=true"
fetch "content/food/food03.jpeg" "https://unsplash.com/photos/8W1KIj8iWX4/download?force=true"
fetch "content/food/food04.jpeg" "https://unsplash.com/photos/D7NA2pEn3K0/download?force=true"
fetch "content/food/food05.jpeg" "https://unsplash.com/photos/IlnF2g_3tpY/download?force=true"
fetch "content/food/food06.jpeg" "https://unsplash.com/photos/qNhe2QXzLuo/download?force=true"
fetch "content/food/food07.jpeg" "https://unsplash.com/photos/1J1mEZbag4I/download?force=true"
fetch "content/food/food08.jpeg" "https://unsplash.com/photos/phEaeqe555M/download?force=true"
fetch "content/food/food09.jpeg" "https://unsplash.com/photos/G3GxkxZOOYc/download?force=true"
fetch "content/food/food10.jpeg" "https://unsplash.com/photos/dmnCGaqMEzE/download?force=true"
fetch "content/food/food11.jpeg" "https://unsplash.com/photos/TAj4X5-eRqE/download?force=true"
fetch "content/food/food12.jpeg" "https://unsplash.com/photos/H0fOnITjgw8/download?force=true"
fetch "content/food/food13.jpeg" "https://unsplash.com/photos/MqT0asuoIcU/download?force=true"
fetch "content/food/food14.jpeg" "https://unsplash.com/photos/EGvhPABaBos/download?force=true"
fetch "content/food/food15.jpeg" "https://unsplash.com/photos/_MYcIi9DgYQ/download?force=true"
fetch "content/food/food16.jpeg" "https://unsplash.com/photos/KG8ofkGRl1k/download?force=true"
fetch "content/food/food17.jpeg" "https://unsplash.com/photos/C6JhUKs9q8M/download?force=true"
fetch "content/food/food18.jpeg" "https://unsplash.com/photos/JyxMyWKOlSU/download?force=true"
fetch "content/food/food19.jpeg" "https://unsplash.com/photos/ta6KsvFaBqk/download?force=true"
fetch "content/food/food20.jpeg" "https://unsplash.com/photos/aZfMW0hSnQI/download?force=true"
fetch "content/happy/happy01.jpeg" "https://unsplash.com/photos/TyQ-0lPp6e4/download?force=true"
fetch "content/happy/happy02.jpeg" "https://unsplash.com/photos/e3OUQGT9bWU/download?force=true"
fetch "content/happy/happy03.jpeg" "https://unsplash.com/photos/FtZL0r4DZYk/download?force=true"
fetch "content/happy/happy04.jpeg" "https://unsplash.com/photos/hRdVSYpffas/download?force=true"
fetch "content/happy/happy05.jpeg" "https://unsplash.com/photos/1AhGNGKuhR0/download?force=true"
fetch "content/love/love01.jpeg" "https://unsplash.com/photos/YRgPxwbvY0E/download?force=true"
fetch "content/love/love02.jpeg" "https://unsplash.com/photos/AsahNlC0VhQ/download?force=true"
fetch "content/love/love03.jpeg" "https://unsplash.com/photos/EdULZpOKsUE/download?force=true"
fetch "content/love/love04.jpeg" "https://unsplash.com/photos/Y9mWkERHYCU/download?force=true"
fetch "content/love/love05.jpeg" "https://unsplash.com/photos/bQxGg8Vx1Vc/download?force=true"
fetch "content/people/people01.jpeg" "https://unsplash.com/photos/4nulm-JUYFo/download?force=true"
fetch "content/people/people02.jpeg" "https://unsplash.com/photos/NAdFJtFFlHE/download?force=true"
fetch "content/people/people03.jpeg" "https://unsplash.com/photos/2RhlxwRz4yc/download?force=true"
fetch "content/people/people04.jpeg" "https://unsplash.com/photos/tokYjYqaPB0/download?force=true"
fetch "content/people/people05.jpeg" "https://unsplash.com/photos/by0XNgDemsc/download?force=true"
fetch "content/tints/tint01.jpeg" "https://unsplash.com/photos/kKvQJ6rK6S4/download?force=true"
fetch "content/tints/tint02.jpeg" "https://unsplash.com/photos/Lw7BruqPnJY/download?force=true"
fetch "content/tints/tint03.jpeg" "https://unsplash.com/photos/60eMQfQuGIk/download?force=true"
fetch "content/tints/tint04.jpeg" "https://unsplash.com/photos/Q4q7kJxqfGI/download?force=true"
fetch "content/tints/tint05.jpeg" "https://unsplash.com/photos/PsO_PfLXET4/download?force=true"
fetch "content/travel/travel01.jpeg" "https://unsplash.com/photos/Q2ET6TX1poU/download?force=true"
fetch "content/travel/travel02.jpeg" "https://unsplash.com/photos/c5F1hhK5t0Q/download?force=true"
fetch "content/travel/travel03.jpeg" "https://unsplash.com/photos/A7KD1kdXD-o/download?force=true"
fetch "content/travel/travel04.jpeg" "https://unsplash.com/photos/PSY_KuMcTJU/download?force=true"
fetch "content/travel/travel05.jpeg" "https://unsplash.com/photos/rlIb6DLWcH8/download?force=true"

1
exampleSite/themes/photo-stream

@ -0,0 +1 @@
../../

11
i18n/en.yaml

@ -0,0 +1,11 @@
---
- id: pageNotFound
translation: "Sorry, this page does not exist."
- id: visitHomePage
translation: "Return to home page"
- id: open
translation: "Open"
- id: previous
translation: "Previous"
- id: next
translation: "Next"

10
i18n/fr.yaml

@ -0,0 +1,10 @@
- id: pageNotFound
translation: "Désolé, cette page n'existe pas !"
- id: visitHomePage
translation: "Retour à la page d'accueil"
- id: open
translation: "Ouvrir"
- id: previous
translation: "Précédent"
- id: next
translation: "Suivant"

8
layouts/404.html

@ -0,0 +1,8 @@
{{ define "main"}}
<div class="four-oh-four">
<img src="{{ "/favicon.svg" | relURL }}" alt="">
<h1>404</h1>
<p>{{ i18n "pageNotFound" }}</p>
<a href="{{ "/" | relURL }}">{{ i18n "visitHomePage" }}</a>
</div>
{{ end }}

33
layouts/_default/album.html

@ -0,0 +1,33 @@
{{ $photos := .Resources.ByType "image" }}
{{ $scratch := newScratch }}
{{ $scratch.Set "index" 0 }}
{{ range $i, $photo := $photos }}
{{ if index $photo.Params "cover" }}
{{ $scratch.Set "index" $i }}
{{ end }}
{{ end }}
{{ if gt (len $photos) 0 }}
{{ $photo := index $photos ($scratch.Get "index") }}
{{ if $photo.Exif }}
{{ $orientation := index $photo.Exif.Tags "Orientation" }}
{{ if eq $orientation 6 }}
{{ $scratch.Set "image_rotation" "r270" }}
{{ else if eq $orientation 8 }}
{{ $scratch.Set "image_rotation" "r90" }}
{{ else if eq $orientation 3 }}
{{ $scratch.Set "image_rotation" "r180" }}
{{ else }}
{{ $scratch.Set "image_rotation" "" }}
{{ end }}
{{ else }}
{{ $scratch.Set "image_rotation" "" }}
{{ end }}
{{ $tint := $photo.Fill "1x1 Box png" }}
{{ $thumbnail := $photo.Fit (print "800x800 Lanczos q80 " ($scratch.Get "image_rotation")) }}
<li class="item" id="{{ $photo.Name | urlize }}" style="background-image: url('data:image/png;base64,{{ $tint.Content| base64Encode }}')" title="{{ $photo.Name }}">
<img class="lazyload" data-src="{{ $thumbnail.RelPermalink }}" src="data:image/png;base64,{{ $tint.Content| base64Encode }}" height="{{ $thumbnail.Height}}" width="{{ $thumbnail.Width }}" />
<a class="open" {{ printf "href=%q" .URL | safeHTMLAttr }}>{{ i18n "open" }}</a>
<div class="name">{{ .Title }}</div>
<div class="date">{{ dateFormat ((index .Site.Params "album_date_format") | default "01/2006") .Date }}</div>
</li>
{{ end }}

7
layouts/_default/baseof.html

@ -0,0 +1,7 @@
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
<body>
{{- block "main" . }}{{- end }}
</body>
</html>

8
layouts/_default/list.html

@ -0,0 +1,8 @@
{{ define "main"}}
<ul class="grid" id="target">
{{ range .Data.Pages.ByDate.Reverse }}
{{ .Render "album" }}
{{ end }}
</ul>
{{ end }}

6
layouts/_default/single.html

@ -0,0 +1,6 @@
{{ define "main"}}
<ul class="grid" id="target">
{{ $photos := sort (.Resources.ByType "image") (index .Params "sort_by" |default "Name") }}
{{- partial "photos.html" $photos -}}
</ul>
{{ end }}

55
layouts/partials/head.html

@ -0,0 +1,55 @@
<head>
<!-- Title -->
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{ if eq $url "/" }}
{{ $.Scratch.Set "title" .Site.Title }}
{{ else }}
{{ $.Scratch.Set "title" .Title }}
{{ end }}
<!-- The data-title attribute is used by Javascript to restore the original
title when the photo is closed -->
<title {{ printf `data-title="%s"` ($.Scratch.Get "title") | safeHTMLAttr }}>
{{ $.Scratch.Get "title" }}
</title>
<!-- Misc -->
<link rel="canonical" href="{{ .Permalink }}">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<!-- RSS Link -->
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
<!-- Open Graph meta tags -->
{{ template "_internal/opengraph.html" . }}
<!-- Compile SCSS to CSS -->
{{ $scss := resources.Get "/css/master.scss" }}
{{ $css := $scss | resources.ToCSS }}
<!-- Links to CSS and JS -->
{{ if .Site.Params.cachebuster }}
{{ $t := now }}
<link rel="stylesheet" href="{{ $css.Permalink }}?t={{$t}}">
{{ range .Site.Params.extracssfiles }}
<link rel="stylesheet" href="{{.}}?t={{$t}}">
{{ end }}
<script type="text/javascript" src="/js/lazy-loading.js?t={{$t}}"></script>
<script type="text/javascript" src="/js/photos.js?t={{$t}}"></script>
{{ else }}
<link rel="stylesheet" href="{{ $css.Permalink }}">
{{ range .Site.Params.extracssfiles }}
<link rel="stylesheet" href="{{.}}">
{{ end }}
<script type="text/javascript" src="/js/lazy-loading.js"></script>
<script type="text/javascript" src="/js/photos.js"></script>
{{ end }}
<!-- Favicon -->
<link rel="shortcut icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" type="image/png" href="/favicon.png" />
<link rel="apple-touch-icon" href="/touch-icon-iphone.png" />
<link rel="mask-icon" href="/favicon.svg" />
</head>

8
layouts/partials/links.html

@ -0,0 +1,8 @@
<ul class="links">
<!-- You can add links (to your social media profiles for example) below -->
<li class="rss"><a rel="alternate" type="application/rss+xml" href="{{ .Params.BaseURL }}feed.xml" title="RSS Feed">RSS Feed</a></li>
<li class="github"><a rel="me" href="https://github.com/maxvoltar/photo-stream" title="Fork on Github">Github</a></li>
<li class="link"><a rel="me" href="https://twitter.com/{{ .Params.twitter_username }}" title="@{{ .Params.twitter_username }} on Twitter">Twitter</a></li>
<!-- <li class="link"><a rel="me" href="https://github.com/{{ .Params.github_username }}" title="@{{ .Params.github_username }} on Github">Github</a></li> -->
<!-- <li class="link"><a rel="me" href="https://instagram.com/{{ .Params.instagram_username }}" title="@{{ .Params.instagram_username }} on Instagram">Instagram</a></li> -->
</ul>

45
layouts/partials/photos.html

@ -0,0 +1,45 @@
{{ $photos := . }}
{{ $size := len $photos }}
{{ $scratch := newScratch }}
{{ range $index, $photo := $photos }}
{{ if $photo.Exif }}
{{ $orientation := index $photo.Exif.Tags "Orientation" }}
{{ if eq $orientation 6 }}
{{ $scratch.Set "image_rotation" "r270" }}
{{ else if eq $orientation 8 }}
{{ $scratch.Set "image_rotation" "r90" }}
{{ else if eq $orientation 3 }}
{{ $scratch.Set "image_rotation" "r180" }}
{{ else }}
{{ $scratch.Set "image_rotation" "" }}
{{ end }}
{{ else }}
{{ $scratch.Set "image_rotation" "" }}
{{ end }}
{{ $tint := $photo.Fill "1x1 Box png" }}
{{ $thumbnail := $photo.Fit (print "800x800 Lanczos q80 " ($scratch.Get "image_rotation")) }}
{{ $large := $photo.Fit (print "2048x2048 Lanczos q85 " ($scratch.Get "image_rotation")) }}
<li class="item" id="{{ $photo.Name | urlize }}" style="background-image: url('data:image/png;base64,{{ $tint.Content| base64Encode }}')" title="{{ $photo.Name }}">
<img class="lazyload" data-src="{{ $thumbnail.RelPermalink }}" src="data:image/png;base64,{{ $tint.Content| base64Encode }}" height="{{ $thumbnail.Height}}" width="{{ $thumbnail.Width }}" />
<span class="full">
<!-- TODO <a href="{{ $large.RelPermalink }}"></a> -->
<span style="background-image: url('{{ $large.RelPermalink }}')"></span>
</span>
<a class="open" href="#{{ $photo.Name | urlize }}" data-target="{{ $photo.Name | urlize }}">{{ i18n "open" }}</a>
<a class="close" href="#">Close</a>
{{ if $index }}
{{ $previous_photo := (index $photos (sub $index 1)) }}
<a href="#{{ $previous_photo.Name | urlize }}" data-target="{{ $previous_photo.Name | urlize }}" class="previous" title="{{ i18n "previous" }}">
<span>{{ i18n "previous" }}</span>
</a>
{{ end }}
{{ if lt $index (sub $size 1) }}
{{ $next_photo := (index $photos (add $index 1)) }}
<a href="#{{ $next_photo.Name | urlize }}" data-target="{{ $next_photo.Name | urlize }}" class="next" title="{{ i18n "next" }}">
<span>{{ i18n "next" }}</span>
</a>
{{ end }}
</li>
{{ end }}

BIN
static/favicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

12
static/favicon.svg

@ -0,0 +1,12 @@
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<g id="favicon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M3.8458278,-1.55376046e-16 L12.1541722,1.55376046e-16 C13.4914503,-9.02779573e-17 13.9763797,0.139238417 14.4652686,0.400699056 C14.9541574,0.662159695 15.3378403,1.04584256 15.5993009,1.53473144 C15.8607616,2.02362033 16,2.50854969 16,3.8458278 L16,12.1541722 C16,13.4914503 15.8607616,13.9763797 15.5993009,14.4652686 C15.3378403,14.9541574 14.9541574,15.3378403 14.4652686,15.5993009 C13.9763797,15.8607616 13.4914503,16 12.1541722,16 L3.8458278,16 C2.50854969,16 2.02362033,15.8607616 1.53473144,15.5993009 C1.04584256,15.3378403 0.662159695,14.9541574 0.400699056,14.4652686 C0.139238417,13.9763797 6.01853049e-17,13.4914503 -1.03584031e-16,12.1541722 L1.03584031e-16,3.8458278 C-6.01853049e-17,2.50854969 0.139238417,2.02362033 0.400699056,1.53473144 C0.662159695,1.04584256 1.04584256,0.662159695 1.53473144,0.400699056 C2.02362033,0.139238417 2.50854969,9.02779573e-17 3.8458278,-1.55376046e-16 Z" id="background" fill="#2E2F30"></path>
<path d="M3.2819426,2 L6,2 L6,2 L6,7 L2,7 L2,3.2819426 C2,2.83618323 2.04641281,2.67454011 2.13356635,2.51157715 C2.2207199,2.34861419 2.34861419,2.2207199 2.51157715,2.13356635 C2.67454011,2.04641281 2.83618323,2 3.2819426,2 Z" id="Rectangle" fill="#FFB485"></path>
<path d="M2,9 L8,9 L8,14 L3.2819426,14 C2.83618323,14 2.67454011,13.9535872 2.51157715,13.8664336 C2.34861419,13.7792801 2.2207199,13.6513858 2.13356635,13.4884229 C2.04641281,13.3254599 2,13.1638168 2,12.7180574 L2,9 L2,9 Z" id="Rectangle-Copy-2" fill="#AAA7D8"></path>
<path d="M8,2 L12.7180574,2 C13.1638168,2 13.3254599,2.04641281 13.4884229,2.13356635 C13.6513858,2.2207199 13.7792801,2.34861419 13.8664336,2.51157715 C13.9535872,2.67454011 14,2.83618323 14,3.2819426 L14,7 L14,7 L8,7 L8,2 Z" id="Rectangle-Copy" fill="#FEB4D1"></path>
<path d="M10,9 L14,9 L14,12.7180574 C14,13.1638168 13.9535872,13.3254599 13.8664336,13.4884229 C13.7792801,13.6513858 13.6513858,13.7792801 13.4884229,13.8664336 C13.3254599,13.9535872 13.1638168,14 12.7180574,14 L10,14 L10,14 L10,9 Z" id="Rectangle-Copy-3" fill="#9BDACA"></path>
</g>
<style>
@media (prefers-color-scheme: dark) { #background { fill: #ffffff; } }
</style>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

7
static/img/icon-github.svg

@ -0,0 +1,7 @@
<svg viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.75">
<g id="Icon/Github" fill="#000000">
<path d="M13,0 C14.6568542,0 16,1.34314575 16,3 C16,4.30588222 15.1656226,5.41688515 14.0009007,5.82897577 L14,6 C14,7.59768088 12.75108,8.90366088 11.1762728,8.99490731 L11,9 L9,9 L9.00090072,10.1710242 C10.1656226,10.5831148 11,11.6941178 11,13 C11,14.6568542 9.65685425,16 8,16 C6.34314575,16 5,14.6568542 5,13 C5,11.6937479 5.8348501,10.5824856 7.00008893,10.1706743 L7,9 L5,9 C3.40231912,9 2.09633912,7.75108004 2.00509269,6.17627279 L2,6 L2.00008893,5.82932572 C0.834850101,5.41751442 0,4.30625206 0,3 C0,1.34314575 1.34314575,0 3,0 C4.65685425,0 6,1.34314575 6,3 C6,4.30588222 5.16562257,5.41688515 4.00090072,5.82897577 L4,6 C4,6.51283584 4.38604019,6.93550716 4.88337887,6.99327227 L5,7 L11,7 C11.5128358,7 11.9355072,6.61395981 11.9932723,6.11662113 L12,6 L12.0000889,5.82932572 C10.8348501,5.41751442 10,4.30625206 10,3 C10,1.34314575 11.3431458,0 13,0 Z M8,12 C7.44771525,12 7,12.4477153 7,13 C7,13.5522847 7.44771525,14 8,14 C8.55228475,14 9,13.5522847 9,13 C9,12.4477153 8.55228475,12 8,12 Z M3,2 C2.44771525,2 2,2.44771525 2,3 C2,3.55228475 2.44771525,4 3,4 C3.55228475,4 4,3.55228475 4,3 C4,2.44771525 3.55228475,2 3,2 Z M13,2 C12.4477153,2 12,2.44771525 12,3 C12,3.55228475 12.4477153,4 13,4 C13.5522847,4 14,3.55228475 14,3 C14,2.44771525 13.5522847,2 13,2 Z" id="Combined-Shape"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

11
static/img/icon-info.svg

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch Beta 64 (93301) - https://sketch.com -->
<title>icon-info</title>
<desc>Created with Sketch Beta.</desc>
<g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.75">
<g id="Icon/Information" fill="#000000">
<path d="M8,7 C8.55228475,7 9,7.44771525 9,8 L9,11 C9,11.5522847 8.55228475,12 8,12 C7.44771525,12 7,11.5522847 7,11 L7,8 C7,7.44771525 7.44771525,7 8,7 Z M8,0 C12.418278,0 16,3.581722 16,8 C16,12.418278 12.418278,16 8,16 C3.581722,16 0,12.418278 0,8 C0,3.581722 3.581722,0 8,0 Z M8,2 C4.6862915,2 2,4.6862915 2,8 C2,11.3137085 4.6862915,14 8,14 C11.3137085,14 14,11.3137085 14,8 C14,4.6862915 11.3137085,2 8,2 Z M8,4 C8.55228475,4 9,4.44771525 9,5 C9,5.55228475 8.55228475,6 8,6 C7.44771525,6 7,5.55228475 7,5 C7,4.44771525 7.44771525,4 8,4 Z" id="Combined-Shape"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

14
static/img/icon-left.svg

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch Beta 64 (93301) - https://sketch.com -->
<title>icon-left</title>
<desc>Created with Sketch Beta.</desc>
<g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Icon/Left">
<path fill="rgba(0,0,0,.75)" d="M6.29289322,2.29289322 C6.68341751,1.90236893 7.31658249,1.90236893 7.70710678,2.29289322 C8.09763107,2.68341751 8.09763107,3.31658249 7.70710678,3.70710678 L7.70710678,3.70710678 L4.414,7 L14,7 C14.5128358,7 14.9355072,7.38604019 14.9932723,7.88337887 L15,8 C15,8.55228475 14.5522847,9 14,9 L14,9 L4.414,9 L7.70710678,12.2928932 C8.06759074,12.6533772 8.09532028,13.2206082 7.79029539,13.6128994 L7.70710678,13.7071068 C7.31658249,14.0976311 6.68341751,14.0976311 6.29289322,13.7071068 L6.29289322,13.7071068 L1.29289322,8.70710678 C0.902368927,8.31658249 0.902368927,7.68341751 1.29289322,7.29289322 L1.29289322,7.29289322 Z" id="Combined-Shape"></path>
</g>
</g>
<!-- <style>
@media (prefers-color-scheme: dark) { path { fill: #ffffff; } }
</style> -->
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

10
static/img/icon-right.svg

@ -0,0 +1,10 @@
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Icon/Right">
<path fill="rgba(0,0,0,.75)" d="M6.29289322,2.29289322 C6.68341751,1.90236893 7.31658249,1.90236893 7.70710678,2.29289322 C8.09763107,2.68341751 8.09763107,3.31658249 7.70710678,3.70710678 L7.70710678,3.70710678 L4.414,7 L14,7 C14.5128358,7 14.9355072,7.38604019 14.9932723,7.88337887 L15,8 C15,8.55228475 14.5522847,9 14,9 L14,9 L4.414,9 L7.70710678,12.2928932 C8.06759074,12.6533772 8.09532028,13.2206082 7.79029539,13.6128994 L7.70710678,13.7071068 C7.31658249,14.0976311 6.68341751,14.0976311 6.29289322,13.7071068 L6.29289322,13.7071068 L1.29289322,8.70710678 C0.902368927,8.31658249 0.902368927,7.68341751 1.29289322,7.29289322 L1.29289322,7.29289322 Z" id="Combined-Shape" transform="translate(8.000000, 8.000000) scale(-1, 1) translate(-8.000000, -8.000000) "></path>
</g>
</g>
<!-- <style>
@media (prefers-color-scheme: dark) { path { fill: #ffffff; } }
</style> -->
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

7
static/img/icon-rss.svg

@ -0,0 +1,7 @@
<svg viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.75">
<g id="Icon/RSS" fill="#000000">
<path d="M4,10 C5.1045695,10 6,10.8954305 6,12 C6,13.1045695 5.1045695,14 4,14 C2.8954305,14 2,13.1045695 2,12 C2,10.8954305 2.8954305,10 4,10 Z M3,0 C10.1797017,0 16,5.82029825 16,13 C16,13.5522847 15.5522847,14 15,14 C14.4477153,14 14,13.5522847 14,13 C14,6.92486775 9.07513225,2 3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 Z M3,5 C7.418278,5 11,8.581722 11,13 C11,13.5522847 10.5522847,14 10,14 C9.44771525,14 9,13.5522847 9,13 C9,9.6862915 6.3137085,7 3,7 C2.44771525,7 2,6.55228475 2,6 C2,5.44771525 2.44771525,5 3,5 Z" id="Combined-Shape"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 833 B

10
static/img/icon-twitter.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.6 KiB

6
static/js/lazy-loading.js

@ -0,0 +1,6 @@
// Name: Lazy Load 2.0.0-rc.2
// Source: https://github.com/tuupola/lazyload
// License: MIT license
// Copyright: 2007-2019 Mika Tuupola
!function(t,e){"object"==typeof exports?module.exports=e(t):"function"==typeof define&&define.amd?define([],e):t.LazyLoad=e(t)}("undefined"!=typeof global?global:this.window||this.global,function(t){"use strict";function e(t,e){this.settings=s(r,e||{}),this.images=t||document.querySelectorAll(this.settings.selector),this.observer=null,this.init()}"function"==typeof define&&define.amd&&(t=window);const r={src:"data-src",srcset:"data-srcset",selector:".lazyload",root:null,rootMargin:"0px",threshold:0},s=function(){let t={},e=!1,r=0,o=arguments.length;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(e=arguments[0],r++);for(;r<o;r++)!function(r){for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e&&"[object Object]"===Object.prototype.toString.call(r[o])?t[o]=s(!0,t[o],r[o]):t[o]=r[o])}(arguments[r]);return t};if(e.prototype={init:function(){if(!t.IntersectionObserver)return void this.loadImages();let e=this,r={root:this.settings.root,rootMargin:this.settings.rootMargin,threshold:[this.settings.threshold]};this.observer=new IntersectionObserver(function(t){Array.prototype.forEach.call(t,function(t){if(t.isIntersecting){e.observer.unobserve(t.target);let r=t.target.getAttribute(e.settings.src),s=t.target.getAttribute(e.settings.srcset);"img"===t.target.tagName.toLowerCase()?(r&&(t.target.src=r),s&&(t.target.srcset=s)):t.target.style.backgroundImage="url("+r+")"}})},r),Array.prototype.forEach.call(this.images,function(t){e.observer.observe(t)})},loadAndDestroy:function(){this.settings&&(this.loadImages(),this.destroy())},loadImages:function(){if(!this.settings)return;let t=this;Array.prototype.forEach.call(this.images,function(e){let r=e.getAttribute(t.settings.src),s=e.getAttribute(t.settings.srcset);"img"===e.tagName.toLowerCase()?(r&&(e.src=r),s&&(e.srcset=s)):e.style.backgroundImage="url('"+r+"')"})},destroy:function(){this.settings&&(this.observer.disconnect(),this.settings=null)}},t.lazyload=function(t,r){return new e(t,r)},t.jQuery){const r=t.jQuery;r.fn.lazyload=function(t){return t=t||{},t.attribute=t.attribute||"data-src",new e(r.makeArray(this),t),this}}return e});

104
static/js/photos.js

@ -0,0 +1,104 @@
const ESCAPE = 27;
const RIGHT = 39;
const LEFT = 37;
const TARGET_CLASS = 'target';
const clickNavigationButton = (buttonClass) => {
const id = window.history.state && window.history.state.id;
if (id) {
const photo = document.getElementById(id);
console.log(photo);
const button = photo.querySelector(buttonClass);
console.log(button);
button && button.click();
}
}
const openPhoto = (id, href) => {
console.log(`Opening photo ${id}...`);
const photo = document.getElementById(id);
const title = photo.getAttribute('title');
removeTargetClass();
photo.classList.add(TARGET_CLASS);
document.title = title;
if (href) {
window.history.pushState({id: id}, '', href);
}
}
const closePhoto = (href) => {
console.log(`Closing photo...`);
const title = document.querySelector('head title').getAttribute('data-title');
removeTargetClass();
document.title = title;
if (href) {
window.history.pushState({}, '', href);
}
}
const removeTargetClass = () => {
let targets = document.querySelectorAll(`.${TARGET_CLASS}`);
targets.forEach((target) => {
target.classList.remove(TARGET_CLASS);
});
}
const handleClick = (selector, event, callback) => {
if (event.target.matches(selector)) {
callback();
event.preventDefault();
}
}
const handleKey = (keyCode, event, callback) => {
if (event.keyCode === keyCode) {
callback();
event.preventDefault();
}
}
window.onpopstate = function(event) {
if (event.state && event.state.id) {
const id = event.state.id;
openPhoto(id, null);
} else {
closePhoto(null);
}
}
document.addEventListener('keydown', (event) => {
handleKey(ESCAPE, event, () => {
clickNavigationButton('.close');
});
handleKey(RIGHT, event, () => {
clickNavigationButton('.next');
});
handleKey(LEFT, event, () => {
clickNavigationButton('.previous');
});
});
document.addEventListener('click', (event) => {
handleClick('[data-target][href]', event, () => {
const id = event.target.getAttribute('data-target');
const href = event.target.getAttribute('href');
openPhoto(id, href);
});
handleClick('[href].close', event, () => {
const href = event.target.getAttribute('href');
closePhoto(href);
});
});
window.addEventListener('load', (event) => {
console.log("Loaded !");
const id = window.location.hash.substr(1);
if (id != "") {
openPhoto(id, "#" + id);
}
lazyload();
});

BIN
static/social-preview.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
static/touch-icon-iphone.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

20
theme.toml

@ -0,0 +1,20 @@
# theme.toml template for a Hugo theme
# See https://github.com/gohugoio/hugoThemes#themetoml for an example
name = "Photo Stream"
license = "MIT"
licenselink = "https://github.com/nmasse-itix/photo-stream/blob/master/LICENSE"
description = "A theme to host your photo albums, based on maxvoltar's photo-stream theme"
homepage = "https://www.itix.fr/"
tags = [ "photo-stream", "responsive", "flexbox", "minimalistic", "gallery" ]
features = [ "rss", "page resources", "responsive" ]
min_version = "0.68.0"
[author]
name = "Nicolas Massé"
homepage = "https://www.itix.fr/"
[original]
name = "Tim Van Damme"
homepage = "http://timvandamme.com/"
repo = "https://github.com/maxvoltar/photo-stream"
Loading…
Cancel
Save