nntrn / save

https://nntrn.github.io/save/
2 stars 0 forks source link

jekyll #33

Open nntrn opened 10 months ago

nntrn commented 10 months ago

Custom permalink using collections

include_relative

{% assign parent_path = page.path | split:'/' | last %}
{% assign parent_path = page.path | remove:  parent_path %}

{% for file in site.static_files %}
{% if file.path contains parent_path %}
{% assign file_name = file.path | remove:  parent_path | remove:  "/" %}

{% include_relative {{ file_name }} %}

{% endif %}
{% endfor %}

https://stackoverflow.com/a/61466077