Skip to content

Commit

Permalink
fix #61
Browse files Browse the repository at this point in the history
  • Loading branch information
jj committed Mar 23, 2021
1 parent 3d310fa commit 59adbc1
Show file tree
Hide file tree
Showing 4 changed files with 277 additions and 607 deletions.
17 changes: 9 additions & 8 deletions components/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export const Page = ({ cmsData }: PageProps) => {
<h1 className="post-full-title">{page.title}</h1>
</header>

{featImg && (
nextImages.feature && featImg.dimensions ? (
{featImg &&
(nextImages.feature && featImg.dimensions ? (
<figure className="post-full-image" style={{ display: 'inherit' }}>
<Image
src={featImg.url}
Expand All @@ -64,12 +64,13 @@ export const Page = ({ cmsData }: PageProps) => {
{...featImg.dimensions}
/>
</figure>
) : (page.feature_image && (
<figure className="post-full-image">
<img src={page.feature_image} alt={page.title} />
</figure>
))
)}
) : (
page.feature_image && (
<figure className="post-full-image">
<img src={page.feature_image} alt={page.title} />
</figure>
)
))}

{/* The main page content */}
<section className="post-full-content">
Expand Down
12 changes: 6 additions & 6 deletions components/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface PostProps {

export const Post = ({ cmsData }: PostProps) => {
const { post, settings, seoImage, previewPosts, prevPost, nextPost, bodyClass } = cmsData
const { slug, url, meta_description, excerpt } = post
const { slug, url, meta_description, excerpt, title } = post
const { url: cmsUrl } = settings
const description = meta_description || excerpt

Expand All @@ -61,15 +61,15 @@ export const Post = ({ cmsData }: PostProps) => {

return (
<>
<SEO {...{ description, settings, seoImage, article: post }} />
<SEO {...{ description, settings, seoImage, article: post, title }} />
<StickyNavContainer
throttle={300}
isPost={true}
activeClass="nav-post-title-active"
render={(sticky) => (
<Layout
{...{ bodyClass, settings, sticky }}
header={<HeaderPost {...{ settings, sticky, title: post.title }} />}
header={<HeaderPost {...{ settings, sticky, title }} />}
previewPosts={<PreviewPosts {...{ settings, primaryTag: post.primary_tag, posts: previewPosts, prev: prevPost, next: nextPost }} />}
>
<div className="inner">
Expand All @@ -84,7 +84,7 @@ export const Post = ({ cmsData }: PostProps) => {
)}

<h1 ref={sticky && sticky.anchorRef} className="post-full-title">
{post.title}
{title}
</h1>

{post.custom_excerpt && <p className="post-full-custom-excerpt">{post.custom_excerpt}</p>}
Expand Down Expand Up @@ -122,7 +122,7 @@ export const Post = ({ cmsData }: PostProps) => {
<figure className="post-full-image" style={{ display: 'inherit' }}>
<Image
src={featImg.url}
alt={post.title}
alt={title}
quality={nextImages.quality}
layout="responsive"
sizes={`
Expand All @@ -138,7 +138,7 @@ export const Post = ({ cmsData }: PostProps) => {
) : (
post.feature_image && (
<figure className="post-full-image">
<img src={post.feature_image} alt={post.title} />
<img src={post.feature_image} alt={title} />
</figure>
)
))}
Expand Down
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"postbuild": "next-sitemap"
},
"dependencies": {
"@tryghost/content-api": "^1.4.15",
"@tryghost/content-api": "^1.5.1",
"@types/refractor": "^3.0.0",
"cheerio": "^1.0.0-rc.5",
"dayjs": "^1.10.4",
Expand All @@ -48,47 +48,47 @@
"fs": "^0.0.1-security",
"hast-util-to-string": "^1.0.4",
"lodash.throttle": "^4.1.1",
"next": "^10.0.7",
"next": "^10.0.9",
"nodemailer": "^6.5.0",
"nodemailer-smtp-transport": "^2.7.4",
"probe-image-size": "^6.0.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-is": "^17.0.1",
"probe-image-size": "^7.0.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-is": "^17.0.2",
"refractor": "^3.3.1",
"rehype": "^11.0.0",
"rehype-react": "^6.2.0",
"rss": "^1.2.2",
"sanitize-html": "^2.3.2",
"sanitize-html": "^2.3.3",
"unist-util-visit": "^2.0.3"
},
"devDependencies": {
"@next/bundle-analyzer": "^10.0.7",
"@types/cheerio": "^0.22.24",
"@next/bundle-analyzer": "^10.0.9",
"@types/cheerio": "^0.22.28",
"@types/lodash": "^4.14.168",
"@types/node": "^14.14.31",
"@types/nodemailer": "^6.4.0",
"@types/node": "^14.14.35",
"@types/nodemailer": "^6.4.1",
"@types/nodemailer-smtp-transport": "^2.7.4",
"@types/react": "^17.0.2",
"@types/react": "^17.0.3",
"@types/rss": "^0.0.28",
"@types/sanitize-html": "^1.27.1",
"@types/styled-components": "^5.1.7",
"@types/styled-components": "^5.1.9",
"@types/testing-library__react": "^10.2.0",
"@types/tryghost__content-api": "^1.3.6",
"@typescript-eslint/eslint-plugin": "^4.16.1",
"@typescript-eslint/parser": "^4.16.1",
"autoprefixer": "^10.2.4",
"critters": "^0.0.7",
"eslint": "^7.21.0",
"@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/parser": "^4.19.0",
"autoprefixer": "^10.2.5",
"critters": "^0.0.9",
"eslint": "^7.22.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react": "^7.23.0",
"eslint-plugin-react-hooks": "^4.2.0",
"next-sitemap": "^1.5.10",
"postcss": "^8.2.6",
"next-sitemap": "^1.6.9",
"postcss": "^8.2.8",
"postcss-color-mod-function": "^3.0.3",
"postcss-easy-import": "^3.0.0",
"postcss-preset-env": "^6.7.0",
"prettier": "^2.2.1",
"typescript": "^4.2.2"
"typescript": "^4.2.3"
}
}
Loading

0 comments on commit 59adbc1

Please sign in to comment.