Skip to content

Commit

Permalink
Docs for 1.0 (vercel#137)
Browse files Browse the repository at this point in the history
* Update nextjs preprender section (en)

* update docs

* override other languages

* cache docs

* remove translations

* move cache page

* add note to global configuration

* document fallbackValues and remove initialData

* update option name

* retouch the nextjs part

* update section about mutate

* update example and links

* add options

* improve global configuration section

* add pre-fetching

* update infinite docs

* fix examples

* document useSWRImmutable

* floating toc

* update docs

* upgrade theme

* tweak examples; add next.js ssr

* update title and basic example

* add blog post; refine docs

* update blog post

* fix docs

* fix pagination docs

* fix change log page

* improvements

* several improvements

* Update swr-v1.en-US.mdx

* improve docs for global config

* add cta links

* final touches

* dark mode for figures

* final touches

* add example for serialzing/unserialzing keys

* tweaks

* add og support

* update features

* update date

* add example about default fetcher migration

* Apply suggestions from code review

Co-authored-by: Paco <34928425+pacocoursey@users.noreply.github.com>

* apply review suggestions

* update feature list

Co-authored-by: Shu Ding <g@shud.in>
Co-authored-by: Paco <34928425+pacocoursey@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 27, 2021
1 parent 20a53d4 commit 04700f2
Show file tree
Hide file tree
Showing 102 changed files with 1,615 additions and 1,018 deletions.
22 changes: 22 additions & 0 deletions components/authors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export default function Authors({ date, children }) {
return (
<div className="mt-8 mb-16 text-gray-400 text-sm">
{date} by {children}
</div>
);
}

export function Author({ name, link }) {
return (
<span className="after:content-[','] last:after:content-['']">
<a
key={name}
href={link}
target="_blank"
className="mx-1 text-gray-800 dark:text-gray-100"
>
{name}
</a>
</span>
);
}
30 changes: 30 additions & 0 deletions components/diagrams/cache.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default () => {
}
/>
<Feature
text="Jamstack Oriented"
text="SSR / ISR / SSG Ready"
icon={
<svg
width="24"
Expand Down
26 changes: 26 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const withNextra = require("nextra")({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.js",
unstable_stork: true,
unstable_staticImage: true,
});

module.exports = withNextra({
Expand All @@ -26,11 +27,36 @@ module.exports = withNextra({
destination: "/docs/advanced/cache",
statusCode: 301,
},
{
source: "/docs/cache",
destination: "/docs/advanced/cache",
statusCode: 301,
},
{
source: "/change-log",
destination: "/docs/change-log",
statusCode: 301,
},
{
source: "/blog/swr-1",
destination: "/blog/swr-v1",
statusCode: 301,
},
{
source: "/blog",
destination: "/blog/swr-v1",
statusCode: 302,
},
{
source: "/docs",
destination: "/docs/getting-started",
statusCode: 302,
},
{
source: "/examples",
destination: "/examples/basic",
statusCode: 302,
},
];
},
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"markdown-to-jsx": "^6.11.4",
"next": "^11.1.0",
"nextra": "^1.0.0-beta.2",
"nextra-theme-docs": "^1.2.0-beta.2",
"nextra-theme-docs": "^1.2.6",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-intersection-observer": "^8.26.2"
Expand Down
6 changes: 3 additions & 3 deletions pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import '../styles.css'
import 'nextra-theme-docs/style.css'
import "../styles.css";
import "nextra-theme-docs/style.css";

export default function Nextra({ Component, pageProps }) {
return (
<>
<Component {...pageProps} />
</>
)
);
}
3 changes: 3 additions & 0 deletions pages/blog/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"swr-v1": "Annoucing SWR 1.0"
}
Loading

0 comments on commit 04700f2

Please sign in to comment.