Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds enforcement of asset directory for square logos #14636

Merged
merged 13 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/events/2024-almaty/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2024-bogota/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2024-boston/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2024-brasilia/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2024-caceres/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/events/2024-cairo/logo-square.jpg
Binary file not shown.
Binary file added assets/events/2024-cairo/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2024-campinas/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2024-dallas/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2024-des-moines/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2024-maceio/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2024-natal/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2024-paris/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2024-porto-alegre/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2024-warsaw/dod-waw-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2024-zurich/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2025-aarhus/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2025-amsterdam/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2025-atlanta/logo-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/events/2025-chicago/logo-square.png
Binary file added assets/events/2025-raleigh/logo-square.png
Binary file removed static/events/2024-almaty/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-antwerp/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-antwerp/logo.png
Diff not rendered.
Binary file removed static/events/2024-antwerp/organizers/floor.jpg
Diff not rendered.
Binary file removed static/events/2024-antwerp/organizers/jj.jpg
Diff not rendered.
Binary file removed static/events/2024-antwerp/organizers/jos.png
Diff not rendered.
Binary file removed static/events/2024-antwerp/organizers/kris.jpg
Diff not rendered.
Binary file removed static/events/2024-antwerp/organizers/marco.png
Diff not rendered.
Binary file removed static/events/2024-antwerp/organizers/mine.png
Diff not rendered.
Binary file removed static/events/2024-antwerp/organizers/mona.jpeg
Diff not rendered.
Diff not rendered.
Binary file removed static/events/2024-antwerp/organizers/norman.png
Diff not rendered.
Binary file removed static/events/2024-antwerp/organizers/ringo.png
Diff not rendered.
Binary file removed static/events/2024-antwerp/organizers/stefan.png
Diff not rendered.
Binary file removed static/events/2024-antwerp/organizers/toshaan.jpg
Diff not rendered.
Binary file removed static/events/2024-antwerp/organizers/yves.png
Diff not rendered.
Binary file removed static/events/2024-antwerp/organizers/yvo.jpeg
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed static/events/2024-antwerp/speakers/a3a7nc-img.jpg
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed static/events/2024-antwerp/speakers/fpnjcl-img.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed static/events/2024-antwerp/speakers/jhuqfb-img.png
Diff not rendered.
Binary file removed static/events/2024-antwerp/speakers/lc8fpw-img.jpg
Diff not rendered.
Binary file removed static/events/2024-antwerp/speakers/lm9ks7-img.png
Diff not rendered.
Diff not rendered.
Binary file removed static/events/2024-antwerp/speakers/pmwq7q-img.png
Diff not rendered.
Binary file removed static/events/2024-antwerp/speakers/qt3fkq-img.jpg
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed static/events/2024-antwerp/speakers/ykn7u9-img.jpg
Diff not rendered.
Binary file removed static/events/2024-antwerp/speakers/z8ph8j-img.jpg
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed static/events/2024-bogota/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-boston/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-brasilia/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-caceres/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-cairo/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-campinas/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-chattanooga/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-dallas/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-des-moines/logo-square.jpg
Diff not rendered.
Diff not rendered.
Binary file removed static/events/2024-joao-pessoa/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-los-angeles/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-maceio/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-natal/logo-square.jpg
Diff not rendered.
Diff not rendered.
Binary file removed static/events/2024-organiser-summit/logo.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed static/events/2024-paris/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-recife/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-tel-aviv/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-warsaw/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2024-zurich/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2025-aarhus/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2025-amsterdam/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2025-atlanta/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2025-chicago/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2025-chicago/logo-square.png
Diff not rendered.
Binary file removed static/events/2025-geneva/logo-square.jpg
Diff not rendered.
Binary file removed static/events/2025-raleigh/logo-square.jpg
Diff not rendered.
20 changes: 17 additions & 3 deletions themes/devopsdays-theme/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,24 @@
{{- $.Scratch.Set "assetsdir" (printf "assets/events/%s/" ($.Scratch.Get "subdir")) -}}
{{- $.Scratch.Set "contentdir" (printf "static/events/%s/" ($.Scratch.Get "subdir")) -}}
{{- if (where (readDir "assets/events") "Name" ($.Scratch.Get "subdir")) -}}
{{- if (where (readDir ($.Scratch.Get "assetsdir")) "Name" "logo.png") -}}
{{- $imagelocation := (printf "events/%s/logo.png" .name) -}}
{{- warnf "in the assets directory for %s" ($.Scratch.Get "subdir") -}}
<!-- get the logo for front page here -->
{{- if (where (readDir ($.Scratch.Get "assetsdir")) "Name" "logo-square.png") -}}
{{- $.Scratch.Set "squarelogofile" "logo-square.png" -}}
{{- else -}}
{{- if (where (readDir ($.Scratch.Get "assetsdir")) "Name" "logo.png") -}}
{{- $.Scratch.Set "squarelogofile" "logo.png" -}}
{{- else -}}
{{- $.Scratch.Set "squarelogofile" "" -}}
{{- end -}}
{{- end -}}
{{- warnf "Value of the squarelogofile is %s" ($.Scratch.Get "squarelogofile") -}}

{{- if ($.Scratch.Get "squarelogofile") -}}
{{- $imagelocation := (printf "events/%s/%s" .name ($.Scratch.Get "squarelogofile")) -}}
{{- warnf "Processing %s" ($.Scratch.Get "imagelocation") -}}
{{- $imageresource := resources.Get $imagelocation -}}
{{- $imagefile := $imageresource.Fit "236x236 webp Lanczos q100" -}}
{{- $imagefile := $imageresource.Fill "236x236 webp Lanczos q100 Center" -}}
<a href='{{ (printf "/events/%s" .name) }}'><img src='{{ $imagefile.RelPermalink }}' class="img-fluid" alt="devopsdays {{ .city }}"/></a>
{{- $.Scratch.Set "logo" "set" -}}
{{- end -}}
Expand Down
12 changes: 7 additions & 5 deletions themes/devopsdays-theme/layouts/shortcodes/event_logo.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
{{- $.Scratch.Set "contentdir" (printf "static/events/%s/" $e.name) -}}
{{- $.Scratch.Set "assetsdir" (printf "assets/events/%s/" $e.name) -}}
{{- if (where (readDir "assets/events") "Name" $e.name) -}}
{{- $imagelocation := (printf "events/%s/logo.png" $e.name) -}}
{{- $imageresource := resources.Get $imagelocation -}}
{{- $imagefile := $imageresource.Fit "600x600 webp Lanczos q100" -}}
<img alt="devopsdays {{ $e.city }} {{ $e.year }}" src='{{ $imagefile.RelPermalink }}' class="welcome-page-event-logo"/>
{{- else if (where (readDir "static/events") "Name" $e.name) -}}
{{- if (where (readDir ($.Scratch.Get "assetsdir")) "Name" "logo.png") -}}
{{- $imagelocation := (printf "events/%s/logo.png" $e.name) -}}
{{- $imageresource := resources.Get $imagelocation -}}
{{- $imagefile := $imageresource.Fit "600x600 webp Lanczos q100" -}}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh. i see what @toshywoshy is talking about.

This shouldn't be the only option, because there are many logos which are NOT square and this is breaking change.

I would say that for the event_logo shortcode, it should not use Image.Fit but instead Image.Resize and we just specify a max width (to keep images from being giant)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we care about width?
I would be inclined to say we limit the height, so the text remains on a single screen when you're on a large screen.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's arbitrary for this one. have to keep in mind that this shortcode gives a lot of latitude for how it is used so being too prescriptive is going to cause weird and unexpected behavior.

This shortcode tends to be used on the welcome page, but in theory can be used anywere in any part of a page for an event, so we have to be kinda of loose. I also think that #14637 will provide more flexibilty when people want to displaly an image with more control so for now I would leave this shortcode to restrict at least one dimension (to keep it from being too crazy) and then when we bring in the other shortcode, can make this one more prescriptive again

but we can try to limit it via height instead /shrug

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Limiting by height has the advantage of making them all uniform on the line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jerdog we're talking about the shortcode used on the individual event welcome pages, so there's only one logo anyway :)

mattstratton marked this conversation as resolved.
Show resolved Hide resolved
<img alt="devopsdays {{ $e.city }} {{ $e.year }}" src='{{ $imagefile.RelPermalink }}' class="welcome-page-event-logo"/>
{{- end -}}
{{- else if (where (readDir "static/events") "Name" $e.name) -}}
{{- if (where (readDir ($.Scratch.Get "contentdir")) "Name" "logo.jpg") -}}
{{- $.Scratch.Set "logo" "logo.jpg" -}}
{{- else -}}
Expand Down
3 changes: 2 additions & 1 deletion utilities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Use [add_new_event.sh](add_new_event.sh) to add a new event. This is year-specif
1. The script will create a data file for your event in `data/events/yyyy-city.yml`. This is where you will configure many of your updates and customizations. In particular, you need to list your local organizer team here.
1. The script will populate your event directory in `content/events/yyyy-city` with default content. You should edit it as desired.
1. The script will add or update your entry in `static/_redirects`. This allows you to use the url `https://devopsdays.org/city-name` to point to your current-year event.
1. Once you have created a logo graphic, place it in `static/events/yyyy-city/logo.png`. (The file MUST be called `logo.png`.) The sample welcome page has a commented-out element to display a logo named in this way. For front-page use, you also need a square version in `static/events/yyyy-city/logo-square.jpg`.
1. Once you have created a logo graphic, place it in `assets/images/events/yyyy-city/logo.png`. (The file MUST be called `logo.png`.) The sample welcome page has a commented-out element to display a logo named in this way.
1. The image used for your event on the front page of the site will be the image located in `assets/images/events/yyyy-city/logo.png`, which will be cropped automatically cropped to square. If you want to override this, you can place a square image in `assets/images/events/yyyy-city/logo-square.png`.

## Google Analytics

Expand Down
Loading