Add Wikidata and Wikimedia Commons links to work page

Fixes

Fixes the microtask T406950

Description

This fix will display, along with the Wikipedia link, links to Wikidata and Wikimedia Commons if they are available.

It is a nice addition for users to get access to more information about a specific piece of work.

Checklist

  • Inside pdclasses.py file, and inside the class Work, create a commons_link property
  • Inside the app.py file, and inside the work_page function, create (and return) a variable named work_commons_link that contains the value of the property commons_link
  • Maintain codebase common practice by analysing how the links are displayed inside author.html
  • Remove the <p> that was wrapping the <a> tag containing links
  • Adding a <div> to wrap the <a> tag and display them as a row, using | as a separator
  • Add some spacing between the links
  • Remove all unnecessary comments from files
  • Place the separator | inside the if statement and just before the <a> tag, and reorder the links (to avoid having separators "lying around the page")

Screenshots

Before After
Screenshot_2025-10-13_21.45.34 Screenshot_2025-10-13_21.45.57

To take it further:

For small screens, we could add a @media-query to display the links as columns.

Edited by Miiswom

Merge request reports

Loading