GithubHelp home page GithubHelp logo

fun117 / nextjs-rich-tpl Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 2.44 MB

This project is a Next.js template aimed at providing a robust starting point for building modern web applications. It comes with pre-configured localization support, theme toggling, and various other features to streamline development.

Home Page: https://nextjs-rich-tpl.vercel.app

License: MIT License

JavaScript 0.50% TypeScript 97.38% CSS 2.06% HTML 0.06%
autoprefixer framer-motion i18n lucide-icons next-intl next-themes nextjs rich tailwindcss template

nextjs-rich-tpl's Introduction

Next.js Template

This project is a Next.js template aimed at providing a robust starting point for building modern web applications. It comes with pre-configured localization support, theme toggling, and various other features to streamline development.

Getting Started

To get started with this template, follow these steps:

  1. Clone the repository.
  2. Change to the template directory with cd website.
  3. Install the dependencies with npm install or yarn install.
  4. Run the development server with npm run dev or yarn dev.

Configuring the Template

The template includes a configuration file located at richtpl.config.tsx. Below is a description of how to configure the different options available in this file.

  • title (string, optional): The title of the website.
  • description (string, optional): A brief description of the website.
  • tagline (string): A short tagline welcoming visitors to the site.
  • favicon (string, optional): URL to the favicon image.
  • url (string): The production URL of the website.
  • baseUrl (string, optional): The base URL pathname for the site. (Currently you need to set baseUrl yourself in next.config)
  • organizationName (string): GitHub organization or user name.
  • projectName (string): GitHub repository name.
  • i18n (i18n): Internationalization settings including default locale, supported locales, and locale-specific configurations.
  • themeConfig (ThemeConfig): Theme and layout configuration including color modes, header, footer, and metadata.

Example Usage

import Config from "./config"; // Assuming your TypeScript file is named 'config.ts'

// Example configuration object
const config: Config = {
  title: "My Website",
  description: "This is a sample website built with Next.js and React.",
  tagline: "Welcome to our website!",

  url: "https://www.example.com",
  baseUrl: "/",

  organizationName: "myorg",
  projectName: "myproject",

  i18n: {
    defaultLocale: "en",
    locales: ["en", "fr", "jp"],
    localeConfigs: {
      en: {
        label: "English",
        htmlLang: "en",
        path: "/en",
      },
      fr: {
        label: "Français",
        htmlLang: "fr",
        path: "/fr",
      },
      jp: {
        label: "日本語",
        htmlLang: "ja",
        path: "/jp",
      },
    },
    selectButton: true,
  },

  themeConfig: {
    colorMode: {
      defaultMode: "light",
      selectSwitch: true,
    },
    header: {
      title: "My Website",
      logo: {
        type: "Vercel&Next.js",
        content: <img src="/logo.svg" alt="Logo" />,
      },
      items: {
        left: [
          { label: "Home", to: "/" },
          { label: "About", to: "/about" },
        ],
        right: [
          {
            label: "GitHub",
            href: "https://github.com/myorg/myproject",
            target: "_blank",
          },
        ],
        project: {
          repository: "block",
        },
      },
    },
    footer: {
      title: "Footer",
      logo: {
        type: "Vercel",
        content: <img src="/vercel-logo.svg" alt="Vercel Logo" />,
      },
      social: {
        github: true,
        twitter: "@myhandle",
      },
      footerText: {
        text: "© 2024 My Website",
        i18n: false,
      },
      items: [
        {
          title: "Links",
          contents: [
            { label: "Privacy Policy", to: "/privacy" },
            { label: "Terms of Use", to: "/terms" },
          ],
        },
      ],
    },
  },
};

export default config;

This example demonstrates a basic setup for a website configuration using the Config type. Adjust the fields according to your specific website's requirements and design preferences.

Project Details

For more details about this project, please visit Next.js Rich Template.

Call for Contributions

The documentation for this template is not comprehensive, and we welcome anyone who is willing to help improve it. Contributors will be acknowledged on this page. If you would like to contribute, please check our GitHub repository for more details.

nextjs-rich-tpl's People

Contributors

dependabot[bot] avatar fun117 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.