Old:Updating Journal Covers

From Dryad wiki
Jump to: navigation, search


Dryad displays cover images for integrated journals in two places. Data packages corresponding to an integrated journal should show the journal's cover image on the data package page, in the title block. Recently integrated journals should appear on the home page as well.

Additionally, the cover images must be uniform sizes: 160x200 on data package pages and 100x130 on the homepage.

There is a Python script to assist in resizing cover images. The script requires the following:

  1. A local clone of the the dryad-utils repo
  2. Python and Pillow


Resizing Cover Images

  1. Start a new branch (based on dryad-master) for these changes
  2. cd to the directory where you checked out dryad_utils
  3. Run ./resize_cover.py /path/to/your/dryad_repo /path/to/journalimage.png
  4. The script will create two sizes of the cover image in your local dryad-repo
  5. Commit these changes

This script uses Pillow to read the image file and create two sizes of journalimage.png. It places them in the appropriate subdirectories beneath dryad-repo, so that they're viewable on the web.

Generating Markup

  1. cd to the directory where you checked out dryad_utils
  2. Run ./make_markup.py "Journal Name" http://journalwebsite.com image-filename.png
    • Note that the image filename here is only the filename, not the path to the file
  3. Review the output
  4. Using your text editor, open Mirage.xsl and add markup for recently integrated
  5. Using your text editor, open DryadItemSummary.xsl and paste the markup in between the other blocks of markup for journal covers, alphabetically.
  6. Review your changes and commit them with Git

This script generates the XML markup needed to render the journal covers on the Dryad pages. If the name contains spaces you must wrap it in double quotes. For the image filename, use the same base name you used for resizing (e.g. journalimage.png).