Skip to content

Commit

Permalink
Apply noindex only to prerelease versions (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeSCahill authored Apr 5, 2023
1 parent 9460939 commit b7ecbf5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/helpers/is-beta.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = (currentPage) => {
for (let i = 0; i < currentPage.component.versions.length; i++) {
const version = currentPage.component.versions[i].version
if (currentVersion === version) {
if (version.prerelease === 'true') {
if (currentPage.component.versions[i].prerelease === true) {
return true
} else {
return false
Expand Down
2 changes: 1 addition & 1 deletion src/partials/head-meta.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{!-- Prevent old versions from being indexed by search engines --}}
{{#if (ne page.version page.component.latest.version)}}
{{#if (is-beta page)}}
<meta name="robots" content="noindex">
{{/if}}
2 changes: 1 addition & 1 deletion src/partials/head-title.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<title>{{{detag (or page.title defaultPageTitle)}}}{{#with site.title}} :: {{this}}{{/with}}</title>
<title>{{{detag (or page.title defaultPageTitle)}}}{{#with site.title}} | {{this}}{{/with}}</title>

0 comments on commit b7ecbf5

Please sign in to comment.