T406950: add Wikimedia Commons link support to work pages

Changes

  • pdclasses.py: Added commons_link attribute in Work class to extract 'commonswiki' sitelink.
  • app.py: Updated work_page route to pass work_commons_link to the template.
  • work.html: Displayed Wikidata, Wikipedia, and Wikimedia Commons links inline with conditional logic.

Testing

  • Verified with work IDs such as Q42 (Douglas Adams).
  • Confirmed 404 error resolved.
  • Verified proper rendering of "Wikidata | Wikipedia | Wikimedia Commons" section.

Result

Work pages now display links to all relevant Wikimedia resources.

Task: T406950 (Outreachy microtask)

before:

before_-_work_page

after:

after_-_work_page

Merge request reports

Loading