Git Product home page Git Product logo

incremental-blog's Introduction

Incremental Blog

Incremental is a SSG blog template heavily inspired by Narative's Novela but migrated to Next.js and Mui.

Preface

A WIP with a laundry list of todos, but developed enough to serve some basic blog posts. Incremental allows bloggers to mostly focus on writing in MDX and customize components / theme colors for their needs.

Posts exists in the /posts. Incremental will parse the directory and serve all md or mdx files with publish: true in it's Front Matter.

Directory Structure

  incremental
    ├── pages
    │     ├── posts         
    │     |   └── 2022
    │     |          └── 8
    │     |              └── 8
    │     |                  └── post-slug.mdx
    |     └── author
    |           └─ index.tsx
    ├── public
    │     ├── images
    |     |      └─ all-images-referenced-in-posts.jpg
    │     └── static-files.js
    ├── styles
    │     ├── themes
    |     |      └─ mui-theme.ts
    │     └── globals.css
    ├── next.config.mjs
    └── package.json

Getting Started

Once you've cloned the repo, you'll need to install dependencies with npm install followed by npm run dev. Or the equivalent yarn commands.

Learn More

incremental.fyi is currently hosted on Cloudflare pages as it's free for me. There's plenty of instructions on how to deploy on Vercel. Also planning on a adding a docker file to support deploying on services like Google Cloud Run.

Adding A Post

You can replace the post directory with your own posts. posts.js will crawl the post directory treating all md and mdx files as posts.

Adding An Image Or Other Static Content

Images and other static content need to follow Nextjs rules and typically lives in the /public directory. References to images and other static content from posts then need to reference the absolute path instead of relative like the following

<div className="Image__Medium">
  <Image
    src="/images/medium.jpg"
    alt="alt text for medium image"
  />
  <figcaption>Caption text for medium image</figcaption>
</div>

Modifying Author

Author information is defined in a few places. I'll refactor it all out to a json config file soon but right now it's in.

  • /pages/author/index.tsx
  • /components/author-hero.tsx
  • /components/article-summary.tsx

Modifying Socials

Socials are defined in /components/socials.tsx. This will also likely be refactored into a config file instead of hardcoded in the template.

Modifying Theme

Following the general pattern the theme also needs to be refactored and styling is handled in the general theme template some in individual components.

TODOs

P0s

  • style for mobile
  • update SEO
  • add reading progress bar

P1s

  • clean up styles into theme
  • clean up components
  • comment code
  • add related articles
  • refactor style to not mix sx + styled + style jsx
  • refactor author details to config
  • add algolia search
  • add rss feed
  • add accessibility

P2s

  • copy code block
  • copy article link button
  • light / dark toggle
  • add mail subscription
  • add ability to separate content into separate repo
  • docker file

incremental-blog's People

Contributors

pengying 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.