relative-link.html 425 B

12345678910
  1. {{- $baseURL := .Page.Site.BaseURL -}}
  2. {{- $parsedURL := urls.Parse $baseURL -}}
  3. {{/*
  4. This is the subdirectory within which the docs are hosted. We prepend it to relative URLs
  5. since Hugo versions > 0.87 changed how relative URLs are generated and we wish to maintain
  6. the legacy behavior.
  7. */}}
  8. {{- $parentPath := strings.TrimRight "/" $parsedURL.Path -}}
  9. {{- /* Chomp trailing newline. */ -}}
  10. {{ return $parentPath }}