There seems to be a limitation of BBEdit persistent includes that I haven't been able to find a way around. I wonder if anyone else has hit this wall, and if so, if you've gotten past it.
Here is a web page in my site (in its entirety):
<!-- #bbinclude "Case Index Page" #SORT_BY#="Date" -->
The "Case Index Page" include file contains this:
<!-- #bbinclude "case_index.swift" #SORT_BY_CI#="#SORT_BY#" -->
The nested include includes a script whose behavior depends on the value of its #SORT_BY_CI# parameter. I was expecting that BBEdit would substitute the value, "Date", for the reference "#SORT_BY#" in the nested include, so that case_index.swift would see "Date" as the value of #SORT_BY_CI#.
But apparently BBEdit does parameter substitution on the expansion of the nested include, not on the include itself. Thus, the included script sees the value of its #SORT_BY_CI# parameter as the string "#SORT_BY#".
In short, where a persistent-included text file contains a persistent includes of a script, there doesn't seem to be any way to make the behavior of the script depend on the parameters to the include of the text file.
Am I missing something?
Thanks,
Neil Faiman