How do I create a contributor link for each language? #750
Answered
by
roheclassic
roheclassic
asked this question in
Support
-
Hi! Thank you for nice design theme. I'm creating a website looks like a picture dictionary, QuestionWhen using Is it possible to generate "Contributor" links by language? expect:
actual:
My environments
Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
roheclassic
May 18, 2022
Replies: 1 comment 3 replies
-
I solved the problem. I made the following changes.
+ {{ $lang_ := .Lang }}
- <p><small>Posted {{ .PublishDate.Format "January 2, 2006" }} by {{ if .Params.contributors -}}{{ range $index, $contributor := .Params.contributors }}{{ if gt $index 0 }}{{ if eq $index $last }} and {{ else }}, {{ end }}{{ end }}<a class="stretched-link position-relative" href="{{ "/contributors/" | relURL }}{{ . | urlize }}/">{{ . }}</a>{{ end -}}{{ end -}} ‐ <strong>{{ .ReadingTime -}} min read</strong></small><p>
+ <p><small>Posted {{ .PublishDate.Format "January 2, 2006" }} by {{ if .Params.contributors -}}{{ range $index, $contributor := .Params.contributors }}{{ if gt $index 0 }}{{ if eq $index $last }} and {{ else }}, {{ end }}{{ end }}<a class="stretched-link position-relative" href="{{ $lang_ | relURL | urlize}}{{ "/contributors/" | relURL }}{{ . | urlize }}/">{{ . }}</a>{{ end -}}{{ end -}} ‐ <strong>{{ .ReadingTime -}} min read</strong></small><p>
- <h2 class="h3"><a class="stretched-link text-body" href="{{ .RelPermalink }}">{{ .Params.title }}</a></h2>
+ <h2 class="h3"><a class="stretched-link text-body" href="{{ .Permalink }}">{{ .Params.title }}</a></h2> I'm not familiar with HUGO, so I'm not sure if this is the right thing to do. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
roheclassic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I solved the problem.
I made the following changes.