Skip to content

Commit b5ec665

Browse files
committed
Fix: render-link.html: Remove extra space after links
The addition of a whitespace removal trick in render-link.html prevents an unwanted space after the <a> tag and before subsequent punctuation. Also, correct the link of the code.
1 parent 1878787 commit b5ec665

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

content/blog/spiking-neural-network-framework-benchmarking/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The ideal library will often depend on a multitude of factors, such as accessibl
5656
**19/2/2024**: [Jens E. Pedersen](/contributors/jens-e-pedersen/) updated the benchmark for Norse to use the correct neuron model and `torch.compile`.
5757

5858
## Code and comments
59-
The code for this benchmark is available [here](https://github.com/open-neuromorphic/open-neuromorphic.github.io/blob/main/content/english/blog/spiking-neural-network-framework-benchmarking/). The order of dimensions in the input tensor and how it is fed to the respective models differs between libraries.
59+
The code for this benchmark is available [here](https://github.com/open-neuromorphic/open-neuromorphic.github.io/blob/main/content/blog/spiking-neural-network-framework-benchmarking/). The order of dimensions in the input tensor and how it is fed to the respective models differs between libraries.
6060
Benchmarks were run on a NVIDIA RTX 4090 with 24GB of VRAM. Frameworks use full precision computation unless stated otherwise.
6161
<!-- Benchmarks are averaged across 100 runs on a NVIDIA A100 GPU with 40GB of vRAM. Standard deviations have been omitted because they are negligible. Frameworks use full precision computation unless stated otherwise. -->
6262

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
{{- /* layouts/_default/_markup/render-link.html */ -}}
22
<a href="{{ .Destination | safeURL }}"
3-
{{- with .Title}} title="{{ . }}"{{ end -}}
4-
{{- $isExternal := strings.HasPrefix .Destination "http" -}}
5-
{{- if $isExternal }} target="_blank" rel="noopener"{{ end -}}
6-
{{- $class := "" -}}
7-
{{- if in .Destination "?class=" -}}
8-
{{- $class = index (findRE `class=([^&#]*)` .Destination) 0 | replace `class=` `` | replace `+` ` ` -}}
9-
class="{{ $class }}"
10-
{{- end -}}
11-
>
12-
{{- .Text | safeHTML -}}
13-
{{- if and $isExternal (not (in (string $class) "btn")) (not (in (string $class) "breadcrumb-link-parent")) (not (in (string $class) "social-link-container")) -}}
14-
{{- partial "icon.html" (dict "style" "solid" "name" "arrow-up-right-from-square" "class" "inline-block ml-[.5] pb-[.4]" "width" "1em" "height" "0.7em") -}}
15-
{{- end -}}
16-
</a>
3+
{{- with .Title}} title="{{ . }}"{{ end -}}
4+
{{- $isExternal := strings.HasPrefix .Destination "http" -}}
5+
{{- if $isExternal }} target="_blank" rel="noopener"{{ end -}}
6+
{{- $class := "" -}}
7+
{{- if in .Destination "?class=" -}}
8+
{{- $class = index (findRE `class=([^&#]*)` .Destination) 0 | replace `class=` `` | replace `+` ` ` -}}
9+
class="{{ $class }}"
10+
{{- end -}}
11+
>
12+
{{- .Text | safeHTML -}}
13+
{{- if and $isExternal (not (in (string $class) "btn")) (not (in (string $class) "breadcrumb-link-parent")) (not (in (string $class) "social-link-container")) -}}
14+
{{- partial "icon.html" (dict "style" "solid" "name" "arrow-up-right-from-square" "class" "inline-block ml-[.5] pb-[.4]" "width" "1em" "height" "0.7em") -}}
15+
{{- end -}}
16+
</a><!--
17+
This empty Go template tag with hyphens is a Hugo trick.
18+
It consumes any trailing whitespace (like newlines) from this partial's output.
19+
This prevents the markdown renderer from adding an unwanted space after the <a> tag
20+
and before any subsequent punctuation (e.g., "link," vs. "link ,").
21+
-->{{- "" -}}

0 commit comments

Comments
 (0)