forked from staylor/react-helmet-async
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.js
76 lines (69 loc) · 1.59 KB
/
constants.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
export const TAG_PROPERTIES = {
CHARSET: 'charset',
CSS_TEXT: 'cssText',
HREF: 'href',
HTTPEQUIV: 'http-equiv',
INNER_HTML: 'innerHTML',
ITEM_PROP: 'itemprop',
NAME: 'name',
PROPERTY: 'property',
REL: 'rel',
SRC: 'src',
};
export const ATTRIBUTE_NAMES = {
BODY: 'bodyAttributes',
HTML: 'htmlAttributes',
TITLE: 'titleAttributes',
};
export const TAG_NAMES = {
BASE: 'base',
BODY: 'body',
HEAD: 'head',
HTML: 'html',
LINK: 'link',
META: 'meta',
NOSCRIPT: 'noscript',
SCRIPT: 'script',
STYLE: 'style',
TITLE: 'title',
FRAGMENT: 'Symbol(react.fragment)',
};
export const SEO_PRIORITY_TAGS = {
link: { rel: ['amphtml', 'canonical', 'alternate'] },
script: { type: ['application/ld+json'] },
meta: {
charset: '',
name: ['robots', 'description'],
property: [
'og:type',
'og:title',
'og:url',
'og:image',
'og:image:alt',
'og:description',
'twitter:url',
'twitter:title',
'twitter:description',
'twitter:image',
'twitter:image:alt',
'twitter:card',
'twitter:site',
],
},
};
export const VALID_TAG_NAMES = Object.keys(TAG_NAMES).map(name => TAG_NAMES[name]);
export const REACT_TAG_MAP = {
accesskey: 'accessKey',
charset: 'charSet',
class: 'className',
contenteditable: 'contentEditable',
contextmenu: 'contextMenu',
'http-equiv': 'httpEquiv',
itemprop: 'itemProp',
tabindex: 'tabIndex',
};
export const HTML_TAG_MAP = Object.keys(REACT_TAG_MAP).reduce((obj, key) => {
obj[REACT_TAG_MAP[key]] = key;
return obj;
}, {});
export const HELMET_ATTRIBUTE = 'data-rh';