├── core ├── index.ts ├── typings │ └── index.ts ├── models │ ├── author.ts │ ├── category.ts │ ├── index.ts │ └── post.ts ├── integrations │ ├── index.ts │ ├── typings.ts │ └── contentful.service.ts ├── api.spec.ts └── api.ts ├── now.json ├── .vscode └── settings.json ├── next-env.d.ts ├── public ├── favicon.ico └── zeit.svg ├── setup-contentful.png ├── tsconfig.jest.json ├── pages ├── 404.tsx ├── _error.tsx ├── _app.tsx ├── index.tsx ├── category │ └── [id].tsx └── post │ └── [id].tsx ├── components ├── index.ts ├── footer.spec.tsx ├── not-found.spec.tsx ├── subscription.spec.tsx ├── not-found.tsx ├── __snapshots__ │ ├── not-found.spec.tsx.snap │ ├── footer.spec.tsx.snap │ ├── subscription.spec.tsx.snap │ └── nav.spec.tsx.snap ├── nav.spec.tsx ├── footer.tsx ├── nav.tsx └── subscription.tsx ├── .prettierrc.js ├── .editorconfig ├── next.config.js ├── tests └── setupTests.ts ├── .gitignore ├── config └── index.ts ├── config.json ├── .eslintrc.js ├── .github └── workflows │ └── test-lint.yml ├── tsconfig.json ├── jest.config.js ├── README.md ├── package.json ├── bin └── setup │ └── contentful.js ├── styles ├── main.scss └── bootstrap-user-variables.scss └── schemas └── contentful.json /core/index.ts: -------------------------------------------------------------------------------- 1 | export * from './api'; 2 | -------------------------------------------------------------------------------- /now.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "CONTENTFUL" 4 | ] 5 | } -------------------------------------------------------------------------------- /core/typings/index.ts: -------------------------------------------------------------------------------- 1 | export enum Integrations { 2 | CONTENTFUL = 'contentful', 3 | } 4 | -------------------------------------------------------------------------------- /core/models/author.ts: -------------------------------------------------------------------------------- 1 | export interface Author { 2 | name: string; 3 | photo: string; 4 | } 5 | -------------------------------------------------------------------------------- /next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /core/integrations/index.ts: -------------------------------------------------------------------------------- 1 | export * from './contentful.service'; 2 | export * from './typings'; 3 | -------------------------------------------------------------------------------- /core/models/category.ts: -------------------------------------------------------------------------------- 1 | export interface Category { 2 | name: string; 3 | slug: string; 4 | } 5 | -------------------------------------------------------------------------------- /core/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from './author'; 2 | export * from './category'; 3 | export * from './post'; 4 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxigimenez/next-medium-blog-boilerplate/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /setup-contentful.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxigimenez/next-medium-blog-boilerplate/HEAD/setup-contentful.png -------------------------------------------------------------------------------- /tsconfig.jest.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "jsx": "react" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /pages/404.tsx: -------------------------------------------------------------------------------- 1 | import { NotFound } from '@/components'; 2 | 3 | const Page404 = () => ; 4 | export default Page404; 5 | -------------------------------------------------------------------------------- /pages/_error.tsx: -------------------------------------------------------------------------------- 1 | import { NotFound } from '@/components'; 2 | 3 | const Error = () => ; 4 | export default Error; 5 | -------------------------------------------------------------------------------- /components/index.ts: -------------------------------------------------------------------------------- 1 | export * from './footer'; 2 | export * from './nav'; 3 | export * from './not-found'; 4 | export * from './subscription'; 5 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: 'all', 4 | singleQuote: true, 5 | printWidth: 120, 6 | tabWidth: 2, 7 | }; 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | CONTENTFUL_SPACE_ID: process.env.CONTENTFUL_SPACE_ID, 4 | CONTENTFUL_ACCESS_TOKEN: process.env.CONTENTFUL_ACCESS_TOKEN 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/setupTests.ts: -------------------------------------------------------------------------------- 1 | import Enzyme from 'enzyme'; 2 | import Adapter from 'enzyme-adapter-react-16'; 3 | 4 | // Configure Enzyme with React 16 adapter 5 | Enzyme.configure({ adapter: new Adapter() }); 6 | -------------------------------------------------------------------------------- /core/models/post.ts: -------------------------------------------------------------------------------- 1 | import { Category } from './category'; 2 | import { Author } from './author'; 3 | 4 | export interface Post { 5 | title: string; 6 | slug: string; 7 | heroImage: string; 8 | shortBody: string; 9 | body: string; 10 | publishedAt: string; 11 | author: Author; 12 | category: Category; 13 | readingTime: string; 14 | } 15 | -------------------------------------------------------------------------------- /components/footer.spec.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { shallow } from 'enzyme'; 3 | import { Footer } from './footer'; 4 | 5 | describe('footer', () => { 6 | describe('snapshots', () => { 7 | test('render', () => { 8 | const component = shallow(