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

Add og image and meta tags #649

Merged
merged 5 commits into from
May 9, 2020
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
Binary file added public/static/meta/ama.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions src/components/AMAQuestions/QuestionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,20 @@ export default function QuestionItem(props: Props) {
}

return (
<Grid gap={question.answer ? 8 : 4}>
<Grid gap={8}>
<P style={{ fontWeight: '500' }}>{question.question}</P>
{question.answer && (
<Grid style={{ alignItems: 'start' }} columns={'1fr'}>
<Grid style={{ alignItems: 'start' }} columns={'16px 1fr'} gap={12}>
<img
src={'/static/img/avatar.jpeg'}
alt={'Brian Lovin'}
style={{
marginTop: '3px',
width: '16px',
height: '16px',
borderRadius: '16px',
}}
/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This image is missing a text alternative (alt attribute). This is a problem for people using screen readers.

<P>{question.answer}</P>
</Grid>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const theme = {
heading: 800,
},
lineHeights: {
body: 1.6,
body: 1.4,
heading: 1.2,
code: 1.6,
},
Expand Down
18 changes: 17 additions & 1 deletion src/pages/ama.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useGetAmaQuestionsQuery } from '~/graphql/types.generated'
import FullscreenLoading from '~/components/FullscreenLoading'
import AMAQuestions from '~/components/AMAQuestions'
import { CenteredColumn } from '~/components/Layouts'
import { NextSeo } from 'next-seo'

function About() {
// pre-populate data from the cache, but check for any new ones after
Expand All @@ -23,6 +24,21 @@ function About() {

return (
<Page withHeader>
<NextSeo
title={'Ask Me Anything'}
description={'Answering questions, just for fun.'}
openGraph={{
url: 'https://brianlovin.com/ama',
title: 'Ask Me Anything',
description: 'Answering questions, just for fun.',
images: [
{
url: 'https://brianlovin.com/static/meta/ama.png',
alt: 'Ask Me Anything',
},
],
}}
/>
<CenteredColumn>
<Grid gap={16}>
<H3>Ask Me Anything</H3>
Expand Down Expand Up @@ -50,7 +66,7 @@ export async function getStaticProps() {
const apolloStaticCache = client.cache.extract()
return {
// because this data is slightly more dynamic, update it every hour
unstable_revalidate: 60 * 60,
unstable_revalidate: 60,
props: {
apolloStaticCache,
},
Expand Down