Skip to content

Commit

Permalink
Only add self-referencing xhtml:link if workflow module is present
Browse files Browse the repository at this point in the history
  • Loading branch information
Fredrik Ekelund committed Feb 27, 2019
1 parent 765fad0 commit ee9434a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,15 @@ module.exports = {
});

each(function(entry) {
entry.url['xhtml:link'] = [{
_attributes: {
rel: 'alternate',
hreflang: entry.url.workflowLocale,
href: entry.url.loc
}
}];
if (self.workflow) {
entry.url['xhtml:link'] = [{
_attributes: {
rel: 'alternate',
hreflang: entry.url.workflowLocale,
href: entry.url.loc
}
}];
}
var alternatives = alternativesByGuid[entry.url.workflowGuid];
_.each(alternatives, function(alternative) {
if (alternative === entry) {
Expand Down

0 comments on commit ee9434a

Please sign in to comment.