Git Product home page Git Product logo

openapinotswagger.com's Introduction

mdnext

Welcome to mdnext-tailwind

Deploy with Vercel Deploy with Netlify




Usage

Coming with a base understanding of the NextJS opinions and documentation, will give you a solid grasp on the structure of our templates.

File structure

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/3e0ceedc-c244-488f-b984-4bc507a81348/Screen_Shot_2020-09-04_at_1.51.10_AM.png

Breakdown

jsconfig.js

NextJS lets us configure absolute paths for our app. We use this to easily import all of our functions and utilities inside of our src directory

pages

The pages directory defines your routing. Lifecycle methods like getStaticProps / getStaticPaths / getServerProps are available at the page level. This is where we consume our MDX content as data to pass to our components.

_app.js: NextJS allows you to override the App component, which is used to initialize pages. More here

_document.js: Allows you to augment our application's <html> and <body> tags.

all-data/index.js: This page is an example of displaying links to all of your individual MDX data pages. Here we use getStaticProps to feed the frontmatter of our MDX files for our components.

data/[slug].js: Here we utilize NextJS dynamic routing. By using getStaticPaths we're able to feed a dynamic slug, handling all of the logic once and applying it to each MDX data that we load. This allows us to then match to our data in getStaticProps and display that to the page and our components.

index.js: Our page at the root of our app, lives inside of the pages directories index.js.

src Our src directory holds all of our client code. Our components, custom hooks, utility functions, and our MDX files all live here, with the first three available for absolute path imports 👍

next.config.js For custom configuration around things like environment variables, webpack, pageExtensions, and many more, you can utilize next.config.js


Tailwind

This template uses the utility-first CSS framework Tailwind for styling. Take a look at the following files to get started.

tailwind.config.js

Blank Tailwind configuration with the purge option to remove unused CSS in production, thus keeping the resulting CSS file small, and theme.extend.colors to add a custom color palette.

postcss.config.js

PostCSS configuration file. Other than Tailwind, it uses Next.js's default PostCSS configuration.

src/tailwind.css

CSS file containing the @tailwind directive. It also contains examples of Tailwind's @apply directive and custom styles. You can rename and move it as you wish, but make sure you adjust the import path in pages/_app.js.

You can see examples of Tailwind CSS in action in these component files, src/components/ContentBox.js and src/components/Navbar.js.

Tailwind Resources

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.