Skip to content

Commit

Permalink
feat: Remove in article ads (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
bicstone authored Mar 23, 2024
1 parent a1c3457 commit d048883
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 174 deletions.
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ GTM_ID=exmaple

# 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
2 changes: 1 addition & 1 deletion content
52 changes: 0 additions & 52 deletions src/components/InarticleAd.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions src/pages/histories.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import Container from "@mui/material/Container";
import NoSsr from "@mui/material/NoSsr";
import Typography from "@mui/material/Typography";
import { graphql } from "gatsby";

import type { HistoryPageQuery } from "@/generated/graphqlTypes";
import type { PageProps, HeadFC } from "gatsby";

import { Breadcrumbs } from "@/components/Breadcrumbs";
import { InarticleAd } from "@/components/InarticleAd";
import { Spacer } from "@/components/Spacer";
import { SITE_METADATA } from "@/constants/SITE_METADATA";
import { TRANSLATION } from "@/constants/TRANSLATION";
import { TimelineList } from "@/features/Timeline";
import { TimelineTabList } from "@/features/TimelineTab";
import { HeadTemplate } from "@/layouts/HeadTemplate";
import { isDefined } from "@/utils/typeguard";

export const query = graphql`
query HistoryPage {
Expand Down Expand Up @@ -54,26 +50,6 @@ const HistoryPage = ({ data }: PageProps<HistoryPageQuery>): JSX.Element => {
<TimelineList groups={projectGroups} />
<Spacer y={4} />
<Breadcrumbs title={title} />
<Spacer y={2} />
{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="h3"
fontWeight="bold"
paragraph
>
広告
</Typography>
<InarticleAd
pubId={process.env.GATSBY_ADSENSE_PUB_ID}
adId={process.env.GATSBY_ADSENSE_INARTICLE_AD_ID}
/>
</aside>
</NoSsr>
)}
</Container>
);
};
Expand Down
23 changes: 0 additions & 23 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import Container from "@mui/material/Container";
import NoSsr from "@mui/material/NoSsr";
import Typography from "@mui/material/Typography";
import { graphql } from "gatsby";

import type { IndexPageQuery } from "@/generated/graphqlTypes";
import type { PageProps, HeadFC } from "gatsby";

import { InarticleAd } from "@/components/InarticleAd";
import { Spacer } from "@/components/Spacer";
import { SITE_METADATA } from "@/constants/SITE_METADATA";
import { BioCardList } from "@/features/Bio";
Expand All @@ -15,7 +13,6 @@ import { ArchivedList } from "@/features/TimelineArchived";
import { FeaturedList } from "@/features/TimelineFeatured";
import { TimelineTabList } from "@/features/TimelineTab";
import { HeadTemplate } from "@/layouts/HeadTemplate";
import { isDefined } from "@/utils/typeguard";

export const query = graphql`
query IndexPage {
Expand Down Expand Up @@ -70,26 +67,6 @@ const IndexPage = ({ data }: PageProps<IndexPageQuery>): JSX.Element => {
<Spacer y={6} />
<TimelineVirtualizedList items={timelineItems} />
<Spacer y={2} />
{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
>
広告
</Typography>
<InarticleAd
pubId={process.env.GATSBY_ADSENSE_PUB_ID}
adId={process.env.GATSBY_ADSENSE_INARTICLE_AD_ID}
/>
</aside>
</NoSsr>
)}
<Spacer y={2} />
<Typography variant="h5" component="h2" fontWeight="bold">
Archived
</Typography>
Expand Down
23 changes: 0 additions & 23 deletions src/pages/outputs.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
import Container from "@mui/material/Container";
import NoSsr from "@mui/material/NoSsr";
import Typography from "@mui/material/Typography";
import { graphql } from "gatsby";

import type { OutputsPageQuery } from "@/generated/graphqlTypes";
import type { HeadFC, PageProps } from "gatsby";

import { Breadcrumbs } from "@/components/Breadcrumbs";
import { InarticleAd } from "@/components/InarticleAd";
import { Spacer } from "@/components/Spacer";
import { SITE_METADATA } from "@/constants/SITE_METADATA";
import { TRANSLATION } from "@/constants/TRANSLATION";
import { TimelineList } from "@/features/Timeline";
import { ArchivedList } from "@/features/TimelineArchived";
import { TimelineTabList } from "@/features/TimelineTab";
import { HeadTemplate } from "@/layouts/HeadTemplate";
import { isDefined } from "@/utils/typeguard";

export const query = graphql`
query OutputsPage {
Expand Down Expand Up @@ -107,26 +104,6 @@ const OutputsPage = ({ data }: PageProps<OutputsPageQuery>): JSX.Element => {
<Spacer y={4} />
<Breadcrumbs title={title} />
<Spacer y={2} />
{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="h3"
fontWeight="bold"
paragraph
>
広告
</Typography>
<InarticleAd
pubId={process.env.GATSBY_ADSENSE_PUB_ID}
adId={process.env.GATSBY_ADSENSE_INARTICLE_AD_ID}
/>
</aside>
</NoSsr>
)}
<Spacer y={2} />
<Typography variant="h5" component="h2" fontWeight="bold">
Archived
</Typography>
Expand Down
24 changes: 0 additions & 24 deletions src/pages/projects.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import Container from "@mui/material/Container";
import NoSsr from "@mui/material/NoSsr";
import Typography from "@mui/material/Typography";
import { graphql } from "gatsby";

import type { ProjectsPageQuery } from "@/generated/graphqlTypes";
import type { PageProps, HeadFC } from "gatsby";

import { Breadcrumbs } from "@/components/Breadcrumbs";
import { InarticleAd } from "@/components/InarticleAd";
import { Spacer } from "@/components/Spacer";
import { SITE_METADATA } from "@/constants/SITE_METADATA";
import { TRANSLATION } from "@/constants/TRANSLATION";
import { TimelineList } from "@/features/Timeline";
import { TimelineTabList } from "@/features/TimelineTab";
import { HeadTemplate } from "@/layouts/HeadTemplate";
import { isDefined } from "@/utils/typeguard";

export const query = graphql`
query ProjectsPage {
Expand Down Expand Up @@ -54,26 +50,6 @@ const ProjectsPage = ({ data }: PageProps<ProjectsPageQuery>): JSX.Element => {
<TimelineList groups={projectGroups} />
<Spacer y={4} />
<Breadcrumbs title={title} />
<Spacer y={2} />
{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="h3"
fontWeight="bold"
paragraph
>
広告
</Typography>
<InarticleAd
pubId={process.env.GATSBY_ADSENSE_PUB_ID}
adId={process.env.GATSBY_ADSENSE_INARTICLE_AD_ID}
/>
</aside>
</NoSsr>
)}
</Container>
);
};
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 @@ -249,26 +247,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 d048883

Please sign in to comment.