I would recommend that you keep your topic about one thing. It may sound more effective to put totally unrelated questions in there at once, but it isn’t.
After seeing this, I changed my shortcodes for embedding static tweets from using getJSON to using resources.GetRemote. While that worked, I did notice one key difference. Here is an ultra-simplified code block showing the two:
The difference was that .Page.RenderString caused errors when I tried to use it with resources.GetRemote, so I had to use markdownify instead. However, I seemed to get somewhat better results when I was using .Page.RenderString with getJSON — so is there some approach that would allow use of at least some form of .RenderString with .resources.GetRemote?
Wouldn’t this change the context so that .Page is not available anymore? If you store the page in $curPage and then do {{ $text := $json.text | $curPage.RenderString }} does it work?
Not .Page.RenderString which is what you had… i mean $.Page.RenderString which is top level context, even from within the with. Notice the leading $ which is the top level context variable anywhere. It’s not always the right approach, depending on partials, shortcodes, and what level in them you are at, but it sometimes can be the right approach.
I tend to use the $curPage method because I am frequently in a partial from a shortcode and other contexts where $. doesn’t work as expected, and it is easier for me to be use something that works consistently in my use cases, but thank you for reminding that in simpler cases that it is available.
Yes, exactly what I was trying to communicate with the “edge cases” where that $ won’t work as expected. And yea you have a good point about consistency and expectation.