-
-
Notifications
You must be signed in to change notification settings - Fork 129
Description
I promise this is one of the last 5 issues I open 😁
You have that code in place inside convert_posts
which removes certain frontmatter variables.
I am using Jekyll since years now and Liquid has kinda autoboxes certain values like PHP, but I am using a lot of bool and empty string values in my current wordpress theme to check for conditions.
wordpress-to-jekyll-exporter/jekyll-exporter.php
Lines 280 to 284 in 403fc70
foreach ( $meta as $key => $value ) { | |
if ( ! is_numeric( $value ) && ! $value ) { | |
unset( $meta[ $key ] ); | |
} | |
} |
When I do the export, half of the variables are missing in my frontmatter in certain files. This makes it more complicated for me to write the correct code, because I cannot assume that the fields are always there.
Maybe its just my dev brain that tries toi make it failsafe, but also larger search&replace actions are more complicated, because the keys are available in some files and not others.
I simply commented the unset
line, but I wanted to point out that this behavior is (for me) unexpected. An exporter should export and not make decisions of what is a key of value and which ones are "use-less". Can I ask for the why of that code?
I can raise a PR to remove this foreach, but I guess this one is again a matter of opinion and I can also include it in a PR where I am going to add some docs for the next person.