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

Release: v1.1.3 #51

Merged
merged 5 commits into from
Oct 19, 2021
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
4 changes: 2 additions & 2 deletions .github/workflows/utterances.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Close utterances issue
on:
issues:
types: [labeled]
types: [opened]
jobs:
close-issue:
runs-on: ubuntu-latest
steps:
- if: github.event.label.name == 'utterances'
- if: github.event.issue.user.login == 'utterances-bot'
name: Close Issue
uses: peter-evans/close-issue@v1
19 changes: 2 additions & 17 deletions src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from 'react';
import styled, { ThemeProvider } from 'styled-components';
import { Helmet } from 'react-helmet';
import GlobalStyle from '../../styles/GlobalStyle';
import { theme } from '../../styles/theme';
import Header from '../Header';
import useSiteMetaData from '../../hooks/useSiteMetaData';
import SEO from '../SEO';

const ContentWrapper = styled.div`
margin: 0 auto;
Expand All @@ -28,24 +27,10 @@ type Props = {
};

const Layout = ({ children, path, title, description, image }: Props) => {
const { title: siteName, siteUrl } = useSiteMetaData();

return (
<>
<ThemeProvider theme={theme}>
<Helmet htmlAttributes={{ lang: 'ko' }}>
<title>{title}</title>
<meta name="description" content={description} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:url" content={siteUrl} />
<meta property="og:image" content={image} />
<meta property="og:site_name" content={siteName} />
<meta
name="google-site-verification"
content="XuYZDwUE6RHYN-MpEJhfTnegOVDz8jolBYYFBZT1A1I"
/>
</Helmet>
<SEO title={title} description={description} image={image} />
<GlobalStyle />
<Header path={path} />
<ContentWrapper>{children}</ContentWrapper>
Expand Down
33 changes: 33 additions & 0 deletions src/components/SEO/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react';
import useSiteMetaData from '../../hooks/useSiteMetaData';
import { Helmet } from 'react-helmet';

type Props = {
title: string;
description?: string;
image?: string;
};

const SEO = ({ title, description, image }: Props) => {
const { title: siteName, siteUrl } = useSiteMetaData();

return (
<Helmet htmlAttributes={{ lang: 'ko' }}>
<title>
{title} | {siteName}
</title>
<meta name="description" content={description} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:url" content={siteUrl} />
<meta property="og:image" content={image} />
<meta property="og:site_name" content={siteName} />
<meta
name="google-site-verification"
content="XuYZDwUE6RHYN-MpEJhfTnegOVDz8jolBYYFBZT1A1I"
/>
</Helmet>
);
};

export default SEO;
4 changes: 2 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import PostList from '../components/Main/PostList';
import useSiteMetaData from '../hooks/useSiteMetaData';

const IndexPage = () => {
const { title, description } = useSiteMetaData();
const { description } = useSiteMetaData();

return (
<Layout path="/" title={title} description={description}>
<Layout path="/" title="홈" description={description}>
<PostList />
</Layout>
);
Expand Down