Skip to content

Add Google Cloud to the list of sponsors #1117

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

Merged
merged 1 commit into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions locales/en-US/sponsors.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ sponsors-microsoft = Microsoft Azure is sponsoring builders for Rust’s CI infr
sponsors-aws-alt = Amazon Web Services
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.

sponsors-google-cloud-alt = Google Cloud
sponsors-google-cloud = Google Cloud is providing support for the Rust Project by helping prevent compiler regressions with Crater.

sponsors-mozilla-alt = Mozilla
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.

Expand Down
8 changes: 7 additions & 1 deletion src/data/sponsors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#
# The name of the sponsor is defined here and left untranslated in the page.
# The other parts of the page are derived from the sponsor's ID:
# - The logo is located in static/images/sponsor-logos/<id>.svg
# - The logo is located in static/images/sponsor-logos/<id>.<logo-format>
# By default the logo format is SVG.
# - The alt of the image is the Fluent translation "sponsors-<id>-alt"
# - The description paragraph is the Fluent translation "sponsors-<id>"

Expand All @@ -14,6 +15,11 @@
- id: aws
name: AWS

- id: google-cloud
name: Google Cloud
logo-format: png
vertical-logo: true

- id: microsoft
name: Microsoft Azure

Expand Down
12 changes: 11 additions & 1 deletion src/sponsors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ lazy_static! {
}

#[derive(Deserialize)]
#[serde(rename_all = "kebab-case")]
struct Sponsor {
id: String,
name: String,
logo_format: Option<String>,
#[serde(default)]
vertical_logo: bool,
}

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

pub(crate) fn render_data(lang: &str) -> Vec<RenderSponsor> {
Expand All @@ -36,9 +41,14 @@ pub(crate) fn render_data(lang: &str) -> Vec<RenderSponsor> {
.map(|s| RenderSponsor {
name: &s.name,
is_not_first: true, // Will be changed later
logo_path: format!("/static/images/sponsor-logos/{}.svg", s.id),
logo_path: format!(
"/static/images/sponsor-logos/{}.{}",
s.id,
s.logo_format.as_ref().map(|s| s.as_str()).unwrap_or("svg")
),
logo_alt_i18n: i18n.lookup(lang, &format!("sponsors-{}-alt", s.id), None),
description_i18n: i18n.lookup(lang, &format!("sponsors-{}", s.id), None),
vertical_logo: s.vertical_logo,
})
.collect::<Vec<_>>();

Expand Down
5 changes: 5 additions & 0 deletions src/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -732,3 +732,8 @@ section header {
/* Tachyons is missing this class */
max-height: 5rem;
}

.max-height-10rem {
/* Tachyons is missing this class */
max-height: 10rem;
}
Binary file added static/images/sponsor-logos/google-cloud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion templates/sponsors/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{/if}}
<div class="flex-none flex-l mt5-l">
<div class="mv3 mv0-ns w-100 w-30-l tc flex items-center justify-center">
<img class="ph5 max-height-5rem" alt="{{sponsor.logo_alt_i18n}}" src="{{sponsor.logo_path}}" />
<img class="ph5 {{#if sponsor.vertical_logo}}max-height-10rem{{else}}max-height-5rem{{/if}}" alt="{{sponsor.logo_alt_i18n}}" src="{{sponsor.logo_path}}" />
</div>
<div class="w-100 w-70-l">
<h3>{{sponsor.name}}</h3>
Expand Down