From 3e8d2b37bb8af7e5bfa447d86345306134f0e2fe Mon Sep 17 00:00:00 2001 From: David Nguyen Date: Sat, 9 Sep 2017 04:33:15 +0700 Subject: [PATCH] added with-noscript example (#2767) --- examples/with-noscript/README.md | 47 ++++++++++++++++++ examples/with-noscript/components/Noscript.js | 7 +++ examples/with-noscript/next.config.js | 10 ++++ examples/with-noscript/package.json | 16 ++++++ examples/with-noscript/pages/index.js | 37 ++++++++++++++ examples/with-noscript/static/img/angular.jpg | Bin 0 -> 7213 bytes examples/with-noscript/static/img/nextjs.png | Bin 0 -> 7069 bytes examples/with-noscript/static/img/reactjs.png | Bin 0 -> 10772 bytes examples/with-noscript/static/img/vuejs.png | Bin 0 -> 4178 bytes 9 files changed, 117 insertions(+) create mode 100644 examples/with-noscript/README.md create mode 100644 examples/with-noscript/components/Noscript.js create mode 100644 examples/with-noscript/next.config.js create mode 100644 examples/with-noscript/package.json create mode 100644 examples/with-noscript/pages/index.js create mode 100644 examples/with-noscript/static/img/angular.jpg create mode 100644 examples/with-noscript/static/img/nextjs.png create mode 100644 examples/with-noscript/static/img/reactjs.png create mode 100644 examples/with-noscript/static/img/vuejs.png diff --git a/examples/with-noscript/README.md b/examples/with-noscript/README.md new file mode 100644 index 00000000..4dbc1d86 --- /dev/null +++ b/examples/with-noscript/README.md @@ -0,0 +1,47 @@ +[![Deploy to now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-noscript) + +# Noscript example + +## How to use + +Download the example [or clone the repo](https://github.com/zeit/next.js): + +## Development +Install it and run: + +**npm** +```bash +npm install +npm run dev +``` + +**yarn** +```bash +yarn install +yarn run dev +``` + +## Production +**npm** +```bash +npm install +npm run build +npm start +``` + +**yarn** +```bash +yarn install +yarn run build +yarn start +``` + +Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.co/download)) + +```bash +now +``` + +## About example + +This example show you how to use `` with image resource in next.js diff --git a/examples/with-noscript/components/Noscript.js b/examples/with-noscript/components/Noscript.js new file mode 100644 index 00000000..f7ed7be4 --- /dev/null +++ b/examples/with-noscript/components/Noscript.js @@ -0,0 +1,7 @@ +import React from 'react' +import ReactDOMServer from 'react-dom/lib/ReactDOMServer' + +export default function Noscript (props) { + const staticMarkup = ReactDOMServer.renderToStaticMarkup(props.children) + return