Page MenuHomePhabricator

Add images to homepage
Closed, ResolvedPublic

Description

Add images to make the homepage more visual and create an image credits page to properly attribute images

Reference: https://apaskulin.github.io/wmf-dev-portal-draft/

Homepage images

Notes from design jam on 2022/03/16

Image files can be stored in /src/assets.

Add image directly to a Markdown file, such as index.md:

![A computer browsing Wikipedia](/assets/computer-illustration.svg)

Add image at the document level via template:

# In .jinja file
{% if doc.icon %}
![{{ doc.alttext}}]( {{ doc.icon }} )
{% endif %}

# In .yaml file
icon: /assets/computer-illustration.svg
alttext: A computer browsing Wikipedia
Styles

Initial styles for homepage images in the style of the draft site:

width: 170px;
float: left;
padding-right: 40px;
padding-top: 30px;

Styles can be applied in Markdown using the { class="classname" } syntax:

![A computer browsing Wikipedia](/assets/computer-illustration.svg){ class="section-icon" }

Or, perhaps problematically, prevent { class="classname" } appearing in the translation file by using generalized styles:

p > img {
    ...
}

To do:

Event Timeline

apaskulin moved this task from Inbox to Content & design on the Wikimedia-Developer-Portal board.

For potentially useful future reference: https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/
The "Reference" section of that site does some cute but potentially not ideal stuff with icons in the navigation menu...

(If unicode characters were used, then https://bighack.org/accessibility-screen-readers-special-characters-and-unicode-symbols/ asks for making sure they are used as their meaning implies. If images were used, then making sure aria-hidden="true" role="presentation" is being used would be good (for screenreaders).)

Change 771481 had a related patch set uploaded (by Alex Paskulin; author: Alex Paskulin):

[wikimedia/developer-portal@main] design: WIP patch for adding images

https://gerrit.wikimedia.org/r/771481

apaskulin changed the task status from Open to Stalled.Apr 13 2022, 3:56 PM

I got this set up locally, but we can't use the light mode/dark mode image switcher until we update Material for MkDocs. Since the modified Wikipedia 20 images we're using are all black-and-white, the black-on-transparent images won't show in dark mode. Marking this task as stalled pending the update (T306038) or finding alternative images

Screen Shot 2022-04-13 at 8.56.04 AM.png (1×1 px, 178 KB)

apaskulin changed the task status from Stalled to In Progress.Apr 14 2022, 11:16 PM
apaskulin updated the task description. (Show Details)

Unblocked by T306038

Change 781094 had a related patch set uploaded (by Alex Paskulin; author: Alex Paskulin):

[wikimedia/developer-portal@main] content: Add images to homepage

https://gerrit.wikimedia.org/r/781094

Change 781094 merged by jenkins-bot:

[wikimedia/developer-portal@main] content: Add images to homepage

https://gerrit.wikimedia.org/r/781094

Change 771481 abandoned by Alex Paskulin:

[wikimedia/developer-portal@main] design: WIP patch for adding images

Reason:

Superseded by https://gerrit.wikimedia.org/r/781094

https://gerrit.wikimedia.org/r/771481