Skip to content

Commit

Permalink
[test]
Browse files Browse the repository at this point in the history
  • Loading branch information
suu3 committed Mar 12, 2024
1 parent 376173d commit 4a141ac
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 12 deletions.
3 changes: 3 additions & 0 deletions gatsby-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ module.exports = {
},
{
resolve: `gatsby-plugin-manifest`, //https://www.gatsbyjs.com/plugins/gatsby-plugin-manifest/

options: {
name: `Suu3 Blog`,
short_name: `Suu3 Blog`,
Expand Down Expand Up @@ -191,6 +192,8 @@ module.exports = {
publisherId: `ca-pub-3886701004172830`,
},
},
`gatsby-plugin-react-
`,
],
// trailingSlash: `never`, // url 뒤 행 슬래쉬 trailing slash
}
2 changes: 1 addition & 1 deletion gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
Array.from({ length: numPages }).forEach((_, i) => {
createPage({
path: `/home/${i + 1}/`,
component: path.resolve(`./src/templates/home.tsx`), // Just like `createPage()`\
component: path.resolve(`./src/templates/category-posts.js`), // Just like `createPage()`\
context: {
limit: postsPerPage,
skip: i * postsPerPage,
Expand Down
10 changes: 1 addition & 9 deletions gatsby-ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
/**
* @type {import('gatsby').GatsbySSR['onRenderBody']}
*/
exports.onRenderBody = ({ setHeadComponents, setHtmlAttributes }) => {
exports.onRenderBody = ({ setHtmlAttributes }) => {
setHtmlAttributes({ lang: `ko` })

setHeadComponents([
<script
async
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3886701004172830"
crossorigin="anonymous"
/>,
])
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"gatsby-plugin-image": "^3.11.0",
"gatsby-plugin-manifest": "^5.11.0",
"gatsby-plugin-postcss": "^6.12.0",
"gatsby-plugin-react-helmet": "^6.13.1",
"gatsby-plugin-sharp": "^5.11.0",
"gatsby-plugin-svgr": "3.0.0-beta.0",
"gatsby-remark-autolink-headers": "^6.12.0",
Expand All @@ -31,7 +32,8 @@
"postcss": "^8.4.30",
"prismjs": "^1.29.0",
"react": "^18.1.0",
"react-dom": "^18.1.0"
"react-dom": "^18.1.0",
"react-helmet": "^6.1.0"
},
"devDependencies": {
"@babel/preset-typescript": "^7.21.5",
Expand Down
42 changes: 42 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/components/@layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import * as React from "react"
import Navigation from "./navigation"
import Footer from "./footer"
import { Helmet } from "react-helmet"

const Layout = ({ location, children }) => {
const rootPath = `${__PATH_PREFIX__}`
const isRootPath = location.pathname === rootPath

return (
<>
<Helmet>
<script
async
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3886701004172830"
crossorigin="anonymous"
></script>
</Helmet>
<Navigation />
<div className="global-wrapper" data-is-root-path={isRootPath}>
<header className="global-header"></header>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/category-posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default CategoryPost
export const Head = () => <Seo title="All posts" />

export const pageQuery = graphql`
query ($category: String!, $skip: Int!, $limit: Int!) {
query ($category: String, $skip: Int!, $limit: Int!) {
site {
siteMetadata {
title
Expand Down

0 comments on commit 4a141ac

Please sign in to comment.