Make H1 Link to Post on Entries Page

I've seen on other templates that you can make the title/h1 act as a URL to the entry. On my template, it's the date that acts as the permalink. I'd like for the h1 to also be a link on the entry's page, but can't figure out how to change that anywhere in the template, since both entries.html and entry.html just load the html content directly with the {{{html}}} variable. Am I missing something?

1 replies

I figured out a solution. In entries.html, I commented out the {{{html}}} variable and then added an h1 populated by the {{{url}}}, {{{title}}} variables, and then {{{body}}}.

For the curious, here's my whole entries.html:

   <!DOCTYPE html>
<html>
  {{> head}}
  <body>
    {{> header}}
    <div class="container">
      <div class="main">
        {{#entries}}
        <div class="entry">
          <!-- <a class="small date left margin" href="{{url}}">{{date}} ⌘</a> -->
          <p class="small date left margin">{{date}}</p>
          <!-- {{{html}}} -->

          <h1><a class="entries" href="{{{url}}}">{{{title}}}</a></h1>
            {{{body}}}

          {{#tags}}
          <a class="small tag" href="/tagged/{{slug}}">{{name}}</a>
          {{/tags}}
          <div class="clear"></div>
        </div>
        <hr class="red" />
        {{/entries}}
        {{#pagination}}
        <div class="pagination">
          {{#next}}
            <a href="/page/{{next}}">❮ Older</a>
          {{/next}}
          {{#previous}}
            <a href="/page/{{previous}}">Newer ❯</a>
          {{/previous}}
        </div>
        {{/pagination}}
        {{> footer}}
      </div>
    </div>
  </body>
</html>
Answered 4 months ago · Improve this answer

Markdown allowed
Question or feedback?
Contact us

Tags

developers 28 questions bug 14 questions posts 9 questions resolved 7 questions request 6 questions google-drive 5 questions configure 4 questions pages 3 questions added 3 questions meta 3 questions More tags →
Subscribe for changes
RSS Feed of latest questions