Digital-Humanities-Quarterly / dhq-journal

DHQ is an open-access, peer-reviewed journal of digital humanities.
http://www.digitalhumanities.org/dhq/
11 stars 5 forks source link

Allow using relative paths in links #46

Closed amclark42 closed 2 weeks ago

amclark42 commented 1 year ago

When generating HTML using various templates, it’d be helpful to be able to insert relative links to web assets (CSS, JS, etc.) and to navigate between DHQ pages. Currently, most links start with /dhq, meaning that they will only resolve if the HTML is placed in a certain way, probably using a server.

Using relative links instead would allow DHQ HTML to be proofed in a “standalone” fashion, regardless of where the outer dhq/ directory is placed. It would aid proofing of a statically-generated DHQ site, since testing could occur on local computers instead of in a specific location on a server.

Some coding work would be necessary to take directory structure into account when generating links. As part of the static site generation project, I added a parameter $assets-path to head.xsl. When generating preview article HTML, the Ant build file sets this parameter to ensure that CSS is accurately applied. Other stylesheets would need similar tweaks.

amclark42 commented 2 weeks ago

Fixed in #89. The solution will be part of the static site rollout.