Open tgermer opened 4 years ago
I used https://learnxinyminutes.com/docs/yaml/ to learn about anchors.
Hi [sorry I took ages to get back to you]
the issue is with the data type used to generate the name. The plugin expects a string and the argument passed is an array.
One solution could be using join
at the end of the array. Something like:
stg_kurz_abschluss_kurz: [*stg_kurz, '-', *abschluss_kurz].join
Another possibility could be that of using string interpolators, e.g.:
stg_kurz_abschluss_kurz: "#{*stg_kurz}-#{*abschluss_kurz}"
but I am not sure whether you can use these constructs in a YAML file. If you have not yet solved it and you want to give it a try, let me know if it works! thanks!
Thank you very much for your replay @avillafiorita
Unfortunately none of your suggestions work.
I have found the following websites:
But even this one doesn't get me anywhere. Do you have another tip?
You can try changing the sanitize_filename
function in lib/data_page_generator.rb
as follows:
def sanitize_filename(name)
if(name.is_a? Integer)
return name.to_s
end
### MANAGE ARRAYS IN INPUT ###
if (name.is_a? Array)
name = name.join("")
end
return name.tr("ÀÁÂÃÄÅàáâãäåĀāĂ㥹ÇçĆćĈĉĊċČčÐðĎďĐđÈÉÊËèéêëĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħÌÍÎÏìíîïĨĩĪīĬĭĮįİıĴĵĶķĸĹĺĻļĽľĿŀŁłÑñŃńŅņŇňʼnŊŋÑñÒÓÔÕÖØòóôõöøŌōŎŏŐőŔŕŖŗŘřŚśŜŝŞşŠšſŢţŤťŦŧÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųŴŵÝýÿŶŷŸŹźŻżŽž","AAAAAAaaaaaaAaAaAaCcCcCcCcCcDdDdDdEEEEeeeeEeEeEeEeEeGgGgGgGgHhHhIIIIiiiiIiIiIiIiIiJjKkkLlLlLlLlLlNnNnNnNnnNnNnOOOOOOooooooOoOoOoRrRrRrSsSsSsSssTtTtTtUUUUuuuuUuUuUuUuUuUuWwYyyYyYZzZzZz").downcase.strip.gsub(' ', '-').gsub(/[^\w.-]/, '')
end
the important lines are those checking whether the input is an Array
and making it into a string, if it is.
If you do not care about replacing accented chars, you can directly return from the condition, that is:
if (name.is_a? Array)
return name.join("")
end
let me know!
Hi thank you for that great and very useful plugin.
jekyll serve --trace produce the following error:
My data-file:
I configured in _config.yml
Is't it possible to use anchors with jekyll-datapage_gen? Can you please solve the problem or give me an advice?
Thank you very much in advance. Tristan