Annual Plans & Site Stats
The homepage of ModernDuang can display two motivational widgets: Annual Plans — a progress tracker for your goals — and Site Stats — a live counter showing your site's uptime and a countdown to a ten-year milestone.
Annual Plans (plans)
The annual plans section lets you publicly track goals, whether personal, professional, or blog-related. Each plan has a description, completion status, and optional progress counters.
Configuration
Configured under the plans key in _config.modernduang.yml:
How Plans Are Displayed
Each plan item is rendered as a card in a list on the homepage:
Behavior Rules
- When
done: true, the plan shows a checkmark (✅) and is styled as completed (muted colors, strikethrough text if preferred) - When
done: falseandfinal > 1, a progress tag showscurrent/final(e.g.,7/10) along with a percentage - When
done: falseandfinal == 1withcurrent == 0, the plan shows an hourglass (⏳) indicating "not yet started" - When
done: falseandfinal == 1withcurrent > 0, the plan shows a spinner (🔄) indicating "in progress"
Overall Progress
At the top of the section, an overall progress bar is calculated automatically:
- Each plan contributes equally to the total (all plans have equal weight)
- A completed plan (
done: true) counts as 100% for that plan - An in-progress plan counts as
(current / final) * 100% - The overall percentage is the average across all plans
Toggling the Widgets
The site stats widget is disabled by default (siteStats.enable defaults to false). To show it, set siteStats.enable: true. When disabled, the entire site stats section (uptime counter and ten-year countdown) will not be rendered on the homepage.
Site Stats (siteStats)
The site stats widget displays two counters: an uptime counter showing how long your site has been running, and a ten-year promise countdown tracking progress toward a decade-long commitment.
Configuration
Uptime Counter
The uptime counter calculates the elapsed time since startDate and displays it as:
The calculation accounts for leap years and updates live on the page via JavaScript, counting up every second. It shows:
- Years and days (e.g., "2年182天")
- If less than 1 year, shows months and days
- If less than 1 month, shows days only
- If less than 1 day, shows hours, minutes, and seconds
Ten-Year Promise Countdown
The ten-year countdown automatically computes the end date as startDate + 10 years and displays a progress bar and percentage:
The percentage formula is:
For example, with startDate: '2024-01-01':
- On 2024-01-01: 0.0% (just started)
- On 2029-01-01: 50.0% (halfway)
- On 2034-01-01: 100.0% (milestone reached)
What Is the Ten-Year Promise?
The "十年之约" (Ten-Year Promise) is a community tradition among Chinese bloggers — a public commitment to keep blogging for at least ten years. Displaying the countdown on your site is both a personal motivator and a signal to readers that you are in it for the long haul.
Complete Example
The homepage will render:
Related Pages
- Hero Section — The homepage hero above the plans
- Profile Card — The sidebar profile alongside the plans
- Footer & ICP Beian — Site footer with copyright year
