Giter Club home page Giter Club logo

website's Introduction

Banter Next.js

A modern multipurpose blog theme built with Tailwind CSS & Next.js

This is a Next.js template bootstrapped with create-next-app. If you're new to Next.js I recommend you check out the official Next.js documentation first.

System Requirements

  • Node.js 12.22.0 or later
  • MacOS, Windows (including WSL), and Linux are supported

Getting Started

First, install the dependencies by navigating to the project directory in your terminal and run

npm install
# or
yarn install  # if you have Yarn installed

This will install all the required dependencies and place them in a folder called node_modules in the root directory.

Once the dependencies are installed, you can run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

File Structure

  • components - Directory of Components Files
    • 404 - Components for 404 page
    • about - Components for about page
    • contact - Components for contact page
    • headers - All header components
    • home - Components for home page
    • layout - All components related to the site layout
    • posts - Components for the post page
    • shared - Components that are reused in multiple pages
    • sidebar - All sidebar components
    • social - Components for social media icons
  • config - Directory of configuration files that contain site-wide data
  • content - Directory of all Content markdown files
    • authors - Contains all markdown data files for authors
    • categories - Contains all markdown data files for post categories
    • pages - Contains all markdown data files for individual pages
    • posts - Contains all of the markdown data files for posts
    • shared - Contains all of the markdown data files for shared components
  • libs - Directory of all library files
  • pages - Directory of all pages
  • public - Directory of images and external files
  • styles - Contains the entry point CSS file for Tailwind CSS
  • utils - Directory of javascript utility files

Site Configuration

The config/site.config.js file contains default site data used across the site. You can change this data by editing the file

export default {
  "metaData": {
    "title" : "Banter | Multipurpose NextJS Blog Template",
    "description" : "Banter - a modern, stylish Tailwind CSS template for any blog, magazine, or news site.",
    "author" : "Tailwind Awesome",
    "keyword" : "magazine, multipurpose, react, nextjs, blog, template",
    "ogImage" : "/images/ogimage.jpg"
  },
  "baseURL" : "https://banter.tailwindawesome.com/",
  "logo" : "/images/banter-logo.png",
  "logoText" : "Banter",
  "favicon" : "/images/banter-icon-logo.png",
  "postPerPage" : 6,
  "copyright" : "© 2022 Banter. All rights reserved."
}

Menu Links Configuration

You can configure the navbar and footer links by editing the config/menus.js file and changing the name and link values.

Social Media Links

You can add or modify your social media links in the config/social.js file:

export default [
  {
    name: 'facebook',
    href: '#'
  },
  {
    name: 'instagram',
    href: '#'
  },
  {
    name: 'twitter',
    href: '#'
  },
  {
    name: 'linkedin',
    href: '#'
  }
]

However, if you add a social media link make sure to add its corresponding icon in the components/social directory.

Content

All of the content data is in markdown format. If you are not familiar with markdown, you can take a look at this excellent markdown cheat sheet that provides a quick overview of all the Markdown syntax elements.

Content Structure

All of the markdown files are located in the content directory. Banter uses gray-matter to parse our YAML front matter and markdown content. All of the frontmatter data for each content file is located at the top of the file in between 3 hyphens. Below the frontmatter is the markdown content.

Adding new authors

You can add new or customize existing authors in the content/authors directory. Each author's file name is the slug for that particular author's page. For example, the author Mark Jack has a corresponding markdown file named mark-jack.md and an author page at /authors/mark-jack.

Every author has data in the following format:

---
name: "Mark Jack"
image: "/images/authors/mark-jack.jpeg"
role: "Staff Writer"
social_links:
  - name: "twitter"
    url: "#"
  - name: "facebook"
    url: "#"
  - name: "instagram"
    url: "#"
  - name: "linkedin"
    url: "#"
---
Lorem ipsum dolor sit amet mauris quis phasellus ornare dui lectus. Laoreet habitasse eiusmod nulla odio tortor neque diam convallis morbi dolore molestie tellus faucibus pharetra.

All of the author images are stored in the public/images/authors directory. The markdown content below the frontmatter is the author's bio.

Similar to the site's social links, if you add a social media link make sure to add its corresponding icon in the components/social directory.

Adding new posts

All of the posts are located in the content/posts directory. All of the posts have data in the following format:

---
title: "15 Ways to Grow Your Startup"
description: "Lorem ipsum dolor sit amet tempus bendum labore laoreet.Hendrerit lobortis a leo curabitur faucibus sapien ullamcorper do labore odio."
image: "/images/posts/archive-02.jpeg"
date: "2022-04-05T16:56:47+06:00"
author: "Matt Burgess"
time_to_read_in_minutes: 12
views: 6807
category: "Startup"
tags: ["Growth", "Tips", "List", "Idea"]
group: "Archived"
---
Aliqua venenatis gravida et urna molestie leo adipiscing dolore leo euismod quam. Aenean porta curabitur convallis pellentesque velit platea at neque phasellus.

All of the post images are stored in the public/images/posts directory. The markdown content below the frontmatter is the post content.

Every post has a category, author, and tags and is grouped by the group field for site organization.

If you add a new author or category, make sure to create their corresponding markdown files in the content/authors and content/categories directories respectively.

Page Data

The /about, /contact and /privacy pages have their corresponding data in the content/pages/about.md, content/pages/contact.md and content/pages/privacy.md markdown files respectively.

Newsletter Data

You can edit the newsletter section content and form data in the content/shared/newsletter.md markdown file.

Tailwind CSS

This theme uses the latest version of Tailwind CSS: v3.

Tailwind CSS and its dependencies were installed via npm as recommended by the official Tailwind installation docs for next.js. If you are not familiar with the Tailwind CSS framework I would recommend you check out the Tailwind documentation.

You can find the tailwind.config.js and postcss.config.js files at the root of the directory. The entry point CSS file is located at styles/globals.css. This file contains the @tailwind directives and any additional CSS used in the template. We've tried to minimize custom CSS and only define a few custom classes for the hamburger menu in the navbar.

Tailwind allows you to customize what it generates using the tailwind.config.js file at the root of the project directory. For this theme, we have defined a few extra utility classes. We have also added the paths to all of our template files to the content option to tree-shake unused styles and optimize your final build size. This template additionally uses 2 official Tailwind plugins (@tailwindcss/aspect-ratio, @tailwindcss/typography) to generate additional utility classes.

Font

This template uses the Roboto Font family from the Google Fonts Library. The font is included in /pages/_document.js and leverages the Automatic Webfont Optimizations by next.js.

Icons

The icons used for this theme are part of the Hero Icons set that is free to use and published under the MIT License.

Some of the examples in Banter use Nucleo App icons which we have acquired a license for. You are free to use the Nucleo icons included in this template on your projects, but if you are interested in using the rest of their premium icons you can buy a license on their website.

Images

All of the images for posts, categories, authors and website components are from Unsplash.

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out their Next.js deployment documentation for more details.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Additional Help

If you need additional help setting up the template or have any questions, feel free to contact us at [email protected].

website's People

Contributors

genedna avatar benjamin-747 avatar

Watchers

 avatar Yuanhai He avatar surechen avatar Yang Feng avatar Mabin avatar Wang Qilin avatar  avatar

Forkers

genedna

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.