fetch-worker
Overview
The contents of this page are pulled at build time from a .md file stored in a remote repository here: https://github.com/mstura/doc_test/blob/master/markdown/com.castsoftware.dotnet/1.5.md. This uses a custom shortcode I have created called fetch-worker
:
{{/*
fetch-worker
Fetch and render remote content from a JSON proxy
*/}}
{{ $remote_url := (.Get 0) }}
{{ $remote_data := getJSON "https://hello-world-patient-snowflake-7358.infranotifications.workers.dev/fetch?url=" $remote_url }}
{{ with $remote_data }}
{{ $remote_data.body | safeHTML }}
{{ end }}
The shortcode fetch-worker
is similar to fetch-remote-github
in that it fetches the content via the github API in JSON format (not in raw markdown format) during the doc build using the data.getJSON
function. However, it also relies on a Cloudflare JavaScript worker, which does the heavy lifting and transforms the JSON into markdown:
This is based on this blog post: https://quinncasey.com/hugo-remote-content-from-url/.
data.getJSON
is deprecated as of Hugo 0.123.0.
Conclusions:
- Advantage: Does not require that the markdown file is present in the
doc
orextensions
repos. - Disadvantage: It uses the
getJSON
function which is deprecated (bad!) - Disadvantage: The TOC on the right hand side is NOT built correctly.
1.5.2-funcrel
Note
modified note
Other Updates
Details |
---|
testing 1234 |
1324qwef |
1.5.0-beta2
Rules
Rule Id | New Rule | Details |
---|---|---|
123413 | FALSE | asdfasdfa |
1.5.0-beta1
Note
test
New Support
Summary | Details |
---|---|
test | test |
test again | more testing |
Other Updates
Details |
---|
asdfasd |