Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/client/updateClientMetaInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ export default function _updateClientMetaInfo (options = {}) {
break
// update attributes
case 'htmlAttrs':
updateTagAttributes(options)(newInfo[key], htmlTag)
break
case 'bodyAttrs':
updateTagAttributes(options)(newInfo[key], key === 'htmlAttrs' ? htmlTag : document.getElementsByTagName('body')[0])
updateTagAttributes(options)(newInfo[key], document.getElementsByTagName('body')[0])
break
case 'headAttrs':
updateTagAttributes(options)(newInfo[key], document.getElementsByTagName('head')[0])
break
// ignore these
case 'titleChunk':
Expand Down
1 change: 1 addition & 0 deletions src/server/generateServerInjector.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function _generateServerInjector (options = {}) {
return titleGenerator(options)(type, data)
case 'htmlAttrs':
case 'bodyAttrs':
case 'headAttrs':
return attrsGenerator(options)(type, data)
default:
return tagGenerator(options)(type, data)
Expand Down
2 changes: 1 addition & 1 deletion src/server/generators/attrsGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default function _attrsGenerator (options = {}) {
/**
* Generates tag attributes for use on the server.
*
* @param {('bodyAttrs'|'htmlAttrs')} type - the type of attributes to generate
* @param {('bodyAttrs'|'htmlAttrs'|'headAttrs')} type - the type of attributes to generate
* @param {Object} data - the attributes to generate
* @return {Object} - the attribute generator
*/
Expand Down
1 change: 1 addition & 0 deletions src/shared/getMetaInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default function _getMetaInfo (options = {}) {
titleTemplate: '%s',
htmlAttrs: {},
bodyAttrs: {},
headAttrs: {},
meta: [],
base: [],
link: [],
Expand Down