Skip to content

Commit

Permalink
Merge pull request #241 from ocftw/feature/seo-robots.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
ben196888 authored Sep 25, 2023
2 parents 0e45ab0 + 3eab903 commit 09671dd
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
3 changes: 3 additions & 0 deletions homepage/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
_legacy

_cards
_data
_footer
_pages
9 changes: 9 additions & 0 deletions homepage/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//robots.txt

# Block all crawlers for /admin
User-agent: *
Disallow: /admin

# Allow all crawlers
User-agent: *
Allow: /
18 changes: 17 additions & 1 deletion homepage/src/pages/_document.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Html, Head, Main, NextScript } from 'next/document';
import { GTM_ID } from '../lib/gtm';

export default function Document({ locale }) {
return (
<Html lang={locale}>
<Html>
<Head>
<meta charSet="utf-8" />
<link
Expand Down Expand Up @@ -35,10 +36,25 @@ export default function Document({ locale }) {
src="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/js/fontawesome.min.js"
defer
></script>
{/* <!-- Google tag (gtag.js) --> */}
<script
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer',${GTM_ID});`,
}}
/>
</Head>
<body id="page-top">
<Main />
<NextScript />
<noscript
dangerouslySetInnerHTML={{
__html: `<iframe src="https://www.googletagmanager.com/ns.html?id=${GTM_ID}" height="0" width="0" style="display: none; visibility: hidden;" />`,
}}
/>
</body>
</Html>
);
Expand Down
1 change: 1 addition & 0 deletions homepage/src/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const Index = ({ headInfo, page }) => (
<Head>
<title>{headInfo.title}</title>
<meta name="description" content={headInfo.description} />
<meta name="google-site-verification" content="NejiRhdBA-bewypiYDtrGnKJ09VSH6-15HsXUNKdrm4" />
</Head>
<Script
id="netlify-identity-widget"
Expand Down

0 comments on commit 09671dd

Please sign in to comment.