coignard / weblog

A stupidly simple plain text-based blog engine. No HTML, CSS, or JS included.
https://renecoignard.com
MIT License
45 stars 4 forks source link

Use .ini file to store configuration #19

Closed nicolus closed 5 months ago

nicolus commented 5 months ago

Parsing YAML is hard. Unless we want to add a dependency to a proper YAML parser I think we're better off using INI files. For example with the current YAML implementation, something like the weblog directory in the provided config :

weblog_dir: "/path/to/your/weblog/directory"

would fail because the double quotes are not properly trimmed from the value.

Comments at the end of a line like this would also fail :

author_name: "John Doe" # This is not my actual name

I also refactored the null coalescing operators to null coalescing assignments for better readability, this is available since PHP 7.4 so I think it's safe to use.

coignard commented 5 months ago

I completely agree, great idea. Thank you for your contribution.