Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

standard config file lookup #290

Open
anarcat opened this issue Jan 31, 2018 · 3 comments
Open

standard config file lookup #290

anarcat opened this issue Jan 31, 2018 · 3 comments

Comments

@anarcat
Copy link
Contributor

anarcat commented Jan 31, 2018

so in my long, ongoing shopping list, i'd like to add the capacity to load configuration files from standard locations. what i am doing right now is that i have a base config file that I copy all over the place. i think that's silly: that config file should work for gallery A as well as gallery B, without me having to copy that thing over. yes, they will have the same name: I don't care about that. in fact, ideally all relevant config files would be merged on top of each other so i could have a base, global config file with sane defaults and then be able to override that with a one-line config per gallery.

so, for example, I'd like sigal to load /etc/sigal.conf if it's available, then ~/.config/sigal.conf and ./sigal.conf (current default). i am not sure what --config should do - maybe it could just wipe that list and replace it with a single config.

would this be a good idea? i looked at the code briefly and i don't think it would be impossible to do...

@saimn
Copy link
Owner

saimn commented Feb 6, 2018

Nothing is impossible ;), but I'm not sure about this. IMO a config file is tied to a specific gallery, as you may want to use different directories/theme/plugins/etc. for different galleries. And I think that global config are often introducing confusion because it's easy to forget that there is a global config somewhere.
Another point is that current config files are Python file, not just text. It can contain real Python code, maybe not something that I would put in /etc.
But Sigal is not just for me, so if it is useful and if you want to code this, and if it does not add to much complexity, then I can live with it.

@fidergo-stephane-gourichon

After digging a little I realized I could have a common sigal conf file for all galleries, given that in my context, same thumbnail sizes, source and destination folders, author etc.

album title

The possibility to have album title in index.md is very nice. Suggesting that a warning appears, like "no index.md file, will use directory name as album title". In my first albums I directly changed sigal source code because I didn't know.

Zip

Having zip_gallery be a constant file-name is a no-go because you don't want people to have all the zips they download from your site being named archive.zip.

So, I use this and suggest it could be new default or new example in conf file comment:

zip_gallery = 'Photo album {album.author} - {album.title}.zip'

*Still, the need expressed by @anarcat is relevant.

@saimn
Copy link
Owner

saimn commented Jun 24, 2020

like "no index.md file, will use directory name as album title"

There could be a logging message, indeed.

zip_gallery = 'Photo album {album.author} - {album.title}.zip'

That would be a good addition to the config file comment 👍 .
Contributions are welcome ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants