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

Periods generating bad paths #1885

Closed
alansartlog opened this issue Feb 21, 2016 · 20 comments
Closed

Periods generating bad paths #1885

alansartlog opened this issue Feb 21, 2016 · 20 comments
Assignees
Milestone

Comments

@alansartlog
Copy link

This issue is similar to #1188. If the permalink uses the title of the post and the title has a period in it, it generates some weird paths.

I expect title: testdot. to create testdot/index.html instead I get testdot/index. I experimented with a few different variations and they all give me weird results.
title: test.dot -> test/index.dot
title: .testdot -> /index.testdot (no folder)

The same thing seems to happen if using slug or filename in the permalink. If you have two, like :slug/:title it'll do the first fine but the end will still be wrong, making slug & title: test.dot generate test.dot/test/index.dot. Strangely enough it doesn't happen if I make a section called test.dot and set the permalink to :section. I've also tried with a few other symbols, but they all seem to work just fine.

@bep bep added the Bug label Feb 21, 2016
@bep
Copy link
Member

bep commented Mar 3, 2016

I cannot reproduce this on OS X, so I guess you are on Windows.

  • What is your OS and Hugo version?

@alansartlog
Copy link
Author

Windows 10 64bit and Hugo version v0.15 BuildDate: 2015-11-25T14:35:20-03:00

@art-solopov
Copy link

Getting the same issue on Linux (Kubuntu 14.04), Hugo v0.16 BuildDate: 2016-06-12T11:47:29+03:00

@fchauvel
Copy link

fchauvel commented Sep 6, 2016

I'm having the same problem. I'm using Hugo v0.16, on Windows 7 (AMD64).

@bep bep mentioned this issue Oct 25, 2016
@gsdu8g9
Copy link

gsdu8g9 commented Oct 25, 2016

Related to Pagination bug? #2636

My system details.

Linux server1 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux

Hugo Static Site Generator v0.17 BuildDate: 2016-10-11T20:48:48+03:00

@leifurhauks
Copy link

I'm experiencing the same issue as described by @alansartlog (specifically title: test.dot -> test/index.dot) on Linux 4.8.8, x86_64.

Hugo version string: Hugo Static Site Generator v0.18-DEV BuildDate: 2016-11-16T19:07:41-05:00

Go version string: go version go1.7.3 linux/amd64

@technosophos
Copy link

I am experiencing this on macOS 10.12.1 with Go 1.7.4 and Hugo Hugo Static Site Generator v0.18.1 BuildDate: 2016-12-29T10:12:41-07:00

I'm migrating a site from another generator. Pages migrated that have dots in the title line generate a different page structure from the link they generate:

$  head 2016-10-14-kubernetes-1-4-ama.html.md
---
title: Kubernetes 1.4 AMA Video
date: 2016-10-14
tags: [ kubernetes ]
---

The page generated is:

public/2016/10/14/kubernetes-1/index.4-ama-video

But the link appearing in content is: http://localhost:1313/2016/10/14/kubernetes-1.4-ama-video (which results in a 404)

@wendigo
Copy link

wendigo commented Jan 8, 2017

Observation for #2915:
As far as I can see in the source code PagePub.TranslateRelative is responsible for this behaviour: https://github.com/spf13/hugo/blob/c38bfda43bde093aa5f3b3245e3d2de5190d1991/target/page.go#L61

translating paths accordingly:

authors/mateusz.gajewski to public/authors/mateusz/index.gajewski (wrong)
and
authors/mateusz_gajewski to public/authors/mateusz_gajewski/index.html (correct)

@wendigo
Copy link

wendigo commented Jan 8, 2017

Here's a patch that fixed a problem for me (in my case): https://gist.github.com/wendigo/42e949e82a8eba3c03fab38d9d0585d0

@moorereason
Copy link
Contributor

Can someone provide a site repo that reproduces this error? Like bep, I'm not able to reproduce it.

@wendigo
Copy link

wendigo commented Jan 9, 2017

Yes, I have one :)

@wendigo
Copy link

wendigo commented Jan 9, 2017

https://github.com/wendigo/hugo-taxonomy-dot

@wendigo
Copy link

wendigo commented Jan 15, 2017

@moorereason is this sufficient?

@moorereason
Copy link
Contributor

@wendigo,
Yes, notice the "thumbs up" on your previous comment. I just haven't had time to look into a fix.

@bep bep mentioned this issue Mar 13, 2017
26 tasks
@bep bep added this to the v0.20 milestone Mar 14, 2017
@bep bep self-assigned this Mar 14, 2017
@DarwinJS
Copy link
Contributor

This bug is still here for Hugo 0.19 on Windows 10.

Anyone know a workaround?

@bep
Copy link
Member

bep commented Mar 25, 2017

It will be fixed in 0.20, so I suggest you just live with it.

@DarwinJS
Copy link
Contributor

@bep - I hate to ask an OSS developer the most hated question :( - do you have a rough idea when that release will be stable?

@bep
Copy link
Member

bep commented Mar 25, 2017

@DarwinJS If you hate to ask then you should consider not asking. The release schedule is available somewhere else.

@DarwinJS
Copy link
Contributor

FYI - specifying a slug that uses a dash for the period worked fine for my case.

bep added a commit to bep/hugo that referenced this issue Mar 27, 2017
This is a pretty fundamental change in Hugo, but absolutely needed if we should have any hope of getting "multiple outputs" done.

This commit's goal is to say:

* Every file target path is created by `createTargetPath`, i.e. one function for all.
* That function takes every page and site parameter into account, to avoid fragile string parsing to uglify etc. later on.
* The path creation logic has full test coverage.
* All permalinks, paginator URLs etc. are then built on top of that same logic.

Fixes gohugoio#1252
Fixes gohugoio#2110
Closes gohugoio#2374
Fixes gohugoio#1885
Fixes gohugoio#3102
Fixes gohugoio#3179
Fixes gohugoio#1641
Fixes gohugoio#1989
@bep bep closed this as completed in 6bf010f Mar 27, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants