spanezz / staticsite

Static site generator
GNU General Public License v3.0
46 stars 7 forks source link

`doc/reference/settings.md` django project link 404s #69

Closed eichin closed 2 months ago

eichin commented 2 months ago

doc/reference/settings.md links to django docs to explain settings in more detail:

happens in [Django](https://docs.djangoproject.com/en/1.9/topics/settings/).

That link is 404 - looks like they do keep docs that old but go directly from 1.8 to 1.10; current is 5.0 and if you change the link to https://docs.djangoproject.com/en/5.0/topics/settings/ or even 1.10 https://docs.djangoproject.com/en/1.10/topics/settings/ you end up with a plausible looking page.

(This is mostly a driveby - I was actually trying to figure out why settings.py works in enricozini-site but gets treated as an asset in mine, and the django page doesn't help with that. But at least it should work.)

spanezz commented 2 months ago

I fixed the link. With regards to loading settings, you've probably found a place where documentation should be improved.

Could you show me what you tried?

eichin commented 1 month ago

Thanks for the link fix. Re settings: I've dug a little since then, and it turns out that only commands that derive from SiteCommand even have the settings_files = ['settings.py', '.staticsite.py'] code; the two subcommands that don't are show and meta.

For meta it matters because the default EDIT_COMMAND doesn't work with emacsclient - an override of EDIT_COMMAND = ["emacsclient", "{name}"] works for edit but not for meta. (The problem with emacsclient itself is that emacsclient file +33 works fine, but + without a number gives *ERROR*: Invalid -position command in client args, and the code that calls it doesn't do anything with the +.)

For show it matters because if you set THEME in settings.py it applies with ssite serve but not with ssite show, and I don't see anything explaining why it should be inconsistent - it took me a while to figure out that it wasn't just "sometimes" ignored.

Given all that, it may just be as simple as changing to class Meta(SiteCommand) and class Show(ServerMixin, SiteCommand)? But I haven't tried it yet.