Skip to content

wcwutw/wcwu.site

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Personal Website

Generated and powered by Cursor

A clean, researcher-style personal website built with TypeScript, HTML, CSS, and JavaScript.

πŸŽ‰ Quick Start

Your website is ready to use! If the development server is running, open:

http://localhost:8080

First Time Setup

# 1. Install dependencies
npm install

# 2. Build TypeScript
npm run build

# 3. Start development server
npm run dev

✨ Features

  • πŸ“± Responsive design - Works on all devices
  • πŸŒ“ Dark/Light theme toggle - Automatic preference saving
  • πŸ“ Markdown blog posts - Write in markdown with frontmatter
  • 🎨 Clean, minimalist UI - Academic/researcher style
  • πŸš€ Fast and lightweight - Loads in <500ms
  • πŸ’» Syntax highlighting - Beautiful code blocks
  • πŸ“‚ Simple content management - Just add markdown files

πŸ“ Project Structure

personal-site/
β”œβ”€β”€ index.html              # Main HTML file
β”œβ”€β”€ package.json           # Dependencies & scripts
β”œβ”€β”€ styles/
β”‚   └── main.css          # All styling (light + dark themes)
β”œβ”€β”€ src/                  # TypeScript source files
β”‚   β”œβ”€β”€ main.ts          # Entry point
β”‚   β”œβ”€β”€ theme.ts         # Theme management
β”‚   β”œβ”€β”€ router.ts        # Client-side routing
β”‚   β”œβ”€β”€ markdown.ts      # Markdown parsing
β”‚   β”œβ”€β”€ posts.ts         # Posts management
β”‚   └── pages/           # Page components
β”‚       β”œβ”€β”€ home.ts
β”‚       β”œβ”€β”€ blog.ts
β”‚       β”œβ”€β”€ about.ts
β”‚       └── archive.ts
β”œβ”€β”€ content/
β”‚   └── posts/           # Your markdown blog posts
β”‚       β”œβ”€β”€ getting-started.md
β”‚       β”œβ”€β”€ example-post.md
β”‚       └── ...
β”œβ”€β”€ dist/                # Compiled JavaScript (generated)
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ build.js        # Build script
β”‚   └── new-post.js     # Helper to create posts
└── doc/                # Documentation
    β”œβ”€β”€ DEPLOYMENT.md   # Deployment guide
    └── MIGRATION.md    # Hexo migration guide

✏️ Writing Blog Posts

Method 1: Using Helper Script (Recommended)

npm run new-post

This interactive script creates a new post with proper frontmatter.

Method 2: Manual Creation

  1. Create markdown file in content/posts/, e.g., my-first-post.md:
---
title: My First Post
date: 2026-01-17
category: general
tags: [tag1, tag2]
description: Brief description of your post
---

# My First Post

Your content here...
  1. Register the post in src/posts.ts:
const POST_FILES = [
    'example-post.md',
    'my-first-post.md',  // Add this line
];
  1. Rebuild:
npm run build
  1. Refresh browser to see your new post!

Markdown Features

Your posts support:

  • Headers (H1-H6)
  • Bold, italic, inline code
  • Code blocks with syntax highlighting
  • Links and images
  • Lists (ordered and unordered)
  • Tables
  • Blockquotes

Example code block:

```python
def hello():
    print("Hello, World!")
```

🎨 Customization

Update Your Information

  1. Site Title - Edit index.html:
<title>Your Name - Personal Website</title>
  1. Home Page - Edit src/pages/home.ts:
mainContent.innerHTML = `
    <h1>Your Name</h1>
    <p class="subtitle">Your Title @ University</p>
    <p>Your bio...</p>
`;
  1. About Page - Edit src/pages/about.ts:

    • Add your background
    • Update education
    • Change contact information
  2. Rebuild after changes:

npm run build

Customize Theme Colors

Edit styles/main.css:

:root {
    --bg-primary: #ffffff;
    --text-primary: #1a1a1a;
    --link-color: #0066cc;  /* Change this! */
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --text-primary: #e0e0e0;
    --link-color: #66b3ff;  /* And this! */
}

πŸ› οΈ Development

Available Commands

npm run build      # Compile TypeScript
npm run dev        # Build and start server
npm run watch      # Auto-compile on changes
npm run new-post   # Create new blog post

Development Workflow

For continuous development:

Terminal 1:

npm run watch

Terminal 2:

npx http-server -p 8080

Now TypeScript auto-compiles when you save files!

🌐 Deployment

When you're ready to deploy online, see doc/DEPLOYMENT.md for detailed instructions on:

  • GitHub Pages (free)
  • Netlify (free, easy drag-and-drop)
  • Vercel (free)
  • Traditional hosting
  • Custom domains

Quick Deploy (Netlify):

  1. Go to netlify.com/drop
  2. Drag the personal-site folder
  3. Your site is live!

πŸ“¦ Content Organization

Categories

Suggested categories for your posts:

  • general - Personal updates, reflections
  • code - Programming, algorithms, projects
  • baseball - Sports, games, travel
  • (Create your own!)

Tags

Tag your posts for better organization:

  • Technical: javascript, python, algorithm, tutorial
  • Academic: university, courses, semester-review
  • Personal: travel, sports, hobbies

πŸ”„ Migrating from Hexo

If you're migrating from an existing Hexo blog, see doc/MIGRATION.md for:

  • Frontmatter conversion guide
  • Content structure changes
  • Step-by-step migration process

πŸš€ Performance

  • Initial Load: ~50-100ms
  • Total Size: ~75KB (excluding images)
  • Time to Interactive: <500ms
  • Browser Support: Chrome/Edge/Firefox/Safari (latest)

πŸ“ Sample Posts

Four example posts are included to demonstrate features:

  1. getting-started.md - Complete usage guide
  2. example-post.md - Features overview
  3. sample-baseball.md - Travel/sports post example
  4. sample-semester.md - Academic post with code

Feel free to delete or customize these examples!

πŸ› Troubleshooting

Posts not showing?

  • Verify filename is added to src/posts.ts
  • Check frontmatter format is correct
  • Rebuild: npm run build

Dark mode not saving?

  • Ensure browser localStorage is enabled
  • Try clearing cache

Page not loading?

  • Check browser console for errors
  • Verify all TypeScript compiled successfully
  • Check file paths are correct

πŸ“š Technology Stack

  • HTML5/CSS3 - Structure and styling
  • TypeScript - Type-safe JavaScript
  • Marked.js (v11.1.1) - Markdown parsing
  • Highlight.js (v11.9.0) - Code syntax highlighting
  • CSS Custom Properties - Theming system
  • LocalStorage - Preference persistence

βœ… Next Steps

  1. ⬜ Browse your site at http://localhost:8080
  2. ⬜ Update src/pages/home.ts with your info
  3. ⬜ Update src/pages/about.ts with your background
  4. ⬜ Write your first blog post
  5. ⬜ Test on mobile device
  6. ⬜ Deploy online (see doc/DEPLOYMENT.md)

πŸ“„ License

MIT License - Feel free to use this template for your own website!

πŸ™ Credits

Built with:


Enjoy your new website! πŸŽ‰

About

wcwu.site

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors