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

tags page generates broken links #24

Closed
VVelox opened this issue Sep 3, 2018 · 5 comments
Closed

tags page generates broken links #24

VVelox opened this issue Sep 3, 2018 · 5 comments

Comments

@VVelox
Copy link

VVelox commented Sep 3, 2018

Any combination of site baseURL, canonifyURLs, and relativeURLs always results in improper tag generation on the tags list page. So far the only work around I've found is setting baseURL to the setting canonifyURLs to true then creating a symlinkg from $publishDir."/tags/tags/" to $publishDir."/tags/".

Basically the URL for the tags/index.html always end up with tags/tags/.

@VVelox VVelox changed the title tags page generats broken links tags page generates broken links Sep 3, 2018
@libertylocked
Copy link
Contributor

I have this problem too. Running Hugo 0.49. I've fixed this in my fork. Plus PR #25

For now a workaround is to make a file layouts/_default/terms.html in your site source then paste the following

{{ partial "header.html" . }}

<h2 class="term-list-title">
    <a href="{{ .Permalink }}" class="linktopost">{{ .Title }}</a>
</h2>

<div class="terms">
{{ $data := .Data }}
{{ range $key, $value := .Data.Terms.Alphabetical }}

  <div class="term">
    <a href="{{ $value.Name | urlize }}">
      <div class="term-title">{{ $value.Name }} ({{ $value.WeightedPages.Count }})</div> 
    </a>

  </div> <!-- term -->

{{ end }}
</div> <!-- terms -->

{{ partial "footer.html" . }}

@heschlie
Copy link

I am seeing this as well, thanks for the fix

@michaelsaah
Copy link

Thanks for the patch, works great.

@VVelox
Copy link
Author

VVelox commented Oct 3, 2018

Here is what I used to fix it.

{{ partial "header.html" . }}
<section>
  <h2>{{ .Title }}</h2>
  <ul>
    {{ $data := .Data }}
    {{ range $key, $value := .Data.Terms.Alphabetical }}
    <li><a href="{{ $value.Name | urlize }}">{{ $value.Name }} ({{ $value.WeightedPages.Count }})</a></li>
    {{ end }}
  </ul>
</section>
{{ partial "footer.html" . }}

BloggerBust pushed a commit to BloggerBust/bloggerbust.github.io that referenced this issue Oct 13, 2018
The categories and tags links were broken in hugo_dusk theme. See
issue #24: gyorb/hugo-dusk#24

I applied libertylocked's fix by adding a layout page to override the
themes default terms layout. When upstream is corrected I plan on
removing my override.

I fixed a typo in Separate Dependencies From Implementation Using
Nauci Base Entry Docker Image.

I added Separate Dependencies From Implementation Using Nauci Base
Entry Docker Image to the series Using Docker To Separate Dependencies
From Implementation. I also added a series menu link to the home page. I
may remove the Categories menu link from the home page, I am not sure if it
is really that helpful. I might even remove the tags menu link for the
same reason.
BloggerBust pushed a commit to BloggerBust/bloggerbust.ca that referenced this issue Oct 13, 2018
The categories and tags links were broken in hugo_dusk theme. See
issue #24: gyorb/hugo-dusk#24

I applied libertylocked's fix by adding a layout page to override the
themes default terms layout. When upstream is corrected I plan on
removing my override.

I fixed a typo in Separate Dependencies From Implementation Using
Nauci Base Entry Docker Image.

I added Separate Dependencies From Implementation Using Nauci Base
Entry Docker Image to the series Using Docker To Separate Dependencies
From Implementation. I also added a series menu link to the home page. I
may remove the Categories menu link from the home page, I am not sure if it
is really that helpful. I might even remove the tags menu link for the
same reason.
@gyorb
Copy link
Owner

gyorb commented Nov 2, 2018

Sorry for the slow reply, thanks for the fix!

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

No branches or pull requests

5 participants