Skip to content

Commit 4e2b810

Browse files
author
Pietro Albini
authored
Merge pull request #1117 from pietroalbini/sponsor-google-cloud
2 parents faa7d5a + cd7e692 commit 4e2b810

File tree

6 files changed

+27
-3
lines changed

6 files changed

+27
-3
lines changed

locales/en-US/sponsors.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ sponsors-microsoft = Microsoft Azure is sponsoring builders for Rust’s CI infr
1515
sponsors-aws-alt = Amazon Web Services
1616
sponsors-aws = Amazon Web Services (AWS) is providing hosting for release artifacts (compilers, libraries, tools, and source code), serving those artifacts to users through CloudFront, preventing regressions with Crater on EC2, and managing other Rust-related infrastructure hosted on AWS.
1717
18+
sponsors-google-cloud-alt = Google Cloud
19+
sponsors-google-cloud = Google Cloud is providing support for the Rust Project by helping prevent compiler regressions with Crater.
20+
1821
sponsors-mozilla-alt = Mozilla
1922
sponsors-mozilla = Mozilla is providing the Rust project with Heroku services for crates.io, Zoom.us services for team video calls, Mailgun services for emails, and Discourse for the Users and Internals forums.
2023

src/data/sponsors.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
#
55
# The name of the sponsor is defined here and left untranslated in the page.
66
# The other parts of the page are derived from the sponsor's ID:
7-
# - The logo is located in static/images/sponsor-logos/<id>.svg
7+
# - The logo is located in static/images/sponsor-logos/<id>.<logo-format>
8+
# By default the logo format is SVG.
89
# - The alt of the image is the Fluent translation "sponsors-<id>-alt"
910
# - The description paragraph is the Fluent translation "sponsors-<id>"
1011

@@ -14,6 +15,11 @@
1415
- id: aws
1516
name: AWS
1617

18+
- id: google-cloud
19+
name: Google Cloud
20+
logo-format: png
21+
vertical-logo: true
22+
1723
- id: microsoft
1824
name: Microsoft Azure
1925

src/sponsors.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ lazy_static! {
1010
}
1111

1212
#[derive(Deserialize)]
13+
#[serde(rename_all = "kebab-case")]
1314
struct Sponsor {
1415
id: String,
1516
name: String,
17+
logo_format: Option<String>,
18+
#[serde(default)]
19+
vertical_logo: bool,
1620
}
1721

1822
fn load_sponsors(path: &str) -> Result<Vec<Sponsor>, Box<dyn Error>> {
@@ -26,6 +30,7 @@ pub(crate) struct RenderSponsor {
2630
logo_path: String,
2731
logo_alt_i18n: String,
2832
description_i18n: String,
33+
vertical_logo: bool,
2934
}
3035

3136
pub(crate) fn render_data(lang: &str) -> Vec<RenderSponsor> {
@@ -36,9 +41,14 @@ pub(crate) fn render_data(lang: &str) -> Vec<RenderSponsor> {
3641
.map(|s| RenderSponsor {
3742
name: &s.name,
3843
is_not_first: true, // Will be changed later
39-
logo_path: format!("/static/images/sponsor-logos/{}.svg", s.id),
44+
logo_path: format!(
45+
"/static/images/sponsor-logos/{}.{}",
46+
s.id,
47+
s.logo_format.as_ref().map(|s| s.as_str()).unwrap_or("svg")
48+
),
4049
logo_alt_i18n: i18n.lookup(lang, &format!("sponsors-{}-alt", s.id), None),
4150
description_i18n: i18n.lookup(lang, &format!("sponsors-{}", s.id), None),
51+
vertical_logo: s.vertical_logo,
4252
})
4353
.collect::<Vec<_>>();
4454

src/styles/app.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,3 +732,8 @@ section header {
732732
/* Tachyons is missing this class */
733733
max-height: 5rem;
734734
}
735+
736+
.max-height-10rem {
737+
/* Tachyons is missing this class */
738+
max-height: 10rem;
739+
}
46 KB
Loading

templates/sponsors/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{{/if}}
2424
<div class="flex-none flex-l mt5-l">
2525
<div class="mv3 mv0-ns w-100 w-30-l tc flex items-center justify-center">
26-
<img class="ph5 max-height-5rem" alt="{{sponsor.logo_alt_i18n}}" src="{{sponsor.logo_path}}" />
26+
<img class="ph5 {{#if sponsor.vertical_logo}}max-height-10rem{{else}}max-height-5rem{{/if}}" alt="{{sponsor.logo_alt_i18n}}" src="{{sponsor.logo_path}}" />
2727
</div>
2828
<div class="w-100 w-70-l">
2929
<h3>{{sponsor.name}}</h3>

0 commit comments

Comments
 (0)