In the static build output, all of the standalone documents which are created from AJAX fragments (people, bibls, orgs) have a particular problem in their headers: they are constructed based on the entire containing document rather than the fragment which forms the actual body of the document. This is because the same hcmc:createHtmlHeader() function is called passing in e.g. PERS1 rather than the target person entry. I've been trying to figure out how best to remedy this, and I think the best approach would be this:
The hcmc:createHtmlHeader() function, along with the hcmc:getDcMetadata() function it calls, should have an additional optional parameter which is the component item which is actually the focus of the page. Where this is not passed in (the default situation), the same processing would be applied, but where it is, the document title and resulting metadata should be constructed based on it. Some of that data will still have to be derived from the parent document, but (for instance) the list of places and people referenced (the former already implemented, the latter still not generated in the DC metadata) should be drawn only from the links appearing in the target fragment.
Steps to proceed:
- Add the parameter to the two functions.
- Fix any calls to those functions such that they pass the empty sequence or the relevant fragment.
- Test the build process to make sure nothing is broken, including search (which depends on header metadata).
- Add conditional branching to handle the different cases where a full document versus a fragment is being dealt with, for the current output. This includes ensuring that the document title is correct -- so instead of "Complete Personography" for every person page, it should be "Complete Personography: Fred Bloggs". (Not yet sure what should happen for bibliography entries, where there's no natural "title" other than the document title; perhaps the first title element in the bibl should be used.)
- Add (to both cases) processing of the person data (listing persons mentioned in dcterms.appropriatething, presumably dcterms.subject).
- Check that the outcome is appropriate for all fragment pages.