getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.
https://getpelican.com
GNU Affero General Public License v3.0
12.55k stars 1.81k forks source link

Static content symlink instead of copy #2611

Closed beetleb closed 5 years ago

beetleb commented 5 years ago

Main question: Is there any way for me to tell Pelican to create a symbolic link to one of my static directories instead of copying?

The context: I have a Pelican site that I keep locally on my machine (i.e. not on the web). I've essentially set up a system where I can select photos/videos from my cell phone, and it then generates Pelican articles by date with the photos in it. The idea is to have a photo diary. When I go somewhere interesting (restaurant, museum), I take some/many photos of the place. Then I pass all these media files to my script which generates the Pelican articles - one per day, and all the photos of that day in that entry.

I'm running into two issues:

  1. This takes up a lot of space, and copying doubles the amount of space my media is taking up.

  2. Running make html takes a long time. Currently over 2 minutes, and I still have a few years worth of media to add to it.

Any tips on how I can have this would be great. Ideally I prefer not hard coding the paths in my article entries as I have lots of old content I'd need to modify, and a lot of scripts I'm using also are used for regular Pelican usage where I upload (a different blog) to a site.

avaris commented 5 years ago

Well, did you try setting STATIC_CREATE_LINKS=True?

beetleb commented 5 years ago

Ah, that should do it. I think my Google search kept taking me to an older version of that page. Need to check when I go home to see which version of Pelican I have.