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 · 19 comments

Comments

Projects
None yet
10 participants
@alansartlog

alansartlog commented Feb 21, 2016

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

This comment has been minimized.

Show comment
Hide comment
@bep

bep Mar 3, 2016

Member

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

  • What is your OS and Hugo version?
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

This comment has been minimized.

Show comment
Hide comment
@alansartlog

alansartlog Mar 4, 2016

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

alansartlog commented Mar 4, 2016

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

@art-solopov

This comment has been minimized.

Show comment
Hide comment
@art-solopov

art-solopov Aug 14, 2016

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

art-solopov commented Aug 14, 2016

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

@fchauvel

This comment has been minimized.

Show comment
Hide comment
@fchauvel

fchauvel Sep 6, 2016

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

fchauvel commented Sep 6, 2016

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

@bep bep referenced this issue Oct 25, 2016

Closed

Pagination bug? #2636

@gsdu8g9

This comment has been minimized.

Show comment
Hide comment
@gsdu8g9

gsdu8g9 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

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

This comment has been minimized.

Show comment
Hide comment
@leifurhauks

leifurhauks Dec 5, 2016

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

leifurhauks commented Dec 5, 2016

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

This comment has been minimized.

Show comment
Hide comment
@technosophos

technosophos Jan 7, 2017

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)

technosophos commented Jan 7, 2017

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

This comment has been minimized.

Show comment
Hide comment
@wendigo

wendigo 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 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

This comment has been minimized.

Show comment
Hide comment
@wendigo

wendigo Jan 8, 2017

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

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

This comment has been minimized.

Show comment
Hide comment
@moorereason

moorereason Jan 9, 2017

Contributor

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

Contributor

moorereason commented Jan 9, 2017

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

@wendigo

This comment has been minimized.

Show comment
Hide comment
@wendigo

wendigo Jan 9, 2017

Yes, I have one :)

wendigo commented Jan 9, 2017

Yes, I have one :)

@wendigo

This comment has been minimized.

Show comment
Hide comment
@wendigo

This comment has been minimized.

Show comment
Hide comment
@wendigo

wendigo Jan 15, 2017

@moorereason is this sufficient?

wendigo commented Jan 15, 2017

@moorereason is this sufficient?

@moorereason

This comment has been minimized.

Show comment
Hide comment
@moorereason

moorereason Jan 16, 2017

Contributor

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

Contributor

moorereason commented Jan 16, 2017

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

@bep bep referenced this issue Mar 13, 2017

Closed

Add custom output formats #2828

26 of 26 tasks complete

@bep bep added this to the v0.20 milestone Mar 14, 2017

@bep bep self-assigned this Mar 14, 2017

@DarwinJS

This comment has been minimized.

Show comment
Hide comment
@DarwinJS

DarwinJS Mar 25, 2017

Contributor

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

Anyone know a workaround?

Contributor

DarwinJS commented Mar 25, 2017

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

Anyone know a workaround?

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Mar 25, 2017

Member

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

Member

bep commented Mar 25, 2017

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

@DarwinJS

This comment has been minimized.

Show comment
Hide comment
@DarwinJS

DarwinJS Mar 25, 2017

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?

Contributor

DarwinJS commented Mar 25, 2017

@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

This comment has been minimized.

Show comment
Hide comment
@bep

bep Mar 25, 2017

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@DarwinJS

DarwinJS Mar 25, 2017

Contributor

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

Contributor

DarwinJS commented Mar 25, 2017

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

hugolib: Refactor/-work the permalink/target path logic
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 #1252
Fixes #2110
Closes #2374
Fixes #1885
Fixes #3102
Fixes #3179
Fixes #1641
Fixes #1989

@bep bep closed this in 6bf010f Mar 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment