I am trying content adapters with local data. But, shortcode in content do not works.
local data: /data/posts.json
_content.gotmpl:
{{ range .Site.Data.posts }}
{{ $content := dict
"mediaType" "text/markdown"
"value" .content
}}
{{ $dates := dict
"date" (time.AsTime .date)
}}
{{ $params := dict
"tags" .tags
}}
{{ $page := dict
"content" $content
"dates" $dates
"kind" "page"
"params" $params
"path" .path
"title" .title
}}
{{ $.AddPage $page }}
{{ end }}
For example, twitter shortcode.
Case 1:
[
{
"date": "2024-05-28T20:25:56",
"path": "2024/05/28202556",
"title": "interesting!",
"tags": ["Hugo"],
"content": "Interesting!{{< twitter user=\"gohugoiov2\" id=\"1792275723438133434\" >}}"
}
]
It works fine.
But, case 2:
[
{
"date": "2024-05-28T20:25:56",
"path": "2024/05/28202556",
"title": "interesting!",
"tags": ["Hugo"],
"content": "{{< twitter user=\"gohugoiov2\" id=\"1792275723438133434\" >}}"
}
]
No displays. It do not works.
It appears to depend on whether there is any text (“Interesting!” in the example above) before the shortcode.
Anybody has ideas?