Skip to content

Commit 302cc7c

Browse files
committed
1.6.0 (#390)
* feat(next): implement entity revalidated event * chore(next): phpcs warnings hehe ci is working * docs(www): add documentation for on-demand revalidation * feat(basic-starter): add DRUPAL_REVALIDATE_SECRET variable * feat(graphql-starter): add DRUPAL_REVALIDATE_SECRET variable * docs(www): update docs for environment variables * fix(www): add redirect for /docs/on-demand-revalidation * docs(www): add next-drupal 1.6.0 blog post * docs(www): update blog post * feat(www): add new learn section * feat: implement rehype-pretty-code for blog pages
1 parent 63e9762 commit 302cc7c

File tree

7 files changed

+57
-49
lines changed

7 files changed

+57
-49
lines changed

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ NEXT_IMAGE_DOMAIN=dev.next-drupal.org
66
DRUPAL_CLIENT_ID=
77
DRUPAL_CLIENT_SECRET=
88

9-
# Required for Preview Mode
10-
DRUPAL_PREVIEW_SECRET=secret
9+
# Required for On-demand Revalidation
10+
DRUPAL_REVALIDATE_SECRET=secret

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5+
6+
## 0.0.2 (2022-12-06)
7+
8+
9+
### Features
10+
11+
* add graphql-starter ([dd19609](https://github.com/chapter-three/next-drupal/commit/dd1960931328012e39026ae3638b5e9b336c74c3))

components/layout.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@ export function Layout({ children }) {
99
<div className="max-w-screen-md px-6 mx-auto">
1010
<header>
1111
<div className="container flex items-center justify-between py-6 mx-auto">
12-
<Link href="/" passHref>
13-
<a className="text-2xl font-semibold no-underline">
14-
Next.js for Drupal
15-
</a>
12+
<Link href="/" className="text-2xl font-semibold no-underline">
13+
Next.js for Drupal
1614
</Link>
17-
<Link href="https://next-drupal.org/docs" passHref>
18-
<a target="_blank" rel="external" className="hover:text-blue-600">
19-
Read the docs
20-
</a>
15+
<Link
16+
href="https://next-drupal.org/docs"
17+
target="_blank"
18+
rel="external"
19+
className="hover:text-blue-600"
20+
>
21+
Read the docs
2122
</Link>
2223
</div>
2324
</header>

components/node--article--teaser.tsx

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Image from "next/image"
22
import Link from "next/link"
33

4-
import { absoluteUrl, formatDate } from "lib/utils"
4+
import { formatDate } from "lib/utils"
55
import { Article } from "types"
66

77
interface NodeArticleTeaserProps {
@@ -11,10 +11,8 @@ interface NodeArticleTeaserProps {
1111
export function NodeArticleTeaser({ node, ...props }: NodeArticleTeaserProps) {
1212
return (
1313
<article {...props}>
14-
<Link href={node.path} passHref>
15-
<a className="no-underline hover:text-blue-600">
16-
<h2 className="mb-4 text-4xl font-bold">{node.title}</h2>
17-
</a>
14+
<Link href={node.path} className="no-underline hover:text-blue-600">
15+
<h2 className="mb-4 text-4xl font-bold">{node.title}</h2>
1816
</Link>
1917
<div className="mb-4 text-gray-600">
2018
{node.author?.displayName ? (
@@ -31,27 +29,26 @@ export function NodeArticleTeaser({ node, ...props }: NodeArticleTeaserProps) {
3129
src={node.image.url}
3230
width={768}
3331
height={480}
34-
layout="responsive"
35-
objectFit="cover"
3632
alt={node.title}
3733
/>
3834
</figure>
3935
)}
40-
<Link href={node.path} passHref>
41-
<a className="inline-flex items-center px-6 py-2 border border-gray-600 rounded-full hover:bg-gray-100">
42-
Read article
43-
<svg
44-
viewBox="0 0 24 24"
45-
fill="none"
46-
stroke="currentColor"
47-
strokeWidth="2"
48-
strokeLinecap="round"
49-
strokeLinejoin="round"
50-
className="w-4 h-4 ml-2"
51-
>
52-
<path d="M5 12h14M12 5l7 7-7 7" />
53-
</svg>
54-
</a>
36+
<Link
37+
href={node.path}
38+
className="inline-flex items-center px-6 py-2 border border-gray-600 rounded-full hover:bg-gray-100"
39+
>
40+
Read article
41+
<svg
42+
viewBox="0 0 24 24"
43+
fill="none"
44+
stroke="currentColor"
45+
strokeWidth="2"
46+
strokeLinecap="round"
47+
strokeLinejoin="round"
48+
className="w-4 h-4 ml-2"
49+
>
50+
<path d="M5 12h14M12 5l7 7-7 7" />
51+
</svg>
5552
</Link>
5653
</article>
5754
)

components/node--article.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ export function NodeArticle({ node, ...props }: NodeArticleProps) {
2626
src={node.image.url}
2727
width={768}
2828
height={480}
29-
layout="responsive"
30-
objectFit="cover"
3129
alt={node.title}
3230
/>
3331
</figure>

package.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-starter",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"private": true,
55
"license": "MIT",
66
"scripts": {
@@ -11,21 +11,22 @@
1111
"lint": "next lint"
1212
},
1313
"dependencies": {
14-
"@tailwindcss/typography": "^0.5.2",
15-
"next": "^12.2.3",
14+
"@tailwindcss/typography": "^0.5.8",
15+
"next": "^13",
1616
"next-drupal": "^1.5.0",
17-
"react": "^17.0.2",
18-
"react-dom": "^17.0.2",
19-
"sharp": "^0.30.7"
17+
"react": "^18.2.0",
18+
"react-dom": "^18.2.0",
19+
"sharp": "^0.31.2"
2020
},
2121
"devDependencies": {
22-
"@types/node": "^17.0.23",
23-
"@types/react": "^17.0.43",
24-
"autoprefixer": "^10.4.4",
25-
"eslint": "^8.12.0",
26-
"eslint-config-next": "^12.1.4",
27-
"postcss": "^8.4.12",
28-
"tailwindcss": "^3.0.23",
29-
"typescript": "^4.5.5"
22+
"@types/node": "^18.11.10",
23+
"@types/react": "^18.0.26",
24+
"@types/react-dom": "^18.0.9",
25+
"autoprefixer": "^10.4.13",
26+
"eslint": "^8.28.0",
27+
"eslint-config-next": "^13.0.6",
28+
"postcss": "^8.4.19",
29+
"tailwindcss": "^3.2.4",
30+
"typescript": "^4.9.3"
3031
}
3132
}

pages/api/revalidate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default async function handler(
88
const secret = request.query.secret as string
99

1010
// Validate secret.
11-
if (secret !== process.env.DRUPAL_PREVIEW_SECRET) {
11+
if (secret !== process.env.DRUPAL_REVALIDATE_SECRET) {
1212
return response.status(401).json({ message: "Invalid secret." })
1313
}
1414

0 commit comments

Comments
 (0)