documentcloud / documentcloud

The DocumentCloud platform
https://www.documentcloud.org
MIT License
424 stars 162 forks source link

Link to Article header on documents/notes/pages #425

Open knowtheory opened 7 years ago

knowtheory commented 7 years ago

In order to achieve the goal of better connecting source material to articles (INSERT LINK TO MANIFESTO HERE), we need a landing place on document pages hosted on documentcloud.org to link back.

The goal here is to funnel as much conversation & traffic back to the original sources.

Having discussed with @reefdog, the way we'll probably roll is a new banner header for documents/notes/pages, and to populate it with the manually set "remote_url" if available.†

That'll work as a first step towards pushing folks set remote_url, and soon to ask organizations to whitelist their domains, so we can employ detected_remote_url in a saner way.

So.

†: the published_url and the detected_remote_url is too noisy/messy at the moment, although i have moves we can make to clean that up especially by blacklisting certain domains when the detected_remote_url is calculated.

reefdog commented 7 years ago

Provide mechanism to detect whether a page is being iframed (so as to hide the banner)

This already happens. Two mechanisms hide the header on iframed note/page show pages:

  1. If ?embed=true is on the URL (which is what we set the iframe src to when we vend iframe embed codes), you get served a special template
  2. If the loader JS realizes it's being loaded in an iframe

In both those cases, the <html> tag gets a DC-embed-iframed class, which hides the header and footer.

Edit: Actually, that second case only applies to pages, because the static note page doesn't even load the note embed JS; it's truly static. I can and should add it though, since I'm already checking if the page is being iframed for the sake of pixel ping.