-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Refactor sponsor data and introduce small logo sponsors on homepage #740
Merged
straight-shoota
merged 10 commits into
crystal-lang:relaunch-2023
from
straight-shoota:refactor/sponsors-data
Mar 26, 2024
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
65be2e2
Rename include to `sponsors-cards`
straight-shoota 5c90e94
Refactor writing CSV in `scripts/merge.cr`
straight-shoota df9fdea
Generate `_data/sponsor_logos_*`
straight-shoota b367693
Use `sponsor-logos-l` for `sponsor-cards`
straight-shoota f5722c1
Use `sponsor-logos-l` for `top-sponsor-icons`
straight-shoota 5a0f3b9
Add `sponsor-logos-s` to `top-sponsor-icons`
straight-shoota 2fdd21b
Add *Works on Arm*
straight-shoota 21e3d12
Grayscale for small icons
straight-shoota 82e9da3
Adjust styling
straight-shoota 313cc53
Update scripts/merge.cr
straight-shoota File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
logo,name,url,last_payment,all_time,since,level | ||
sponsors/84.png,84 codes,https://www.84codes.com/,"€22,000","€369,000","Apr 1, 2018",5000 | ||
manas-orange.svg,Manas.Tech,https://manas.tech/,"$5,000","$1,300,000","Jun 19, 2009",5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
logo,name,url,last_payment,all_time,since,level | ||
sponsors/woa.png,Works on Arm,https://developer.arm.com/solutions/infrastructure/works-on-arm,$500,$0,"Jul 22, 2021",500 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 1 addition & 5 deletions
6
_includes/pages/sponsors/top_sponsors.html → _includes/pages/sponsors/sponsor-cards.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,11 +64,15 @@ end | |
|
||
all_sponsors.sort_by! { |s| {-s.last_payment, -s.all_time, s.since, s.name} } | ||
|
||
File.open("#{__DIR__}/../_data/sponsors.csv", "w") do |file| | ||
CSV.build(file) do |csv| | ||
write_csv("sponsors.csv", all_sponsors.select(&.listed?)) | ||
write_csv("sponsor_logos_l.csv", all_sponsors.select { |sponsor| sponsor.last_payment.to_i > 1000 }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This (might) need adjustment once we get the new levels.
straight-shoota marked this conversation as resolved.
Show resolved
Hide resolved
|
||
write_csv("sponsor_logos_s.csv", all_sponsors.select { |sponsor| sponsor.last_payment.to_i.in?(350...1000) }) | ||
straight-shoota marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
def write_csv(filename, sponsors) | ||
open_csv(filename) do |csv| | ||
csv.row "logo", "name", "url", "last_payment", "all_time", "since", "level" | ||
|
||
all_sponsors.each do |sponsor| | ||
sponsors.each do |sponsor| | ||
currency = sponsor.currency || "$" | ||
|
||
csv.row sponsor.logo, | ||
|
@@ -81,3 +85,11 @@ File.open("#{__DIR__}/../_data/sponsors.csv", "w") do |file| | |
end | ||
end | ||
end | ||
|
||
def open_csv(filename, datadir = Path[__DIR__, "..", "_data"]) | ||
File.open(datadir.join(filename), "w") do |file| | ||
CSV.build(file) do |csv| | ||
yield csv | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For posterity, we're not listing the total, so there's no point in having this updated