Git Product home page Git Product logo

static-blog-app's Introduction

Blog Site

This is a blog site that I created using Next.js that leverages getStaticProps for static generation and Markdown files for content management.

Setup and Run

  1. Clone the repository:
    git clone https://github.com/Animesh-Pattnaik/static-blog-app.git
  2. cd blog-site
  3. Run the development server:
npm run dev
# or
yarn dev
  1. Open http://localhost:3000 with your browser to see the result.

Project Structure

  1. content/posts: Directory containing Markdown files for blog posts.
  2. components: Directory containing reusable components (Layout.js, BlogList.js, BlogPost.js, SearchBar.js).
  3. pages: Next.js pages (index.js for homepage, [slug].js for individual blog posts).
  4. styles: Global CSS for styling.

Key Components

  1. layout.js: Layout component for consistent page structure.
  2. BlogList.js: Component to display a list of blog post summaries.
  3. BlogPost.js: Component to display individual blog post content.
  4. SearchBar.js: Component to handle search functionality.

Static Generation

  1. getStaticProps: Fetches blog posts from Markdown files at build time.
  2. getStaticPaths: Generates paths for individual blog posts based on filenames.

Deploy on Vercel

Deploy the project on platforms like Vercel or Netlify.

On Vercel:

  1. Push your code to a GitHub repository.
  2. Log in to Vercel and create a new project.
  3. Import your GitHub repository.
  4. Follow the prompts to deploy your site.

You now have a blog site with search functionality, enabling users to filter blog posts by their search terms.

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!

static-blog-app's People

Contributors

animesh-pattnaik avatar

Watchers

 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.