Skip to content

Commit

Permalink
feat: Remove adsence (#943)
Browse files Browse the repository at this point in the history
  • Loading branch information
bicstone authored Jan 2, 2024
1 parent b672f76 commit 206a85c
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 94 deletions.
6 changes: 2 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# AWS_S3_BUCKET_NAME is a required option for gatsby-plugin-s3
AWS_S3_BUCKET_NAME=
AWS_S3_BUCKET_NAME=test
# GTM_ID is a required option for gatsby-plugin-google-tagmanager
GTM_ID=
GTM_ID=test

# optional
# ALL_PAGES_TO_NO_INDEX=true
# GATSBY_ADSENSE_PUB_ID=
# GATSBY_ADSENSE_INARTICLE_AD_ID=
# GATSBY_SITE_URL=https://bicstone.me
# PATH_PREFIX=/portfolio

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/deploy-to-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ jobs:
AWS_S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }}
AWS_REGION: ${{ secrets.AWS_REGION }}
GTM_ID: ${{ vars.GTM_ID }}
GATSBY_ADSENSE_PUB_ID: ${{ vars.GATSBY_ADSENSE_PUB_ID }}
GATSBY_ADSENSE_INARTICLE_AD_ID: ${{ vars.GATSBY_ADSENSE_INARTICLE_AD_ID }}

- uses: aws-actions/configure-aws-credentials@v4
with:
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ Gatsby.js + Amazon CloudFront (Cloud Functions) + Amazon S3 を用いた Jamstac

- Google Tag Manager
- Google Analytics
- Google AdSense
- Sentry

## タスクランナー
Expand Down
52 changes: 0 additions & 52 deletions src/components/InarticleAd.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions src/layouts/HeadTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,6 @@ export const HeadTemplate = (props: {
<link rel="dns-prefetch" href="https://www.googletagmanager.com" />
<link rel="dns-prefetch" href="https://www.google-analytics.com" />
<link rel="dns-prefetch" href="https://ssl.google-analytics.com" />
{/* adsense */}
<link rel="dns-prefetch" href="https://adservice.google.co.jp" />
<link rel="dns-prefetch" href="https://googleads.g.doubleclick.net" />
<link rel="dns-prefetch" href="https://pagead2.googlesyndication.com" />
<link rel="dns-prefetch" href="https://tpc.googlesyndication.com" />
<link rel="dns-prefetch" href="https://partner.googleadservices.com" />
<link rel="dns-prefetch" href="https://www.google.com" />
{/* logrokcet */}
<link rel="dns-prefetch" href="https://cdn.logrocket.io" />
<link rel="dns-prefetch" href="https://cdn.lr-ingest.io" />
<link rel="dns-prefetch" href="https://cdn.lr-in.com" />
<link rel="dns-prefetch" href="https://cdn.lr-in-prod.com" />
<link rel="dns-prefetch" href="https://cdn.lr-ingest.com" />
{/* favicons, thanks to https://realfavicongenerator.net/ */}
<link
rel="apple-touch-icon"
Expand Down
22 changes: 0 additions & 22 deletions src/templates/BlogPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import AccessTimeIcon from "@mui/icons-material/AccessTimeRounded";
import UpdateIcon from "@mui/icons-material/UpdateRounded";
import Card from "@mui/material/Card";
import Container from "@mui/material/Container";
import NoSsr from "@mui/material/NoSsr";
import Typography from "@mui/material/Typography";
import { graphql } from "gatsby";
// Mdx required "React"
Expand All @@ -12,7 +11,6 @@ import type { BlogPostTemplateQuery } from "@/generated/graphqlTypes";
import type { HeadFC, PageProps } from "gatsby";

import { Breadcrumbs } from "@/components/Breadcrumbs";
import { InarticleAd } from "@/components/InarticleAd";
import { Heading } from "@/components/markdown/Heading";
import { SITE_METADATA } from "@/constants/SITE_METADATA";
import { TRANSLATION } from "@/constants/TRANSLATION";
Expand Down Expand Up @@ -251,26 +249,6 @@ const BlogPostTemplate = ({
</section>
</aside>

{isDefined(process.env.GATSBY_ADSENSE_PUB_ID) &&
isDefined(process.env.GATSBY_ADSENSE_INARTICLE_AD_ID) && (
<NoSsr defer>
<aside css={(theme) => ({ margin: theme.spacing(4, 0) })}>
<Typography
variant="h5"
component="h2"
fontWeight="bold"
paragraph
>
{TRANSLATION.blog.adLabel}
</Typography>
<InarticleAd
pubId={process.env.GATSBY_ADSENSE_PUB_ID}
adId={process.env.GATSBY_ADSENSE_INARTICLE_AD_ID}
/>
</aside>
</NoSsr>
)}

<aside css={(theme) => ({ margin: theme.spacing(4, 0) })}>
<Typography
variant="h5"
Expand Down

0 comments on commit 206a85c

Please sign in to comment.