Code Monkey home page Code Monkey logo

felixmokross.dev's Introduction

felixmokross.dev

This is the source code of my personal blog felixmokross.dev. It is built with Next.js and Tailwind CSS. See this post for more information on the tech stack and how the blog works.

Tech Stack

How the Blog Works

The blog posts are hosted in a separate GitHub repository, the content repository. It has the following file structure:

  • posts/ – All published posts are located in this directory.
    • example-post/ – Each post has a directory. The name of the directory is used as the post's slug.
      • post.md – This file contains the Markdown content of the post (including front matter).
      • … – The directory can contain any further assets used for the post.
    • another-post/
    • third-post/
  • drafts/ – Drafts posts are created in this folder and are moved to posts to publish them. The blog does not read this folder.

The blog uses Static Site Generation (SSG) and therefore needs to be rebuilt and deployed when a post is added or updated. For this, the app exposes a deploy hook on Vercel. Whenever a pull request is merged on the main branch of the content repository, a GitHub Action calls the deploy hook, triggering a rebuild and deployment of the app. In the build, the posts are retrieved from the content repository to generate the static pages.

File Structure

In the /app directory the routes are defined. They are:

  • blog/ – Home page
    • [slug]/ – Post page

System Requirements

  • Node.js 18.0.0 or later (needed for the Fetch API to be available, which is used in the RSS Feed and Sitemap scripts)
  • pnpm

Running Locally

  1. Create a .env file in the root directory to set the environment variables. .env.example can be used as a template.

  2. Clone the repository and run the app in development mode.

    $ git clone https://github.com/felixmokross/felixmokross.dev
    $ cd felixmokross.dev
    $ pnpm install
    $ pnpm dev

Scripts

Command Description
pnpm dev Run in development mode
pnpm build Create production build
pnpm analyze Create production build and analyze bundles
pnpm start Serve production build
pnpm lint Run linter
pnpm format Format all files using Prettier
pnpm generate-rss Generate the RSS feed for the blog (run as part of build)
pnpm generate-sitemap Generate the sitemap (run as part of build)

felixmokross.dev's People

Contributors

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