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

Jekyll 3.2 breaks jekyll-redirect-from if URL has colon #119

Closed
akoeplinger opened this issue Aug 23, 2016 · 7 comments
Closed

Jekyll 3.2 breaks jekyll-redirect-from if URL has colon #119

akoeplinger opened this issue Aug 23, 2016 · 7 comments

Comments

@akoeplinger
Copy link
Contributor

akoeplinger commented Aug 23, 2016

Add this to the frontmatter of a page:

redirect_from:
  - /bar:foo/

Since Jekyll 3.2 this now throws the following error during build:

alexander@ubuntu-desktop:~/dev/test$ bundle exec jekyll build
Configuration file: /home/alexander/dev/test/_config.yml
            Source: /home/alexander/dev/test
       Destination: /home/alexander/dev/test/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
  Liquid Exception: The URL /bar:foo/ is invalid because it contains a colon. in /_layouts/default.html
             ERROR: YOUR SITE COULD NOT BE BUILT:
                    ------------------------------------
                    The URL /bar:foo/ is invalid because it contains a colon.

The culprit seems to be this PR in Jekyll jekyll/jekyll#5069 which throws this error now while it worked in the past.

I noticed this in one of my site which has a large collection of legacy links from MediaWiki which contain colons in the URL.

@peterjc
Copy link

peterjc commented Aug 24, 2016

We also use colons in permalinks to preserve legacy MediaWiki URLs for https://github.com/biopython/biopython.github.io - e.g.:

$ head -n 8 wiki/Category_Cookbook.md 
---
title: Cookbook Entries
permalink: wiki/Category:Cookbook
layout: tagpage
tag: Cookbook
---

The entries contained in the Cookbook category are designed to

We link to them using e.g. from wiki/Documentation.md using:

-   [Wiki documentation](Category%3AWiki_Documentation "wikilink")

Note the colon in the relative link is escaped in the Markdown as %3A - this was working until the recent Jekyll update.

We also use colons with redirect_from, e.g.

$ head wiki/GSoC2011_mtrellet.md
---
title: GSoC2011 mtrellet
permalink: wiki/GSoC2011_mtrellet
layout: wiki
redirect_from:
 - /wiki/User:Mtrellet
---

Author & Mentors
----------------

I've just filed jekyll/jekyll#5284 on this.

@benbalter
Copy link
Contributor

@parkr it looks like you were involved in the original decision here.. can you weigh in a bit on the reasoning and possible workarounds?

@pathawks
Copy link
Member

The reasoning: jekyll/jekyll-paginate#8

@benbalter
Copy link
Contributor

Does redirect_from: Category%3AWiki_Documentation produce the desired output? I tested locally and the build completes.

akoeplinger added a commit to mono/website that referenced this issue Aug 24, 2016
This is a workaround for a breaking change in latest Jekyll. See jekyll/jekyll-redirect-from#119
@akoeplinger
Copy link
Contributor Author

@benbalter yes, that seems to work and produces the correct filename with colon on disk.

@peterjc
Copy link

peterjc commented Aug 24, 2016

Percent encoding the colons in redirect_from alone does not fix jekyll build for me - there are likely other issues including permalink for us, hopefully will be resolved via jekyll/jekyll#5284

peterjc added a commit to biopython/biopython.github.io that referenced this issue Aug 24, 2016
Suggested in jekyll/jekyll-redirect-from#119
as a workaround from the regression in Jekyll 3.2, see also:
jekyll/jekyll#5284

This alone does not fix jekyll build in local testing.
@pathawks
Copy link
Member

Closing because this is a Jekyll core issue, rather than specific to this plugin.

akoeplinger added a commit to mono/md-website that referenced this issue Aug 25, 2016
This is a workaround for a breaking change in latest Jekyll. See jekyll/jekyll-redirect-from#119
@jekyll jekyll locked and limited conversation to collaborators Apr 26, 2019
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

5 participants