Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for legal requirements of 中国大陆网站备案 #80

Merged
merged 4 commits into from
Oct 26, 2023
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
50 changes: 50 additions & 0 deletions src/theme/Footer/Copyright/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React from 'react'
import Copyright from '@theme-original/Footer/Copyright'

import styles from './styles.module.css'

function ICPBeianLink(
{
province,
recordNumber,
subRecordNumber,
}: {
province: string,
recordNumber: number,
subRecordNumber: number,
},
): JSX.Element {
return (
<a href="https://beian.miit.gov.cn" target="_blank">{province}ICP备{recordNumber}号-{subRecordNumber}</a>
)
}

function MPSBeianLink(
{
province,
recordNumber,
}: {
province: string,
recordNumber: number,
},
): JSX.Element {
const queryLinkURL = `http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=${recordNumber}`
return (
<>
<img src="/img/mps-beian-logo.webp" height="28" className={styles.mpsLogo} />
<a href={queryLinkURL} target="_blank">{province}公网安备{recordNumber}号</a>
</>
)
}

export default function CopyrightWrapper(props: any): JSX.Element {
return (
<>
<Copyright {...props} />
<ul className={styles.footer__beian}>
<li><ICPBeianLink province="苏" recordNumber={17027553} subRecordNumber={2} /></li>
{/* <li><MPSBeianLink province="沪" recordNumber={11223344001122} /></li> */}
</ul>
</>
)
}
15 changes: 15 additions & 0 deletions src/theme/Footer/Copyright/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* 备案信息 */
.footer__beian {
margin: 0;
padding: 0;
}

.footer__beian li {
list-style: none;
display: inline;
}

.mpsLogo {
margin: 0 0.5rem;
vertical-align: text-bottom;
}
Binary file added static/img/mps-beian-logo.webp
Binary file not shown.