upstream #1

Merged
jblu merged 1007 commits from upstream into main 2024-11-04 22:35:57 -06:00
7 changed files with 539 additions and 671 deletions
Showing only changes of commit 94c1a30760 - Show all commits

View File

@ -40,7 +40,7 @@ I wanted it to be nearly as feature-rich as popular blogging templates like [bea
- Easy styling customization with [Tailwind 2.0](https://blog.tailwindcss.com/tailwindcss-v2) and primary color attribute - Easy styling customization with [Tailwind 2.0](https://blog.tailwindcss.com/tailwindcss-v2) and primary color attribute
- Near perfect lighthouse score - [Lighthouse report](https://www.webpagetest.org/result/210111_DiC1_08f3670c3430bf4a9b76fc3b927716c5/) - Near perfect lighthouse score - [Lighthouse report](https://www.webpagetest.org/result/210111_DiC1_08f3670c3430bf4a9b76fc3b927716c5/)
- Lightweight, 39kB first load JS, uses Preact in production build - Lightweight, 45kB first load JS, uses Preact in production build
- Mobile-friendly view - Mobile-friendly view
- Light and dark theme - Light and dark theme
- Supports [plausible](https://plausible.io/), [simple analytics](https://simpleanalytics.com/) and google analytics - Supports [plausible](https://plausible.io/), [simple analytics](https://simpleanalytics.com/) and google analytics

View File

@ -44,7 +44,7 @@ I wanted it to be nearly as feature-rich as popular blogging templates like [bea
- Easy styling customization with [Tailwind 2.0](https://blog.tailwindcss.com/tailwindcss-v2) and primary color attribute - Easy styling customization with [Tailwind 2.0](https://blog.tailwindcss.com/tailwindcss-v2) and primary color attribute
- Near perfect lighthouse score - [Lighthouse report](https://www.webpagetest.org/result/210111_DiC1_08f3670c3430bf4a9b76fc3b927716c5/) - Near perfect lighthouse score - [Lighthouse report](https://www.webpagetest.org/result/210111_DiC1_08f3670c3430bf4a9b76fc3b927716c5/)
- Lightweight, 39kB first load JS, uses Preact in production build - Lightweight, 45kB first load JS, uses Preact in production build
- Mobile-friendly view - Mobile-friendly view
- Light and dark theme - Light and dark theme
- Supports [plausible](https://plausible.io/), [simple analytics](https://simpleanalytics.com/) and google analytics - Supports [plausible](https://plausible.io/), [simple analytics](https://simpleanalytics.com/) and google analytics

View File

@ -1,7 +1,7 @@
--- ---
title: 'New features in v1' title: 'New features in v1'
date: 2021-08-07T15:32:14Z date: 2021-08-07T15:32:14Z
lastmod: '2021-09-11' lastmod: '2021-10-27'
tags: ['next-js', 'tailwind', 'guide'] tags: ['next-js', 'tailwind', 'guide']
draft: false draft: false
summary: 'An overview of the new features released in v1 - code block copy, multiple authors, frontmatter layout and more' summary: 'An overview of the new features released in v1 - code block copy, multiple authors, frontmatter layout and more'
@ -14,7 +14,7 @@ A post on the new features introduced in v1.0. New features:
<TOCInline toc={props.toc} exclude="Overview" toHeading={2} /> <TOCInline toc={props.toc} exclude="Overview" toHeading={2} />
First load JS decreased from 43kB to 39kB despite all the new features added! First load JS decreased from 43kB to 39kB despite all the new features added!^[With the new changes in Nextjs 12, first load JS increase to 45kB.]
See [upgrade guide](#upgrade-guide) below if you are migrating from v0 version of the template. See [upgrade guide](#upgrade-guide) below if you are migrating from v0 version of the template.

View File

@ -20,16 +20,16 @@ Since we are using mdx, we can create a simple responsive flexbox grid to displa
<div className="flex flex-wrap -mx-2 overflow-hidden xl:-mx-2"> <div className="flex flex-wrap -mx-2 overflow-hidden xl:-mx-2">
<div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2"> <div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2">
<Image alt="Maple" src="/static/images/canada/maple.jpg" width={640} height={427} /> ![Maple](/static/images/canada/maple.jpg)
</div> </div>
<div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2"> <div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2">
<Image alt="Lake" src="/static/images/canada/lake.jpg" width={640} height={427} /> ![Lake](/static/images/canada/lake.jpg)
</div> </div>
<div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2"> <div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2">
<Image alt="Mountains" src="/static/images/canada/mountains.jpg" width={640} height={427} /> ![Mountains](/static/images/canada/mountains.jpg)
</div> </div>
<div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2"> <div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2">
<Image alt="Toronto" src="/static/images/canada/toronto.jpg" width={640} height={427} /> ![Toronto](/static/images/canada/toronto.jpg)
</div> </div>
</div> </div>
@ -38,23 +38,21 @@ Since we are using mdx, we can create a simple responsive flexbox grid to displa
```js ```js
<div className="flex flex-wrap -mx-2 overflow-hidden xl:-mx-2"> <div className="flex flex-wrap -mx-2 overflow-hidden xl:-mx-2">
<div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2"> <div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2">
<Image alt="Maple" src="/static/images/canada/maple.jpg" width={640} height={427} /> ![Maple](/static/images/canada/maple.jpg)
</div> </div>
<div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2"> <div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2">
<Image alt="Lake" src="/static/images/canada/lake.jpg" width={640} height={427} /> ![Lake](/static/images/canada/lake.jpg)
</div> </div>
<div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2"> <div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2">
<Image alt="Mountains" src="/static/images/canada/mountains.jpg" width={640} height={427} /> ![Mountains](/static/images/canada/mountains.jpg)
</div> </div>
<div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2"> <div className="my-1 px-2 w-full overflow-hidden xl:my-1 xl:px-2 xl:w-1/2">
<Image alt="Toronto" src="/static/images/canada/toronto.jpg" width={640} height={427} /> ![Toronto](/static/images/canada/toronto.jpg)
</div> </div>
</div> </div>
``` ```
_Note_: Currently, one has to use the `Image` component instead of the markdown syntax between jsx. Thankfully, it's one of the default components passed to the MDX Provider and can be used directly. With MDX v2, one can interleave markdown in jsx as shown in the example code.
When MDX v2 is ready, one could potentially interleave markdown in jsx directly! Follow [MDX v2 issues](https://github.com/mdx-js/mdx/issues/1041) for updates.
### Photo Credits ### Photo Credits

View File

@ -8,7 +8,6 @@ module.exports = withBundleAnalyzer({
eslint: { eslint: {
dirs: ['pages', 'components', 'lib', 'layouts', 'scripts'], dirs: ['pages', 'components', 'lib', 'layouts', 'scripts'],
}, },
experimental: { esmExternals: true },
webpack: (config, { dev, isServer }) => { webpack: (config, { dev, isServer }) => {
config.module.rules.push({ config.module.rules.push({
test: /\.(png|jpe?g|gif|mp4)$/i, test: /\.(png|jpe?g|gif|mp4)$/i,

1173
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "tailwind-nextjs-starter-blog", "name": "tailwind-nextjs-starter-blog",
"version": "1.1.4", "version": "1.2.0",
"private": true, "private": true,
"scripts": { "scripts": {
"start": "node ./scripts/next-remote-watch.js ./data", "start": "node ./scripts/next-remote-watch.js ./data",
@ -21,7 +21,7 @@
"gray-matter": "^4.0.2", "gray-matter": "^4.0.2",
"image-size": "1.0.0", "image-size": "1.0.0",
"mdx-bundler": "^6.0.1", "mdx-bundler": "^6.0.1",
"next": "11.1.2", "next": "12.0.1",
"next-themes": "^0.0.14", "next-themes": "^0.0.14",
"postcss": "^8.3.5", "postcss": "^8.3.5",
"preact": "^10.5.13", "preact": "^10.5.13",
@ -41,12 +41,12 @@
"unist-util-visit": "^4.0.0" "unist-util-visit": "^4.0.0"
}, },
"devDependencies": { "devDependencies": {
"@next/bundle-analyzer": "11.1.2", "@next/bundle-analyzer": "12.0.1",
"@svgr/webpack": "^5.5.0", "@svgr/webpack": "^5.5.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"dedent": "^0.7.0", "dedent": "^0.7.0",
"eslint": "^7.29.0", "eslint": "^7.29.0",
"eslint-config-next": "11.1.2", "eslint-config-next": "12.0.1",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.3.1", "eslint-plugin-prettier": "^3.3.1",