From f569d90ad17a9f1d5f943411c013801feb2634bf Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Thu, 27 Oct 2022 20:09:33 +0200 Subject: [PATCH] missing `nx-` class prefixes in blog, fix callout padding in docs (#941) missing `nx-` class prefixes in blog fix callout padding in docs --- .changeset/fair-feet-flash.md | 8 ++++++++ examples/docs/package.json | 2 +- examples/swr-site/pages/index.en-US.mdx | 4 ++-- .../nextra-theme-blog/src/basic-layout.tsx | 5 ++++- packages/nextra-theme-blog/src/index.tsx | 2 +- packages/nextra-theme-blog/src/nav.tsx | 2 +- .../nextra-theme-blog/src/posts-layout.tsx | 8 ++++---- packages/nextra-theme-blog/src/styles.css | 2 +- .../nextra-theme-blog/src/theme-switch.tsx | 2 +- .../nextra-theme-docs/src/components/tabs.tsx | 2 +- .../nextra-theme-docs/src/mdx-components.tsx | 18 ++++++++++++------ packages/nextra/src/components/pre.tsx | 2 +- packages/nextra/styles/code-block.css | 2 +- packages/nextra/styles/subheading-anchor.css | 7 ++++++- 14 files changed, 44 insertions(+), 22 deletions(-) create mode 100644 .changeset/fair-feet-flash.md diff --git a/.changeset/fair-feet-flash.md b/.changeset/fair-feet-flash.md new file mode 100644 index 0000000000..3706ef8e03 --- /dev/null +++ b/.changeset/fair-feet-flash.md @@ -0,0 +1,8 @@ +--- +'nextra': patch +'nextra-theme-docs': patch +'nextra-theme-blog': patch +--- + +missing `nx-` class prefixes in blog +fix callout padding in docs diff --git a/examples/docs/package.json b/examples/docs/package.json index 93c9a3d2b1..4364b63ce9 100644 --- a/examples/docs/package.json +++ b/examples/docs/package.json @@ -4,7 +4,7 @@ "main": "index.js", "license": "MIT", "scripts": { - "dev": "next dev", + "dev": "next", "build": "next build", "start": "next start", "debug": "NODE_OPTIONS='--inspect' next dev", diff --git a/examples/swr-site/pages/index.en-US.mdx b/examples/swr-site/pages/index.en-US.mdx index a92b1a24a0..57b91c0dc5 100644 --- a/examples/swr-site/pages/index.en-US.mdx +++ b/examples/swr-site/pages/index.en-US.mdx @@ -40,8 +40,8 @@ The name “SWR” is derived from `stale-while-revalidate`, a HTTP cache invali SWR is a strategy to first return the data from cache (stale), then send the fetch request (revalidate), and finally come with the up-to-date data. - With SWR, components will get a stream of data updates constantly and automatically.
- And the UI will be always fast and reactive. + With SWR, components will get a stream of data updates **constantly** and **automatically**.
+ And the UI will be always **fast** and **reactive**.
diff --git a/packages/nextra-theme-blog/src/basic-layout.tsx b/packages/nextra-theme-blog/src/basic-layout.tsx index 35ce18e32e..efddc94d77 100644 --- a/packages/nextra-theme-blog/src/basic-layout.tsx +++ b/packages/nextra-theme-blog/src/basic-layout.tsx @@ -8,7 +8,10 @@ export const BasicLayout = ({ children }: { children: ReactNode }) => { const title = `${opts.title}${config.titleSuffix || ''}` const ref = useRef(null) return ( -
+
{title} {config.head?.({ title, meta: opts.frontMatter })} diff --git a/packages/nextra-theme-blog/src/index.tsx b/packages/nextra-theme-blog/src/index.tsx index 64aa71c1f5..8867e74385 100644 --- a/packages/nextra-theme-blog/src/index.tsx +++ b/packages/nextra-theme-blog/src/index.tsx @@ -24,7 +24,7 @@ const BlogLayout = ({ const Layout = layoutMap[type] if (!Layout) { throw new Error( - `Nextra-themes-blog does not support the layout type "${type}" It only supports "post", "page", "posts" and "tag"` + `nextra-theme-blog does not support the layout type "${type}" It only supports "post", "page", "posts" and "tag"` ) } return ( diff --git a/packages/nextra-theme-blog/src/nav.tsx b/packages/nextra-theme-blog/src/nav.tsx index 5c5714ee24..220eee5ff6 100644 --- a/packages/nextra-theme-blog/src/nav.tsx +++ b/packages/nextra-theme-blog/src/nav.tsx @@ -9,7 +9,7 @@ export default function Nav(): ReactElement { const { navPages } = collectPostsAndNavs({ opts, config }) return (
-
+
{navPages.map(page => { if (page.active) { return ( diff --git a/packages/nextra-theme-blog/src/posts-layout.tsx b/packages/nextra-theme-blog/src/posts-layout.tsx index 4a8b9f237b..7cf964c789 100644 --- a/packages/nextra-theme-blog/src/posts-layout.tsx +++ b/packages/nextra-theme-blog/src/posts-layout.tsx @@ -32,21 +32,21 @@ export const PostsLayout = ({ children }: { children: ReactNode }) => {

- {postTitle} + {postTitle}

{description && ( -

+

{description} {config.readMore && ( - {config.readMore} + {config.readMore} )}

)} {date && ( -