-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add list of speakers #143
Add list of speakers #143
Conversation
data/speakers.json
Outdated
{ | ||
"Mike Rogers": { | ||
"profile": { | ||
"github_username": "MikeRogers0" |
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.
The cool thing about GitHub is we can pull a bunch more data about the speaker via their API without an API key.
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.
I know this is a draft so not sure what sort of early feedback you're looking for, but I've left some thoughts anyway. Quite excited to see something come together on this though, thanks for tackling it!
<p> | ||
<%= link_to speaker.blog, speaker.blog %> | ||
</p> | ||
</div> |
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.
I know we've taken inspiration from some other website on this, but I'm pretty sure we'll never get most of these details, so lets pare it right back. I quite like the svg icons for the twitter / GitHub links, but I also know that without a huge amount of effort we're probably not going to get twitter and GitHub links for most of our speakers, and for some we don't even have those, some folk just link to LinkedIn and personal websites were the preferred link back in the past. Perhaps we can just introspect on the one link we do have and render an appropriate icon?
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.
Perhaps we can just introspect on the one link we do have and render an appropriate icon?
I agree :) I was hoping to find a way to pull in a bit more information, I think I'll save that for another PR :)
lib/speaker_helpers.rb
Outdated
def all_speakers | ||
data.speakers | ||
.collect { |name, speaker_data| Speaker.new(name, speaker_data) } | ||
.sort_by { |speaker| speaker.name } |
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.
I wonder if we should order this by recency of the speakers talks, so it changes once each meeting is published to show the most recent speakers? I don't think sorting by frequency of talks is a good idea, but maybe recency is weird. We've enough speakers that maybe we'd want A..Z in page navigation so doing anything other than alphabetical is weird?
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.
I agree we should sort by most recently published, I think it's possible now I've figured out a way to pull the coverage data into a easier to work with format.
I'm still working on this, but would love some thoughts on the best way to populate a list of speakers and their talks @h-lame :) The approach I'm currenting is to parse all the |
…t it's looking good
@h-lame - What do you think of the Approach wise: Once I nail down the data, we could potentially have display all the previous speakers with their talks. Then maybe in a future PR we could add a search. |
<% elsif speaker_link.include?('github.com') %> | ||
<%= image_tag 'github.svg', width: 24, height: 24 %> | ||
<% else %> | ||
🔗 |
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.
Can we get an SVG for a standard link svg too? I don't know where the twitter and GitHub ones came from, but the link emoji looks different and has a different baseline, so hopefully we can get a link svg from the same place.
|
||
<ul> | ||
<% speaker.talks.each do |talk| %> | ||
<li><%= link_to talk[:title], "/meetings/#{talk[:year]}/#{talk[:month]}/" %> - <%= talk[:month] %> <%= talk[:year] %></li> |
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.
Minor but let's titlecase the month:
<li><%= link_to talk[:title], "/meetings/#{talk[:year]}/#{talk[:month]}/" %> - <%= talk[:month] %> <%= talk[:year] %></li> | |
<li><%= link_to talk[:title], "/meetings/#{talk[:year]}/#{talk[:month]}/" %> - <%= talk[:month].titlecase %> <%= talk[:year] %></li> |
end | ||
|
||
def save_authors_to_json! | ||
File.write(SPEAKERS_DATA_FILE, JSON.pretty_generate(@authors)) |
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.
Be nice if this file was sorted by name so it's easier to look through and easier to edit as we add things for future meetings. Thinking particularly of the case where we have to add a new talk to an existing speaker. The current order is weird so would get out of hand quickly as we added to it.
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.
Looking good so far. The biggest hurdle is going to be the data. I think you've done a great job on extracting what we have, but a cursory skim through the file does suggest there's a lot of tidy up to do.
I think we could try a different parsing approach, tweak what we have, or just do a manual fix up. Not sure what would be best TBH.
What strikes me as odd is we now have speakers.json
that has {::coverage ...}
links in it to the contents of data/coverage/*.yml
and I wonder, if all this should be data/talks/*.yml
and we slice and dice what we pull out of those into different structures to support the different rendering purposes in the app?
def call | ||
load_all_talks_from_files! | ||
|
||
@talks = @talks.flatten.select { |talk| talk[:author] != nil }.group_by { |talk| talk[:author] } |
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.
There's nothing in the file for talks from before 2010. I know the structure of the write-ups has changed a bit, but not by a huge amount I don't think. So it's weird there's nothing in there from those early meetings.
In the json file I've spotted a few weird speaker names where we've got a greedy regexp match on names with multiple links in them. So I wonder if we should revisit the parsing approach in general? Would we get better results if we rendered the page from markdown -> HTML and then parse with nokogiri? Or maybe we render into Kramdowns internal structure and walk parse that?
I'm a little bit slammed & I don't think I'll be able to complete this. Instead of leaving it hanging, I'm going to close it off & come back to it when I have more time. |
Issue: #31
The aim of this is to create a list of the most recent speakers which is easy to keep up to date.
TODO