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

improve starter #79

Merged
merged 8 commits into from
Nov 6, 2022
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
5 changes: 0 additions & 5 deletions .changeset/dirty-worms-type.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/four-files-knock.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/perfect-cars-cover.md

This file was deleted.

16 changes: 0 additions & 16 deletions .changeset/pre.json

This file was deleted.

4 changes: 2 additions & 2 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# @pliny/cli

## 0.0.6-beta.0
## 0.0.6

### Patch Changes

- 8d0b4c1: fix recipe installer
- Updated dependencies [8d0b4c1]
- @pliny/installer@0.0.6-beta.0
- @pliny/installer@0.0.6

## 0.0.5

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@pliny/cli",
"description": "Pliny CLI",
"homepage": "https://github.com/timlrx/pliny",
"version": "0.0.6-beta.0",
"version": "0.0.6",
"license": "MIT",
"bin": {
"pliny": "./bin/run"
Expand All @@ -25,7 +25,7 @@
"@oclif/plugin-not-found": "2.3.1",
"@oclif/plugin-plugins": "2.1.0",
"@oclif/plugin-version": "1.1.2",
"@pliny/installer": "0.0.6-beta.0",
"@pliny/installer": "0.0.6",
"camelcase": "^6.2.0",
"chalk": "^4.1.0",
"console-table-printer": "^2.11.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/installer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @pliny/installer

## 0.0.6-beta.0
## 0.0.6

### Patch Changes

Expand Down
2 changes: 1 addition & 1 deletion packages/installer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pliny/installer",
"version": "0.0.6-beta.0",
"version": "0.0.6",
"description": "Package installation for the Pliny CLI",
"homepage": "https://github.com/timlrx/pliny",
"license": "MIT",
Expand Down
7 changes: 7 additions & 0 deletions packages/pliny/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# pliny

## 0.0.9

### Patch Changes

- a82f661: update to next 13
- e174c43: improve accessibility

## 0.0.9-beta.0

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/pliny/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pliny",
"description": "Main entry point for pliny components and CLI",
"homepage": "https://github.com/timlrx/pliny",
"version": "0.0.9-beta.0",
"version": "0.0.9",
"type": "module",
"exports": {
"./*": "./*",
Expand Down
2 changes: 1 addition & 1 deletion recipes/add-blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "Timothy Lin <timothy0336@hotmail.com> (https://timlrx.com)",
"license": "MIT",
"dependencies": {
"@pliny/installer": "0.0.6-beta.0",
"@pliny/installer": "*",
"jscodeshift": "0.13.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion recipes/blog-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "Timothy Lin <timothy0336@hotmail.com> (https://timlrx.com)",
"license": "MIT",
"dependencies": {
"@pliny/installer": "0.0.6-beta.0",
"@pliny/installer": "*",
"jscodeshift": "0.13.1"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions starter-blog/components/LayoutWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ interface Props {
}

const inter = Inter({
variable: '--font-inter',
subsets: ['latin'],
})

const LayoutWrapper = ({ children }: Props) => {
return (
<SectionContainer>
<div className={`${inter.variable} flex h-screen flex-col justify-between font-sans`}>
<div className={`${inter.className} flex h-screen flex-col justify-between font-sans`}>
<header className="flex items-center justify-between py-10">
<div>
<Link href="/" aria-label={siteMetadata.headerTitle}>
Expand Down
2 changes: 0 additions & 2 deletions starter-blog/contentlayer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import readingTime from 'reading-time'
import path from 'path'
// Remark packages
import remarkGfm from 'remark-gfm'
import remarkFootnotes from 'remark-footnotes'
import remarkMath from 'remark-math'
import {
remarkExtractFrontmatter,
Expand Down Expand Up @@ -85,7 +84,6 @@ export default makeSource({
remarkExtractFrontmatter,
remarkGfm,
remarkCodeTitles,
[remarkFootnotes, { inlineNotes: true }],
remarkMath,
remarkImgToJsx,
],
Expand Down
4 changes: 4 additions & 0 deletions starter-blog/css/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
@apply mt-12 border-t border-gray-200 pt-8 dark:border-gray-700;
}

.data-footnote-backref {
@apply no-underline;
}

.csl-entry {
@apply my-5;
}
Expand Down
4 changes: 3 additions & 1 deletion starter-blog/data/blog/deriving-ols-estimator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ summary: 'How to derive the OLS Estimator with matrix notation and a tour of mat

Parsing and display of math equations is included in this blog template. Parsing of math is enabled by `remark-math` and `rehype-katex`.
KaTeX and its associated font is included in `_document.js` so feel free to use it on any page.
^[For the full list of supported TeX functions, check out the [KaTeX documentation](https://katex.org/docs/supported.html)]
[^footnote]

[^footnote]: For the full list of supported TeX functions, check out the [KaTeX documentation](https://katex.org/docs/supported.html)

Inline math symbols can be included by enclosing the term between the `$` symbol.

Expand Down
4 changes: 3 additions & 1 deletion starter-blog/data/blog/new-features-in-v1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ A post on the new features introduced in v1.0. New features:

<TOCInline toc={props.toc} exclude="Overview" toHeading={2} />

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.]
First load JS decreased from 43kB to 39kB despite all the new features added! [^1]

[^1]: 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.

Expand Down
9 changes: 2 additions & 7 deletions starter-blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
"scripts": {
"start": "next dev",
"dev": "INIT_CWD=$PWD next dev",
"build": "INIT_CWD=$PWD next build",
"postbuild": "yarn sitemap && yarn rss && yarn search",
"sitemap": "cross-env NODE_OPTIONS='--experimental-json-modules' node -r esbuild-register ./scripts/sitemap.mjs",
"rss": "cross-env NODE_OPTIONS='--experimental-json-modules' node -r esbuild-register ./scripts/rss.mjs",
"search": "cross-env NODE_OPTIONS='--experimental-json-modules' node -r esbuild-register ./scripts/search.mjs",
"build": "INIT_CWD=$PWD next build && cross-env NODE_OPTIONS='--experimental-json-modules' node -r esbuild-register ./scripts/postbuild.mjs",
"serve": "next start",
"analyze": "cross-env ANALYZE=true next build",
"lint": "next lint --fix --dir pages --dir components --dir lib --dir layouts --dir scripts"
Expand All @@ -29,7 +25,7 @@
"next": "13.0.2",
"next-contentlayer": "0.2.8",
"next-themes": "^0.2.0",
"pliny": "0.0.9-beta.0",
"pliny": "0.0.9",
"postcss": "^8.4.16",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand All @@ -41,7 +37,6 @@
"rehype-prism-plus": "^1.5.0",
"rehype-slug": "^5.0.0",
"remark": "^14.0.2",
"remark-footnotes": "^4.0.1",
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"tailwindcss": "^3.2.2",
Expand Down
13 changes: 6 additions & 7 deletions starter-blog/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import '@/css/tailwind.css'
import '@/css/prism.css'
import 'katex/dist/katex.css'

import '@/css/docsearch.css'
import '@docsearch/css'
// import '@/css/docsearch.css' // Uncomment if using algolia docsearch
// import '@docsearch/css' // Uncomment if using algolia docsearch

import { ThemeProvider } from 'next-themes'
import type { AppProps } from 'next/app'
Expand All @@ -21,11 +20,11 @@ export default function App({ Component, pageProps }: AppProps) {
<meta content="width=device-width, initial-scale=1" name="viewport" />
</Head>
<Analytics analyticsConfig={siteMetadata.analytics} />
<SearchProvider searchConfig={siteMetadata.search}>
<LayoutWrapper>
<LayoutWrapper>
<SearchProvider searchConfig={siteMetadata.search}>
<Component {...pageProps} />
</LayoutWrapper>
</SearchProvider>
</SearchProvider>
</LayoutWrapper>
</ThemeProvider>
)
}
9 changes: 9 additions & 0 deletions starter-blog/scripts/postbuild.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import rss from './rss.mjs'
import sitemap from './sitemap.mjs'
import search from './search.mjs'

async function postbuild() {
await Promise.all([rss(), sitemap(), search()])
}

postbuild()
6 changes: 5 additions & 1 deletion starter-blog/scripts/rss.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ import { generateRSS } from 'pliny/utils/generate-rss.js'
import siteMetadata from '../data/siteMetadata.js'
import { allBlogs } from '../.contentlayer/generated/index.mjs'

generateRSS(siteMetadata, allBlogs)
const rss = () => {
generateRSS(siteMetadata, allBlogs)
console.log('RSS feed generated...')
}
export default rss
12 changes: 11 additions & 1 deletion starter-blog/scripts/search.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
import { writeFileSync } from 'fs'
import { allCoreContent } from 'pliny/utils/contentlayer.js'
import { allBlogs } from '../.contentlayer/generated/index.mjs'
import siteMetadata from '../data/siteMetadata.js'

writeFileSync('public/search.json', JSON.stringify(allCoreContent(allBlogs)))
const search = () => {
if (siteMetadata?.search?.kbarConfig?.searchDocumentsPath) {
writeFileSync(
`public/${siteMetadata.search.kbarConfig.searchDocumentsPath}`,
JSON.stringify(allCoreContent(allBlogs))
)
console.log('Local search index generated...')
}
}
export default search
6 changes: 5 additions & 1 deletion starter-blog/scripts/sitemap.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ import { generateSitemap } from 'pliny/utils/generate-sitemap.js'
import siteMetadata from '../data/siteMetadata.js'
import { allBlogs } from '../.contentlayer/generated/index.mjs'

generateSitemap(siteMetadata.siteUrl, allBlogs)
const sitemap = () => {
generateSitemap(siteMetadata.siteUrl, allBlogs)
console.log('Sitemap generated...')
}
export default sitemap
2 changes: 1 addition & 1 deletion starter-blog/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
14: '3.5rem',
},
fontFamily: {
sans: ['var(--font-inter)', ...fontFamily.sans],
sans: ['Inter', ...fontFamily.sans],
},
colors: {
primary: colors.teal,
Expand Down
Loading