Epoch Shortlinks

The idea isn’t mine:


But I like it – and it would be easy to implement in Hugo.

I thought about just adding an alias directly in the content generator, but I agree with Chris Beams in the post above; it is better with a dedicated field.

So to sum it up:

  • Add a timestamp field that defaults to epoch minutes on content creation time
  • Add some knobs:
    • Turn this timestamp feature on/off
    • Use epoch seconds instead of minutes
    • Add a custom epoch (for personal blogs, this could enable having a post about your birth with timestamp=0)

Any thoughts?

1 Like

I think it’s an idea with some merit.

Some suggestions:

  1. Make it optional
  2. Use seconds
  3. Use Base 36 encoding, not base 10.
    It’s a lot shorter and still works on case insensitive file systems.
  4. Tie it into the hugo new functionality.
  5. Provide a page.ShortLink() function
  6. Add documentation :slight_smile: