Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Archives #225

Merged
merged 2 commits into from
Sep 21, 2019
Merged

[Feature] Archives #225

merged 2 commits into from
Sep 21, 2019

Conversation

pad92
Copy link
Contributor

@pad92 pad92 commented Nov 20, 2018

add archive page for #220

@pad92 pad92 changed the title Add archives page for #220 [Feature] Archives Nov 20, 2018
@VincentTam
Copy link
Contributor

I've tested this PR on my demo Hugo GitLab pages with comment reply at https://vincenttam.gitlab.io/bhdemo (source), which is created to test #222

This works great! Thank you @pad92 for your contributions.

archive

@pad92
Copy link
Contributor Author

pad92 commented Nov 21, 2018 via email

@pad92 pad92 mentioned this pull request Jan 20, 2019
@VincentTam
Copy link
Contributor

VincentTam commented Apr 25, 2019

Due to #261, we should replace deprecated {{ .URL }} with {{ .RelPermalink }}.

diff --git a/layouts/_default/section.html b/layouts/_default/section.html
index 3057cf1..6844096 100644
--- a/layouts/_default/section.html
+++ b/layouts/_default/section.html
@@ -34,7 +34,7 @@
                           {{ $element.Date.Format "01-02" }}
                       </span>
                       <span class="archive-post-title">
-                          <a href="{{ $element.URL }}" class="archive-post-link">
+                          <a href="{{ $element.RelPermalink }}" class="archive-post-link">
                               {{ .Title }}
                           </a>
                       </span>
@@ -46,12 +46,12 @@
           <ul class="pager main-pager">
             {{ if .Paginator.HasPrev }}
               <li class="previous">
-                <a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}/">&larr; {{ i18n "newerPosts" }}</a>
+                <a href="{{ .RelPermalink }}page/{{ .Paginator.Prev.PageNumber }}/">&larr; {{ i18n "newerPosts" }}</a>
               </li>
             {{ end }}
             {{ if .Paginator.HasNext }}
               <li class="next">
-                <a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} &rarr;</a>
+                <a href="{{ .RelPermalink }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} &rarr;</a>
               </li>
             {{ end }}
           </ul>

change depreciated .URL to .RelPermalink thx @VincentTam
pad92 added a commit to pad92/beautifulhugo that referenced this pull request May 3, 2019
@halogenica halogenica merged commit b8321f8 into halogenica:master Sep 21, 2019
@halogenica
Copy link
Owner

Awesome stuff, thank you so much for this feature!

shantanugoel pushed a commit to shantanugoel/beautifulhugo that referenced this pull request Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants