Download layouts/_shortcodes/cs-module.html from abr00kx/taper: direct link, hf CLI and curl.
- Browser
- Download file 1.42 kB
-
https://huggingface.co/abr00kx/taper/resolve/main/layouts/_shortcodes/cs-module.html
- Command line
-
hf download hf://abr00kx/taper/layouts/_shortcodes/cs-module.html
-
curl -L -o cs-module.html https://huggingface.co/abr00kx/taper/resolve/main/layouts/_shortcodes/cs-module.html
1.42 kB
| {{/* | |
| This template is used to render a Client-Server API Module. Modules are defined | |
| alongside the `_index.md` for the CS API. | |
| The following parameters are expected: | |
| * `filename` the name of the module file to render, without extension (i.e. `spaces`). | |
| * `name` the display name of the module (i.e. `Spaces`). | |
| */}} | |
| {{ $name := .Params.name }} | |
| {{ $filename := .Params.filename }} | |
| {{ with .Site.GetPage "client-server-api/modules" }} | |
| {{ with .Resources.GetMatch (printf "%s%s" $filename ".md") }} | |
| {{/* Preserve previous scratch values so nested modules don't leak */}} | |
| {{ $prevPage := .Scratch.Get "endpoint_page" }} | |
| {{ $prevModule := .Scratch.Get "endpoint_module" }} | |
| {{/* Allow endpoints rendered in the module to accumulate on the parent page */}} | |
| {{ .Scratch.Set "endpoint_page" $.Page }} | |
| {{/* Name the module for grouping in the endpoints list */}} | |
| {{ .Scratch.Set "endpoint_module" $name }} | |
| {{ .RenderShortcodes }} | |
| {{/* Restore previous scratch values */}} | |
| {{ if $prevPage }} | |
| {{ .Scratch.Set "endpoint_page" $prevPage }} | |
| {{ else }} | |
| {{ .Scratch.Delete "endpoint_page" }} | |
| {{ end }} | |
| {{ if $prevModule }} | |
| {{ .Scratch.Set "endpoint_module" $prevModule }} | |
| {{ else }} | |
| {{ .Scratch.Delete "endpoint_module" }} | |
| {{ end }} | |
| {{ end }} | |
| {{ end }} | |