Skip to content

Commit

Permalink
fix: baseURL variable on See all posts button (#38)
Browse files Browse the repository at this point in the history
* Fix See all posts error

Add baseURL variable to link of see all posts button.

* Fix See all posts button link

Fix for 404 errors in see all posts if the default URL is not root. Add a baseURL variable to the link in the button.

* Retuching Code of See all posts button

Apply by changing all publishing buttons to the code suggested by @kusyka911
  • Loading branch information
Rayjun0525 authored May 16, 2023
1 parent 2514abd commit 6e12b25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ <h3 class="posts-item-note" aria-label="Recent Posts">Recent Posts</h3>
{{ end }}
{{ if gt (len $posts) 5 }}
<p>
<a href="/posts/">See all posts</a>
{{ range $firstSection := (where .Site.Sections "Section" "in" (first 1 (.Site.Params.mainSections))) }}
<a href="{{ $firstSection.Permalink }}">See all posts</a>
{{ end }}
</p>
{{ end }}
</main>
Expand Down

0 comments on commit 6e12b25

Please sign in to comment.