Chandra-MARX / doc

Documentation for the MARX code (Chandra X-ray raytracing)
http://space.mit.edu/cxc/marx/
GNU General Public License v2.0
0 stars 3 forks source link

Prevent search engines from showing outdated docs #33

Open hamogu opened 7 years ago

hamogu commented 7 years ago

Current marx documentation is a the canonical address space.mit.edu/cxc/marx but all the old version are still available at marx-5.0, marx-5.1 etc. I want users who come by google to automatically find the new version. Two options would be:

hamogu commented 7 years ago

A tried a few searches. The very old pdfs for marxs 3.0 and 4.0 come up, but all the links I've seen to web pages point to /marx/ with no version number attached to this is not a problem right now. I should just think about steps to prevent this from becoming a problem in the future (CIAO needs to address that now).

hamogu commented 7 years ago

https://support.google.com/webmasters/answer/139066?hl=en#2 could be used to make sure the canonical page in indexed not the specific page.

hamogu commented 7 years ago

Here are some notes from a search to find the appropriate Javascript commands to insert something if present: Insert something:

var text = document.createTextNode('the text');
var child = document.getElementById('childDiv');
child.parentNode.insertBefore(text, child);

check if present:

$.ajax({
    url:'http://www.example.com/somefile.ext',
    type:'HEAD',
    error: function()
    {
        //file not exists
    },
    success: function()
    {
        //file exists
    }
});

This is even easier: Client Side Includes from http://ask-leo.com/how_do_i_include_one_html_file_inside_another.html

As I mentioned above, there is no actual syntax for a client-side include but we can mimic one using Javascript. For example:

<script src="b.js" type="text/javascript"> </script> 

When encountered, the browser downloads the script "b.js", executes it, and prints any output that the script might generate as if it were inline HTML. Technically that's not an include but the script "b.js" could be nothing more than a series of javascript "print" statements such as these:

document.write("<table>")
document.write("<tr>")
... and so on 

"Welcome to 'include' files - an incredibly powerful facility that can do this, and so much more, on your web site."

You can see it's "printing" the HTML you want included. In other words, if you can format your include file as a series of javascript prints, you can use client-side include to insert it.