Skip to content

Commit

Permalink
fix thumbnails 4
Browse files Browse the repository at this point in the history
  • Loading branch information
s7uck committed Aug 17, 2024
1 parent bba79e4 commit 136bbc2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/pages-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install SSG
run: sudo apt-get install ruby jekyll
run: sudo apt-get install ruby jekyll ruby-jekyll-feed
- name: Install exiftool
run: sudo apt-get install exiftool ruby-mini-exiftool webp
- name: Install plugins
run: sudo gem install jekyll-webp jekyll-redirect-from
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
Expand All @@ -34,9 +36,6 @@ jobs:
run: jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Create compressed versions of each photo
working-directory: './photos'
run: find . -type f -not -path "./.git/*" | parallel -eta cwebp "{}" -o "_site/photos/{.}.webp" -size 524288 -mt || true
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

Expand Down
9 changes: 8 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@ defaults:
values:
noheader: true

include: ["_*.JPG", "_*.jpg"]
include: ["_*.JPG", "_*.jpg", "_*.webp"]
webp:
enabled: true
quality: 90
img_dir: ["/photos"]
nested: true
formats: [".JPG", ".jpg", ".jpeg"]
append_ext: true
2 changes: 1 addition & 1 deletion gallery.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ permalink: /gallery

<ol class="grid" id="photo-grid">{% for photo in photos %}
<li class="card{% if photo.rating >= 4 %} big{% endif %}" onclick="window.location = '{{ photo.url }}'">
<img src="{{ photo.slug }}.webp" alt="{{ photo.title }}">
<img src="{{ photo.image }}.webp" alt="{{ photo.title }}">

<figcaption>
<small>
Expand Down

0 comments on commit 136bbc2

Please sign in to comment.