Skip to content

Commit

Permalink
🐛 exclude undefined itemprop
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnath committed Apr 10, 2024
1 parent f946116 commit 3c632f8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/devto/post/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function html(content) {
`
}

const itemprop = content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';
const itemprop = content.schema_itemprop && content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';

return `
<span aria-label="dev.to article" class="post" ${itemprop} itemscope itemtype="https://schema.org/Article">
Expand Down
2 changes: 1 addition & 1 deletion src/devto/user/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function html(content) {
`
}

const itemprop = content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';
const itemprop = content.schema_itemprop && content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';

return `
<section aria-label="dev.to user profile" ${itemprop} itemscope itemtype="https://schema.org/ProfilePage">
Expand Down
2 changes: 1 addition & 1 deletion src/github/repository/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function html(content) {
`
}

const itemprop = content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';
const itemprop = content.schema_itemprop && content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';

return `
<section aria-label="GitHub repository" class="repo" ${itemprop} itemscope itemtype="https://schema.org/SoftwareSourceCode">
Expand Down
2 changes: 1 addition & 1 deletion src/github/user/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function html(content) {
`
}

const itemprop = content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';
const itemprop = content.schema_itemprop && content.schema_itemprop !== '' ? `itemprop=${content.schema_itemprop}` : '';

return `
<section aria-label="GitHub user profile" ${itemprop} itemscope itemtype="https://schema.org/ProfilePage">
Expand Down

0 comments on commit 3c632f8

Please sign in to comment.