I found this code snippet Hugo v0.112.0 - New template functions from @jmooring. It works fine.
I do not need on every page the edit and view links. How can I have this links only on specific pages?
layouts/_default/single.html
{{ define "main" }}
<div class="container">
<div class="row">
<div class="col p-4 my-4">
{{ .Content }}
{{ $published := .PublishDate | time.Format ":date_medium" }}
{{ $modified := .Lastmod | time.Format ":date_medium" }}
{{ if ne $published $modified }}
<span> Last modified: {{ $modified }} </span>
{{ partial "repository-link.html" (dict "action" "edit" "page" .) }}
{{ partial "repository-link.html" (dict "action" "view" "page" .) }}
{{ end }}
</div>
</div>
</div>
{{ end }}