Skip to content

Commit

Permalink
add beian info in the footer
Browse files Browse the repository at this point in the history
  • Loading branch information
gqcn committed Nov 27, 2024
1 parent f587713 commit c3580b4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,6 @@ table th, table td {
}
}

.beian {
font-size: 88%;
}
21 changes: 21 additions & 0 deletions src/theme/Footer/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import Footer from '@theme-original/Footer';

export default function CustomFooter(props) {
React.useEffect(() => {
const currentDomain = window.location.hostname;
const icpNumber = currentDomain === 'goframe.org.cn'
? '<a href="https://beian.miit.gov.cn/" target="_blank" rel="noreferrer">蜀ICP备2024111610号</a >' : null;
if (icpNumber) {
const footerElement = document.querySelector('.footer__bottom');
if (footerElement) {
const icpElement = document.createElement('div');
icpElement.className = "mt-2 beian"
icpElement.innerHTML = icpNumber;
footerElement.appendChild(icpElement);
}
}
}, []);

return <Footer {...props} />;
}

0 comments on commit c3580b4

Please sign in to comment.