Skip to content

Use hard links instead of copying unprocessed files to the public directory #14392

@Berny23

Description

@Berny23

About the feature and problem

At the current state of Hugo, I have thousands of original images that get copied to /public every time I build the site. This is completely unnecessary and a waste of space on my PC. Since all the repo folders are usually on the same file system at build time, a hard link would be the perfect solution for most people and setups.

My setup:
Main PC (Arch Linux) → copy /public via rsync → NGINX webserver (Arch Linux)

About the proposed solution

This has already been discussed at #2245, but the issue is closed since 2022. However, there even was a proposed solution for the feature request:

  • --hardlink A switch to use hard links for unmodified static files.

I really hope to see this simple feature added.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions