Skip to content
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

Canonical URLS #1004

Merged
merged 3 commits into from
Apr 24, 2023
Merged

Canonical URLS #1004

merged 3 commits into from
Apr 24, 2023

Conversation

MatthiasReumann
Copy link
Collaborator

Motivation and Context

Description

  • Add canonicalURL to config.yaml
  • Add struct CanonicalURL which provides canonical urls for the start, course, and watch page
  • Add <link rel="canonical" href=".."> to start, course, and watch page

Steps for Testing

  1. Navigate to a start, course, and watch page
  2. Open web inspector
  3. Check if each <head> includes <link rel="canonical" href=".."> and the URL is correct.
  4. 🌟

@github-actions
Copy link

Your Testserver will be ready at https://1004.test.live.mm.rbg.tum.de in a few minutes.

Logins
Kurs1 Kurs2 Kurs3 Kurs4
public public loggedin enrolled
prof1 prof1 prof2 prof1
prof2
student1
student2
student3
student1
student2
student2
student3
student1
student2

@MatthiasReumann MatthiasReumann linked an issue Apr 24, 2023 that may be closed by this pull request
Copy link
Sponsor Member

@joschahenningsen joschahenningsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far, can we have this on the info and login pages as well?

@@ -6,6 +6,7 @@
{{$stream := .IndexData.TUMLiveContext.Stream}}
{{$course := .IndexData.TUMLiveContext.Course}}
<title>{{.IndexData.Branding.Title}} | {{$course.Name}}: {{$stream.Name}}</title>
<link rel="canonical" href="{{.IndexData.CanonicalURL.Stream $course.Slug $stream.ID}}" />
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to take the version into account (e.g. CAM)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great catch. thanks! 👍

Copy link
Sponsor Member

@joschahenningsen joschahenningsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@joschahenningsen joschahenningsen merged commit 2310854 into dev Apr 24, 2023
@joschahenningsen joschahenningsen deleted the enh/canonical-urls branch April 24, 2023 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add canonical URL to pages
2 participants