@daeryun/dr_components 0.9.78 → 0.9.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -74,29 +74,41 @@ const LawInfoNew = ({ data, tel }) => {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}, [template]);
|
|
77
|
-
console.log('faqCount : ', faqCount);
|
|
78
77
|
const handleFaqItemType = (isFaqActive, faqCount) => {
|
|
79
|
-
|
|
80
|
-
if (isFaqActive || isActive) {
|
|
78
|
+
if (isFaqActive || faqCount >= 2) {
|
|
81
79
|
return 'https://schema.org/FAQPage';
|
|
82
80
|
}
|
|
83
81
|
return undefined;
|
|
84
82
|
};
|
|
85
83
|
const handleFaqItemScope = (isFaqActive, faqCount) => {
|
|
86
|
-
|
|
87
|
-
if (isFaqActive || isActive) {
|
|
84
|
+
if (isFaqActive || faqCount >= 2) {
|
|
88
85
|
return true;
|
|
89
86
|
}
|
|
90
87
|
return undefined;
|
|
91
88
|
};
|
|
92
89
|
const convertFaqItemType = (template) => {
|
|
93
90
|
if (faqCount >= 2) {
|
|
91
|
+
const before = template.description;
|
|
94
92
|
template.description = template.description
|
|
95
93
|
.replace(/itemtype\s*=\s*["']https:\/\/schema\.org\/FAQPage["']/gi, '');
|
|
94
|
+
if (before !== template.description) {
|
|
95
|
+
console.log('✅ FAQPage itemType 제거됨');
|
|
96
|
+
console.log('Before:', before.substring(0, 200) + '...');
|
|
97
|
+
console.log('After:', template.description.substring(0, 200) + '...');
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
console.log('❌ FAQPage itemType 제거되지 않음 - 패턴을 찾을 수 없음');
|
|
101
|
+
console.log('Content sample:', before.substring(0, 200) + '...');
|
|
102
|
+
}
|
|
96
103
|
return template;
|
|
97
104
|
}
|
|
98
105
|
return template;
|
|
99
106
|
};
|
|
107
|
+
// Microdata 설정 확인
|
|
108
|
+
console.log('isFaqActive:', isFaqActive);
|
|
109
|
+
console.log('faqCount : ', faqCount);
|
|
110
|
+
console.log('itemType:', handleFaqItemType(isFaqActive, faqCount));
|
|
111
|
+
console.log('itemScope:', handleFaqItemScope(isFaqActive, faqCount));
|
|
100
112
|
return (<div itemScope={handleFaqItemScope(isFaqActive, faqCount)} itemType={handleFaqItemType(isFaqActive, faqCount)} ref={printRef}>
|
|
101
113
|
<div id={'sub_contents'}>
|
|
102
114
|
<div className="font-[SUIT]] relative m-auto mb-[60px] w-[90%] max-w-screen-2xl max-xs:mb-[30px]">
|
|
@@ -102,22 +102,16 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
102
102
|
}
|
|
103
103
|
}, [template]);
|
|
104
104
|
|
|
105
|
-
console.log('faqCount : ', faqCount);
|
|
106
|
-
|
|
107
105
|
const handleFaqItemType = (isFaqActive: boolean, faqCount: number): string | undefined => {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (isFaqActive || isActive) {
|
|
106
|
+
if (isFaqActive || faqCount >= 2) {
|
|
111
107
|
return 'https://schema.org/FAQPage';
|
|
112
108
|
}
|
|
113
109
|
|
|
114
110
|
return undefined;
|
|
115
111
|
};
|
|
116
112
|
|
|
117
|
-
const handleFaqItemScope = (isFaqActive: boolean, faqCount: number):
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (isFaqActive || isActive) {
|
|
113
|
+
const handleFaqItemScope = (isFaqActive: boolean, faqCount: number): true | undefined => {
|
|
114
|
+
if (isFaqActive || faqCount >= 2) {
|
|
121
115
|
return true;
|
|
122
116
|
}
|
|
123
117
|
|
|
@@ -126,15 +120,31 @@ const LawInfoNew = ({ data, tel }: ILawInfoNewPageTypes) => {
|
|
|
126
120
|
|
|
127
121
|
const convertFaqItemType = (template: ISeoTemplateTypes): ISeoTemplateTypes => {
|
|
128
122
|
if (faqCount as number >= 2) {
|
|
123
|
+
const before = template.description;
|
|
129
124
|
template.description = template.description
|
|
130
125
|
.replace(/itemtype\s*=\s*["']https:\/\/schema\.org\/FAQPage["']/gi, '');
|
|
131
126
|
|
|
127
|
+
if (before !== template.description) {
|
|
128
|
+
console.log('✅ FAQPage itemType 제거됨');
|
|
129
|
+
console.log('Before:', before.substring(0, 200) + '...');
|
|
130
|
+
console.log('After:', template.description.substring(0, 200) + '...');
|
|
131
|
+
} else {
|
|
132
|
+
console.log('❌ FAQPage itemType 제거되지 않음 - 패턴을 찾을 수 없음');
|
|
133
|
+
console.log('Content sample:', before.substring(0, 200) + '...');
|
|
134
|
+
}
|
|
135
|
+
|
|
132
136
|
return template;
|
|
133
137
|
}
|
|
134
138
|
|
|
135
139
|
return template;
|
|
136
140
|
};
|
|
137
141
|
|
|
142
|
+
// Microdata 설정 확인
|
|
143
|
+
console.log('isFaqActive:', isFaqActive);
|
|
144
|
+
console.log('faqCount : ', faqCount);
|
|
145
|
+
console.log('itemType:', handleFaqItemType(isFaqActive, faqCount as number));
|
|
146
|
+
console.log('itemScope:', handleFaqItemScope(isFaqActive, faqCount as number));
|
|
147
|
+
|
|
138
148
|
return (
|
|
139
149
|
<div
|
|
140
150
|
itemScope={handleFaqItemScope(isFaqActive, faqCount as number)}
|