A minimal "Today I Learned" website built with Next.js and Tailwind CSS. This is mostly an experiment and a way for me to play around with javascript and react. But also a fun way to collect some of the things I learn along the way.
If you want to replicate this for your own TIL site, follow along with these instructions:
- Node.js (v18 or later)
- npm or yarn
- Git
- Clone the repository:
git clone https://github.com/michellejw/til-website.git
cd til-website
- Install dependencies:
npm install
# or
yarn install
- Start the development server:
npm run dev
# or
yarn dev
The site should run at http://localhost:3000
The project includes a CLI tool for creating new TIL entries:
node scripts/create-til.js "Your TIL Title"
This will launch a command line interface that will walk you through the basic creation of a new TIL markdown file. It incorporates some validation
create a new markdown file in src/content/til/[category]
with the correct frontmatter.
- Create a new markdown file in
src/content/til/[category]/[slug].md
- Add the required frontmatter:
---
title: "Your TIL Title"
summary: "A brief summary of what you learned"
tags: ["tag1", "tag2"]
date: "2024-11-05"
category: "category-name"
---
# Your Content Here
To customize the site title, description, and links:
- Update metadata in
src/app/layout.tsx
- Modify header/footer links in
src/components/site_header.tsx
- Optional: Adjust styling in
tailwind.config.ts
The project uses Tailwind CSS with a custom configuration. Modify the theme in tailwind.config.ts
to match your preferred styling.
├── public/ # Static assets
├── src/
│ ├── app/ # Next.js app router
│ │ ├── api/ # API routes
│ │ ├── fonts/ # Font files
│ │ ├── globals.css # Global styles
│ │ ├── layout.tsx # Root layout
│ │ └── page.tsx # Home page
│ ├── components/ # React components
│ │ ├── ui/ # shadcn/ui components
│ │ └── site_header.tsx # Site header/footer
│ ├── content/ # Content directory
│ │ └── til/ # TIL markdown files
│ ├── lib/ # Utility functions
│ └── types/ # TypeScript types
└── package.json
This project is released under the MIT License. See the LICENSE file for details.
- Built with Next.js
- Styled with Tailwind CSS
- Uses shadcn/ui components
- Markdown parsing by react-markdown
- Syntax highlighting by react-syntax-highlighter