Joe Mooring

Results 604 comments of Joe Mooring

It seems to me that calling the Kroki API once with a POST request (and caching the returned image) makes more sense that to have every client call the Kroki...

@carlmjohnson Are the forms included on the page via a shortcode that calls a form partial?

When inserted via shortcode, you can use `.Ordinal` (e.g., `printf "foo-%03d" .Ordinal`). The `.Ordinal` is stable from one build to the next.

If you don't mind unstable id's, bep's suggestion of `math.Counter` works, and you can use that in base templates, partials, and shortcodes.

My only other thought for partials (you can use .Ordinal for shortcodes) is... layout/_default/single.html (or whatever) ``` {{ partial "foo.html" (dict "page" . "id" "6" }} ... {{ partial "foo.html"...

```text git clone --single-branch -b hugo-github-issue-13648 https://github.com/jmooring/hugo-testing hugo-github-issue-13648 cd hugo-github-issue-13648 hugo server ``` While `hugo server` is running: 1. Visit the [tags](/tags/) page 2. Add another tag to `content/posts/post-1.md` Note...

With the recent introduction of `resources.Copy` and `crypto.FNV32a` you can do: ```text {{ with resources.Get "sass/main.scss" }} {{ with $css := . | toCSS | minify | fingerprint }} {{...

Yeah, I guess `partialCached` only gets you most of the way there.

Using the un-minified bootstrap.css as the resource, with 100 pages, with a cold cache for each test... With `FNV32a` cache buster as described above: ![image](https://user-images.githubusercontent.com/335669/206798867-b002f4d9-a3a4-4e2e-871d-9255d1dbfa02.png) Without the cache buster: ![image](https://user-images.githubusercontent.com/335669/206799706-ac10ed98-08e5-45f8-b344-3571c480f536.png)...

So, the `resources.Copy` approach fails if you PostProcess the resource prior to copying. Which I think makes sense, but makes my head hurt.