mirror of https://gitee.com/answerdev/answer.git
commit
b6aaea47d7
|
@ -1632,7 +1632,7 @@ ui:
|
|||
text: This will insert after <body>
|
||||
footer:
|
||||
label: Footer
|
||||
text: This will insert before </html>.
|
||||
text: This will insert before </body>.
|
||||
sidebar:
|
||||
label: Sidebar
|
||||
text: This will insert in sidebar.
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
"react-router-dom": "^6.8.1",
|
||||
"semver": "^7.3.8",
|
||||
"swr": "^1.3.0",
|
||||
"urlcat": "^3.0.0",
|
||||
"zustand": "^4.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -67,7 +67,6 @@ specifiers:
|
|||
semver: ^7.3.8
|
||||
swr: ^1.3.0
|
||||
typescript: ^4.8.3
|
||||
urlcat: ^3.0.0
|
||||
yaml-loader: ^0.8.0
|
||||
zustand: ^4.1.1
|
||||
|
||||
|
@ -98,7 +97,6 @@ dependencies:
|
|||
react-router-dom: 6.8.1_biqbaboplfbrettd7655fr4n2y
|
||||
semver: 7.3.8
|
||||
swr: 1.3.0_react@18.2.0
|
||||
urlcat: 3.0.0
|
||||
zustand: 4.1.1_react@18.2.0
|
||||
|
||||
devDependencies:
|
||||
|
@ -10986,12 +10984,6 @@ packages:
|
|||
querystringify: 2.2.0
|
||||
requires-port: 1.0.0
|
||||
|
||||
/urlcat/3.0.0:
|
||||
resolution: {integrity: sha512-SSXrIzInzKdWjBfm5iOrPfO6E5Nt0aFs5PTZCauxJTjJE3qhfePAWz8tjGm7dnWMYIAdPGjio51aakunyZHMXQ==}
|
||||
dependencies:
|
||||
qs: 6.11.0
|
||||
dev: false
|
||||
|
||||
/use-sync-external-store/1.2.0_react@18.2.0:
|
||||
resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==}
|
||||
peerDependencies:
|
||||
|
|
|
@ -91,7 +91,7 @@ const handleCustomHeader = (content) => {
|
|||
};
|
||||
|
||||
const handleCustomFooter = (content) => {
|
||||
const el = document.documentElement;
|
||||
const el = document.body;
|
||||
renderCustomArea(el, CUSTOM_MARK_FOOTER, 'beforeend', content);
|
||||
};
|
||||
|
||||
|
|
|
@ -271,7 +271,7 @@ const Index: FC<IProps> = ({
|
|||
);
|
||||
})}
|
||||
{secondAction.length > 0 && (
|
||||
<Dropdown className="ms-3">
|
||||
<Dropdown className="ms-3 d-flex">
|
||||
<Dropdown.Toggle
|
||||
variant="link"
|
||||
size="sm"
|
||||
|
|
|
@ -71,7 +71,7 @@ const Index: FC<IProps> = ({ type, qid, aid, title, slugTitle = '' }) => {
|
|||
<Dropdown.Toggle
|
||||
id="dropdown-share"
|
||||
as="a"
|
||||
className="no-toggle small link-secondary pointer"
|
||||
className="no-toggle small link-secondary pointer d-flex"
|
||||
onClick={() => setShow(true)}
|
||||
style={{ lineHeight: '23px' }}>
|
||||
{t('share.name')}
|
||||
|
|
|
@ -1,22 +1,20 @@
|
|||
import urlcat from 'urlcat';
|
||||
|
||||
import { seoSettingStore } from '@/stores';
|
||||
|
||||
const tagLanding = (slugName: string) => {
|
||||
if (!slugName) {
|
||||
return '/tags';
|
||||
}
|
||||
return urlcat('/tags/:slugName', { slugName });
|
||||
const r = slugName ? `/tags/${slugName}` : '/tags';
|
||||
return r;
|
||||
};
|
||||
|
||||
const tagInfo = (slugName: string) => {
|
||||
if (!slugName) {
|
||||
return '/tags';
|
||||
}
|
||||
return urlcat('/tags/:slugName/info', { slugName });
|
||||
const r = slugName ? `/tags/${slugName}/info` : '/tags';
|
||||
return r;
|
||||
};
|
||||
|
||||
const tagEdit = (tagId: string) => {
|
||||
return urlcat('/tags/:tagId/edit', { tagId });
|
||||
const r = `/tags/${tagId}/edit`;
|
||||
return r;
|
||||
};
|
||||
|
||||
const questionLanding = (questionId: string, slugTitle: string = '') => {
|
||||
const { seo } = seoSettingStore.getState();
|
||||
if (!questionId) {
|
||||
|
@ -24,14 +22,12 @@ const questionLanding = (questionId: string, slugTitle: string = '') => {
|
|||
}
|
||||
// @ts-ignore
|
||||
if (/[13]/.test(seo.permalink) && slugTitle) {
|
||||
return urlcat('/questions/:questionId/:slugPermalink', {
|
||||
questionId,
|
||||
slugPermalink: slugTitle,
|
||||
});
|
||||
return `/questions/${questionId}/${slugTitle}`;
|
||||
}
|
||||
|
||||
return urlcat('/questions/:questionId', { questionId });
|
||||
return `/questions/${questionId}`;
|
||||
};
|
||||
|
||||
const answerLanding = (params: {
|
||||
questionId: string;
|
||||
slugTitle?: string;
|
||||
|
@ -41,9 +37,7 @@ const answerLanding = (params: {
|
|||
params.questionId,
|
||||
params.slugTitle,
|
||||
);
|
||||
return urlcat(`${questionLandingUrl}/:answerId`, {
|
||||
answerId: params.answerId,
|
||||
});
|
||||
return `${questionLandingUrl}/${params.answerId}`;
|
||||
};
|
||||
|
||||
export const pathFactory = {
|
||||
|
|
Loading…
Reference in New Issue