0.0.47 • Published 2 years ago

@elwood-studio/distribute-nextjs v0.0.47

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Elwood Studio / Distribute / Next.js

Use Elwood Studio Distribute in your Next.js app

Documentation

Find full documentation at elwood.studio/docs/distribute/nextjs.

Quick Start

  • /podcast -- Full featured podcast hosting
  • /video -- Full featured video hosting

Usage

Take a look in examples for more information on how to use this library.

1. Update your next.config.js

# next.config.js

const { join } = require('path');
const { withElwoodStudioDistribute } = require('@elwood-studio/distribute-nextjs');

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
};

module.exports = withElwoodStudioDistribute(nextConfig, {
  dataDir: join(__dirname, './data'),
});

2. Add (or update) the custom server.js

# server.js

require('@elwood-studio/distribute-nextjs/server')({
  dir: __dirname,
});

3. Pick a template

# template.js

const { createTemplate} = require('@elwood-studio/distribute-react/template/podcast');

module.exports = createTemplate({})

4. Update your App

# pages/_app.ts

const { withTemplateApp } = require('@elwood-studio/distribute-nextjs');
const template = require('../template');

module.exports = withTemplateApp(template);

5. Add the fallback page

# pages/[[...slug]].jsx

const { withTemplatePage } = require('@elwood-studio/distribute-nextjs');
const  template  = require('../template');

const t = withTemplatePage(template);

export default t.default;

export const getStaticPaths = t.getStaticPaths;
export const getStaticProps = t.getStaticProps;

License

Distributed under the Apache-2.0 license. See LICENSE for more information.

Contact

Elwood Studio - @hello_elwood - support@elwood.studio

0.0.40

2 years ago

0.0.41

2 years ago

0.0.42

2 years ago

0.0.43

2 years ago

0.0.44

2 years ago

0.0.45

2 years ago

0.0.46

2 years ago

0.0.47

2 years ago

0.0.39

2 years ago

0.0.38

2 years ago

0.0.34

2 years ago

0.0.33

2 years ago

0.0.32

2 years ago

0.0.31

2 years ago

0.0.30

2 years ago