Skip to content

Commit c339bfb

Browse files
committed
Merge branch 'main' into wizard
2 parents b51552f + b41c58f commit c339bfb

File tree

8 files changed

+96
-203
lines changed

8 files changed

+96
-203
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Next.js Blog Theme
2+
3+
A simple blog starter based on Next.js, Tailwind 3.0 and MDX support. Includes modern design with dark and light theme.
4+
5+
[Wizard](https://nextjs-wizard.netlify.app/) - create your own blog in few clicks and deploy on Netlify.
6+
7+
## Configure the blog
8+
9+
The config is based on ENV Variables to make it easy to integrate with any Jamstack platform like Netlify.
10+
11+
Here are the variables you can edit:
12+
13+
- `BLOG_NAME` - that's the name of your blog and will be displayed below the avatar.
14+
- `BLOG_TITLE` - the main header (`h1`) on the home page, this can be a slogan.
15+
- `BLOG_FOOTER_TEXT` - the text in the footer, usually copyright info.
16+
- `BLOG_THEME`
17+
- `BLOG_FONT_HEADINGS` - the font-family for all HTML headings, from `h1` to `h6`. The value can be one of those:
18+
- `sans-serif` (selected by default)
19+
- `serif`
20+
- `monospace`
21+
- `BLOG_FONT_PARAGRAPHS` - the font-family for all other HTML elements. The value can be one of those:
22+
- `sans-serif` (selected by default)
23+
- `serif`
24+
- `monospace`
25+
26+
All of the env variables can be configured through the [Wizard](https://nextjs-wizard.netlify.app/).
27+
28+
## Adding new posts
29+
30+
All posts are stored in `posts` directory in `.mdx` format. That means you can use React components there to make your posts more interactive.

components/SEO.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Head from "next/head";
2+
3+
export default function SEO({ title, description }) {
4+
return (
5+
<Head>
6+
<title>{title}</title>
7+
<meta name="description" content={description} />
8+
<meta property="og:title" content={title} />
9+
</Head>
10+
);
11+
}

netlify.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,2 @@
1-
[build]
2-
publish = "out"
3-
41
[[plugins]]
52
package = "@netlify/plugin-nextjs"
6-
7-
[template.environment]
8-
BLOG_NAME = "set the name of the blog here"
9-
BLOG_TITLE = "set the blog title here"
10-
BLOG_FOOTER_TEXT = "set the blog footer text here"

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@octokit/auth-token": "^2.5.0",
1414
"@octokit/core": "^3.5.1",
1515
"@octokit/plugin-rest-endpoint-methods": "^5.13.0",
16-
"@tailwindcss/typography": "^0.4.1",
16+
"@tailwindcss/typography": "^0.5.0",
1717
"classnames": "^2.3.1",
1818
"github-oauth-popup": "^1.2.0",
1919
"gray-matter": "^4.0.2",
@@ -26,7 +26,7 @@
2626
},
2727
"devDependencies": {
2828
"autoprefixer": "^10.4.0",
29-
"postcss": "^8.3.11",
30-
"tailwindcss": "^2.2.19"
29+
"postcss": "^8.4.4",
30+
"tailwindcss": "^3.0.0"
3131
}
3232
}

pages/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ import Header from "../components/Header";
66
import Layout, { GradientBackground } from "../components/Layout";
77
import ArrowIcon from "../components/ArrowIcon";
88
import { getGlobalData } from "../utils/globalData";
9+
import SEO from "../components/SEO";
910

1011
export default function Index({ posts, globalData }) {
1112
return (
1213
<Layout>
14+
<SEO title={globalData.name} description={globalData.blogTitle} />
1315
<Header name={globalData.name} />
1416
<main className="w-full">
1517
<h1 className="text-3xl lg:text-5xl text-center mb-12">
@@ -47,11 +49,11 @@ export default function Index({ posts, globalData }) {
4749
<Footer copyrightText={globalData.footerText} />
4850
<GradientBackground
4951
variant="large"
50-
className="fixed left-0 top-20 opacity-40 dark:opacity-60"
52+
className="fixed top-20 opacity-40 dark:opacity-60"
5153
/>
5254
<GradientBackground
5355
variant="small"
54-
className="absolute left-0 bottom-0 opacity-20 dark:opacity-10"
56+
className="absolute bottom-0 opacity-20 dark:opacity-10"
5557
/>
5658
</Layout>
5759
);

pages/posts/[slug].js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import CustomLink from "../../components/CustomLink";
1414
import Footer from "../../components/Footer";
1515
import Header from "../../components/Header";
1616
import Layout, { GradientBackground } from "../../components/Layout";
17+
import SEO from "../../components/SEO";
1718

1819
// Custom components/renderers to pass to MDX.
1920
// Since the MDX files aren't loaded by webpack, they have no knowledge of how
@@ -36,6 +37,10 @@ export default function PostPage({
3637
}) {
3738
return (
3839
<Layout>
40+
<SEO
41+
title={`${frontMatter.title} - ${globalData.name}`}
42+
description={frontMatter.description}
43+
/>
3944
<Header name={globalData.name} />
4045
<article className="px-6 md:px-0">
4146
<header>
@@ -83,11 +88,11 @@ export default function PostPage({
8388
<Footer copyrightText={globalData.footerText} />
8489
<GradientBackground
8590
variant="large"
86-
className="absolute left-0 -top-32 opacity-30 dark:opacity-50"
91+
className="absolute -top-32 opacity-30 dark:opacity-50"
8792
/>
8893
<GradientBackground
8994
variant="small"
90-
className="absolute left-0 bottom-0 opacity-20 dark:opacity-10"
95+
className="absolute bottom-0 opacity-20 dark:opacity-10"
9196
/>
9297
</Layout>
9398
);

tailwind.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module.exports = {
22
mode: "jit",
3-
purge: ["./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}"],
3+
content: [
4+
"./pages/**/*.{js,ts,jsx,tsx}",
5+
"./components/**/*.{js,ts,jsx,tsx}",
6+
],
47
darkMode: "class", // or 'media' or 'class'
58
presets: [require("./utils/tailwind-preset")],
69
};

0 commit comments

Comments
 (0)