Skip to content

Commit

Permalink
adds meta tag to prevent robots from indexing the item if it is private
Browse files Browse the repository at this point in the history
  • Loading branch information
nwoodward committed Nov 20, 2019
1 parent 2975cdb commit 5144c7b
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -307,6 +307,16 @@ else if (doiMatcher.lookingAt())

XMLOutputter xmlo = new XMLOutputter();
xmlo.output(new Text("\n"), sw);

// Include noindex tag for robots if item is not discoverable
if (!item.isDiscoverable()) {
Element noindex = new Element("meta");
noindex.setAttribute("name", "robots");
noindex.setAttribute("content", "noindex");
xmlo.output(noindex, sw);
xmlo.output(new Text("\n"), sw);
}

for (int i = 0; i < l.size(); i++)
{
Element e = (Element) l.get(i);
Expand Down

0 comments on commit 5144c7b

Please sign in to comment.