docpad-plugin-partials icon indicating copy to clipboard operation
docpad-plugin-partials copied to clipboard

Rendering wrong partial when it has similar names

Open vebersol opened this issue 11 years ago • 2 comments

I'm using partials as components and sometimes it has a prefix on it, per example:

  • box1_example1
  • box1_example2

Sometimes, it renders box_example_2 in place of box_example_1. It seems that it doesn't get the name after underscore.

I've tried to use "-" instead of "_" and got the same issue.

vebersol avatar Jul 29 '14 12:07 vebersol

+1, I can vouch for this. It happened to me recently working on betabulls.docpad. I think it was the two "case-studies" partials here that mixed up:

But this is what we have deployed now and I think it's working:

Maybe try out the above linked approach @vebersol till this is patched. Name one with a "-" and the other with a "_". It's a weak fix but might work for now. :/

mikeumus avatar Apr 17 '16 02:04 mikeumus

I had the same issue as well. I think it has to do with fuzzyFindOne(partialFuzzyPath) matching filenames very lazily. If partials filename consists of multiple words delimited by dash or underscore and you call @partial('keyword'), and if one of the words is keyword, then partial will fetch that file.

yucho avatar Aug 25 '16 23:08 yucho