HUGO

Anchoring dillima with academic theme

Hi I have a website at http://www.scottrlarson.com and my github repository at https://github.com/scottrlarson/profession. I’m using the Academic theme for my site. It looks like (to me) that the theme uses .scratch variable to generate the home page based on the markdown files within the home directory. This works great, but now I am running into a problem where I want to link some specific text from one of those markdown files within the home directory but im unable to use the anchors to reference the headings in the file because the file itself has a generated anchor itself.

So for instance if I want to link my rates page (which is a markdown file within the home directory) from another page I would call it like this: http://scottrlarson.com/#rates. The problem is that If I want to link to some specific text within the rates page I cannot do so because I can only use one anchor symbol (#) at a time within the link (as far as I know).

I’m looking for a solution where I could link to a heading within a markdown file within the home directory with out breaking the way my home page is being rendered, but I am open to changing the rendering if need be. The code from widget_page.html that is used to render the files in the home directory as my entire site page is below. Im using HUGO_VERSION = “0.40.3”:

{{ partial "header.html" . }}
{{ partial "navbar.html" . }}

<!-- Flag for jQuery -->
<span id="homepage" style="display: none"></span>

{{ if .IsHome }}
  {{ .Scratch.Set "section" "home" }}
{{ else }}
  {{ .Scratch.Set "section" .Section }}
{{ end }}
{{ $section := .Scratch.Get "section" }}

<!-- Widgets -->
{{ range $index, $page := where (where .Data.Pages "Section" $section) ".Params.active" "!=" false }}
  {{ $params := dict "root" $ "page" $page }}
  {{ $widget := printf "widgets/%s.html" ( or $page.Params.widget "custom" ) }}
  {{ if eq $page.Params.widget "hero" }}
    {{ partial $widget $params }}
  {{ else }}
  <section id="{{ $page.File.TranslationBaseName }}" class="home-section">
    <div class="container">
      {{ partial $widget $params }}
    </div>
  </section>
  {{ end }}
{{ end }}

<!-- Page Footer -->
{{ partial "footer_container.html" . }}
{{ partial "footer.html" . }}

This template is being called from index.html:
{{ partial "widget_page.html" . }}

Hi. I was wondering if I posted in the correct place, and if there was enough information to warrant a response.