-
Notifications
You must be signed in to change notification settings - Fork 10
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 OGP tags for user profiles #228
Conversation
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.
Some minor changes, but overall this is a good PR. Thank you for writing this.
src/web/services/user/profile.rs
Outdated
|
||
let mut tags = Tags::default(); | ||
tags.title = page_title.clone(); | ||
tags.url = format!("/user/{}", id); |
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.
Does this URL work without the rcos.io domain at the beginning of 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.
I think it does work but I'll go ahead and change it to the same way it is done for meetings (request URI) for consistency.
src/web/services/user/profile.rs
Outdated
@@ -87,7 +88,7 @@ async fn profile( | |||
// Return early if there was an error. | |||
// Otherwise we can go forward and check for the user's membership in the RCOS | |||
// Discord server. | |||
return template.in_page(&req, page_title).await; | |||
return template.in_page(&req, page_title.clone()).await; |
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.
Why clone here? Ownership will not get moved after returning. Does the compiler error otherwise?
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 was having some issues with ownership and put that while debugging. After thinking about it, it seems unnecessary since it returns so I'll remove.
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.
Looks good!
This adds OGP tags for profile pages. Here is an example of what it might look like on discord.
Coordinator and Project Lead are conditionally shown if that user happens to be those for that semester.