Contents
Home » Blog » May 2026 · What I've Been Up To [Switch Theme] [中文]

May 2026 · What I've Been Up To

Stats, emojis, SEO, comments, Markdown


Stats Page & Visitor Counter

  • ASCII Heatmap & World Map
    At the end of April, I got the idea to build a stats page for the blog. Initially just an hourly distribution heatmap, but the requirements kept growing: daily bar charts, monthly trends, crawler sources, visitor loyalty...
    ASCII world map. Used DB-IP's free city-level IP database (8 million rows), batch-parsed visitor IP coordinates through a single file scan, then overlaid density characters onto map.txt.
  • Visitor Counter GIF
    Used Pillow to generate an 88×31 pixel LED seven-segment animated counter. 12-frame loop, scanline scrolling, glow effect, breathing light. Each homepage visit auto-updates the count and regenerates the image. Logic is isolated in scripts/counter.py.
  • Server Resource Monitoring
    Added psutil for CPU, memory, disk, and uptime reading, with a ctypes fallback for systems without psutil.
  • Comprehensive SEO Optimization

  • HTML 4.01 Transitional DOCTYPE, <html lang="zh/en">
  • Per-page unique <title>, auto-generated <meta description> (extracted from first body paragraph), <meta keywords> (extracted from tags)
  • <link rel="canonical"> + <link rel="alternate" hreflang="..."> Chinese-English cross-linking
  • Open Graph + Twitter Card complete tags
  • Global <font size="6"> auto-wrapped with <h1>, <font size="5"> with <h2>
  • Breadcrumb navigation (Home > Blog > Article Title)
  • Sitemap rewrite: 14 → 47+ URLs, including changefreq / priority
  • security.txt + /.well-known/security.txt (RFC 9116)
  • IE 5.5 Compatibility Audit

    In early May, I used AI to conduct a full-site compatibility audit, uncovering 30+ incompatibilities: rgba(), display:flex, box-sizing, overflow-x/y, placeholder, querySelector, etc. An audit document and blog post were produced. Core JS (guestbook, editor) already has IE 5.5 dual-path fallbacks.

    Guestbook Improvements

  • Floor Number System: Each message has an absolute floor number #N, displayed in gray on the right
  • Reply Quoting: Clicking the reply button inserts @xxx[#N], build process auto-strips reference numbers
  • Banned Words: Defined in data/runtime/banned_words.json, auto-replaced with <em>*</em>
  • Changelog Escaping: HTML-escaped at build time, preventing <font> tag pollution
  • Article Comment System

    Added comment sections to each blog post using a hybrid approach: CGI handles submission + build-time injection of existing comments. Supports threaded replies (unlimited nesting), emojis, IP toggle. Submission redirects with 302 back to the comment anchor, with background async build. Page-type (page-*) articles also have comment sections.

    Email System Optimization

  • Background Async Sending: Previously, @reply emails were sent synchronously — users had to wait for the email to finish before seeing the page redirect. Now changed to an independent process for background sending (mailer.py).
  • Emoji Rendering in Emails: [em07] is converted to <img> tags pointing to GIFs on the server.
  • Email HTML Template Extraction: Email template separated into src/components/cgi/mailer-email.html, using {variable} placeholders.
  • Markdown Blog Support

    All 50+ blog posts and standalone pages converted from HTML to Markdown. Created scripts/md2html.py converter — supports headings/bold/italic/code/tables/footnotes/quotes/images. Build process auto-detects .md extension and converts. Old HTML source files archived to src/archive-html/. MD and HTML can be mixed.

    Web Server Optimization

  • HTTP/1.1 + keep-alive (single connection reuse)
  • ThreadingMixIn multi-threading (parallel requests, no queuing)
  • Static resource aggressive caching: Cache-Control: max-age=86400 + Expires: 2030
  • Startup parameters nolog and nocount
  • Route table refactored, /.well-known/ support added
  • Project Structure Cleanup

  • data/ layered: runtime/ (manually maintained), build/ (auto-generated), comments/, logs/
  • assets/images/backgroundsassets/images/bg
  • All scripts migrated to scripts/, .cmd entry points unified
  • changelog.txtdata/logs/changelog.log
  • External resources localized (mirror-external.py), removed preconnect external links
  • counter.py, banned_words.py and other new scripts split out independently
  • Other

  • Stats page excludes specified IP (180.154.121.226)
  • 404.html unified to HTML 4.01 standard
  • Editor path correction (pages/blogblog)
  • All images max-width:100%;height:auto; to prevent overflow
  • Blog post count rose to 50+, sitemap coverage updated accordingly
  • RSS changed to extract title + subtitle from compiled dist pages
  • Guestbook Emoji System

  • Pixel Art GIF Emojis
    Added 20 pixel art emojis to the guestbook. Click » Emoticons below the input field to expand the folding panel, select from the grid, or manually type [em01] through [em20]. Stored as codes, automatically converted to images on both web pages and emails.
    The emoji panel doesn't load images by default (JS lazy generation), saving 20 initial HTTP requests.
  • Compact Form Layout
    Guestbook form changed from scattered label+input to HTML table layout. Name/Email/Content/Display IP/Send button all in a 125px-wide cell. Emoji panel saves space through folding, 1px CSS border replaced the original 2px default border.
  • Email System Optimization

  • Background Async Sending
    Previously, @reply emails were sent synchronously — users had to wait for the email to finish before seeing the page redirect. Now changed to an independent background process (mailer.py), passing content via stdin, subprocess.Popen returns immediately after launch.
  • Emoji Rendering in Emails
    [em07] in email body is now converted to <img> tags pointing to GIFs on the server, so recipients can also see the emoji animations.
  • Log System Refactoring

  • Unified Categorization
    Previously, logs from various modules were scattered across different locations. Now all consolidated under data/logs/:
  • 
    data/logs/
    ├── access/          ← Server access logs (daily .log, old logs .gz compressed)
    ├── guestbook.log    ← Guestbook operations (@mentions, SMTP status)
    ├── editor.log       ← Editor operations (create/edit/delete, auth failures)
    ├── search.log       ← Search keywords + result counts
    ├── toolbox.log      ← Toolbox usage records
    ├── build.log        ← Build records (page builds, full site rebuilds)
    └── error.log        ← Cross-module errors
    

    Created a unified logger.py module that all CGI scripts use to write to their respective categorized logs.

    Performance Optimization

  • External badge images added loading="lazy", not blocking first render
  • 20 emoji GIFs also changed to loading="lazy", reducing first-screen requests by 20
  • Header added external domain preconnect hints
  • Sidebar comment area locked to 700px width, preventing long content from breaking layout
  • Other Small Improvements

  • Web server changed to whitelist routing, sensitive directories (data/, scripts/, src/) unified 403
  • Added <!DOCTYPE html> declaration site-wide, goodbye Quirks Mode
  • editor.py added operation auditing (who changed what article and when)
  • Build script incremental caching switched to MD5 content hash, component changes correctly trigger full site rebuild
  • Blog editor, search engine, and toolbox all connected to unified logging
  • README documentation updated with explanations of all new features
  • —— Written on May 2, 2026, Happy Labor Day!


    « IE 5.5 Compatibility Audit « Home Scripts Overview »


    资源许可 · © 2004-2026 DragonRSTER · 最后更新于 2026年05月08日 02:07:09