Skip to content

Footer copyright year is outdated (Static build limitation) #232

@iaeluk

Description

@iaeluk

Description
The footer currently uses {{ 'now' | date: '%Y' }} to display the copyright year. Since the site is statically generated via Eleventy, this value is "frozen" at build time. If the site isn't redeployed on or after January 1st, the year becomes outdated for visitors.

Suggested Solutions
I’d like to propose two ways to fix this behavior:

  1. GitHub Actions Scheduled Build (The "Static" Way):
    If you prefer to keep the HTML pure and avoid client-side scripts, a scheduled workflow could be added to .github/workflows/. This would trigger a fresh build automatically every January 1st:

    on:
      schedule:
        - cron: '0 0 1 1 *' # Runs at 00:00 on Jan 1st
    
    
  2. Client-side JavaScript (Set it and forget it):
    Replace the Liquid tag with a small span and a script to ensure the year is always current based on the user's system clock:

    &copy; <span id="year"></span> 37signals
    <script>document.getElementById('year').textContent = new Date().getFullYear();</script>

Both approaches would prevent the year from falling behind in the future.

Best regards,

Lucas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions