This repository has been archived by the owner on Jul 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Use new og-image service for episode previews #4
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import Head from "next/head"; | ||
import React from "react"; | ||
import { episodeTitleWithoutNumber } from "../util/episodes"; | ||
|
||
interface ILayout { | ||
children: React.ReactNode; | ||
|
@@ -18,30 +19,9 @@ export const Layout = ({ children, episode }: ILayout) => { | |
const url = episode | ||
? `${process.env.NEXT_PUBLIC_SITE_URL}/${episode.number}` | ||
: process.env.NEXT_PUBLIC_SITE_URL; | ||
const coverUrl = `${process.env.NEXT_PUBLIC_SITE_URL}/cover.jpg`; | ||
|
||
const metaTags = [ | ||
{ name: "title", content: title }, | ||
{ | ||
name: "keywords", | ||
content: | ||
"webbidevaus, web dev, podcast, react, node, typescript, javascript", | ||
}, | ||
{ | ||
name: "description", | ||
content: description, | ||
}, | ||
{ property: "og:title", content: title }, | ||
{ property: "og:description", content: description }, | ||
{ property: "og:url", content: url }, | ||
{ property: "og:image", content: coverUrl }, | ||
{ property: "og:type", content: "website" }, | ||
{ property: "twitter:title", content: title }, | ||
{ property: "twitter:description", content: description }, | ||
{ property: "twitter:url", content: url }, | ||
{ property: "twitter:image", content: coverUrl }, | ||
{ property: "twitter:card", content: "summary_large_image" }, | ||
]; | ||
const coverUrl = `https://og-webbidevaus.vercel.app/${encodeURIComponent( | ||
`**Jakso ${episode.number}**: ${episodeTitleWithoutNumber(episode.title)}` | ||
)}?theme=${episode.number % 2 === 0 ? "light" : "dark"}&md=1&fontSize=100px`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tätä saa varmaan just sellaseks teemattua kun haluaa? Mietin että vois ainakin jotain väriä laittaa josain kohtaa. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah pentele, pitää siirtää noi tähdet ton encodeUriComponent-kutsun ulkopuolelle |
||
|
||
return ( | ||
<> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
module.exports = { | ||
// serverless for next-on-netlify | ||
target: "serverless", | ||
webpack: (config, { isServer }) => { | ||
rikukissa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Fixes npm packages that depend on `fs` module | ||
if (!isServer) { | ||
config.node = { | ||
fs: "empty", | ||
}; | ||
} | ||
|
||
return config; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missäs nää nyt on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nää ei ollu ollenkaa käytössä 😬 oli unused variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Käytännössä noi taitaa olla kuitenkin kaikki noissa metatageissa, eli olisko tää peruja jostain vanhasta koodista
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Joo kattelin tuolla netlifypreviewissä mut unohin tulla kommentoimaan takas, että kyl ne jotenkin sinne tosiaan valuu.