tsmango / jekyll_alias_generator Goto Github PK
View Code? Open in Web Editor NEWA Jekyll plugin for generating redirect pages for posts.
A Jekyll plugin for generating redirect pages for posts.
If you would put the plugin in the root of your repo we could use all add it by running git submodule add git://...
from inside the _plugins
directory. Now this would put it too deep.
Keeping the .rb file in the root worked fine with other jekyll plugins.
Hi,
If the alias is a pure number, ruby gets made. The hack is to put the alias in quotes, but I'm sure there is a better way. (Sadly I know next to nothing about ruby, else I'd submit a patch).
_plugins/alias_generator.rb:63:in `extname': can't convert Fixnum into String (TypeError)
from /_plugins/alias_generator.rb:63:in `generate_aliases'
from/_plugins/alias_generator.rb:58:in `each'
from /_plugins/alias_generator.rb:58:in `generate_aliases'
from /_plugins/alias_generator.rb:43:in `process_posts'
from /_plugins/alias_generator.rb:42:in `each'
from /_plugins/alias_generator.rb:42:in `process_posts'
from /_plugins/alias_generator.rb:37:in `generate'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:184:in `generate'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:183:in `each'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:183:in `generate'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:39:in `process'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/jekyll:250
from /usr/bin/jekyll:23:in `load'
from /usr/bin/jekyll:23
Is this still maintained? It's linked from the Jekyll Plugins page. If not, it would be great to know which fork is best maintained so we can get the docs updated. Thanks!
It would be nice to have this as a Gem. I was able to create one in a few hours with no prior experience creating a RubyGem.
After upgrading to Jekyll 3.0.0 I get the following deprecation warning:
Deprecation: Collection#each should be called on the #docs array directly.
Called by alias_generator.rb:42:in `process_posts'.
Just to clarify, the plugin still works as expected.
When generating aliases for pages in the root dir like /about.md
(the actual file, not the alias), the plugin generates the wrong forwarding file. I fixed this by deleting the process_pages
method and calling process_posts
instead (and for semantics renaming it process_posts_and_pages
).
However, it seems like there was a reason to have different methods for posts and pages. I'd be happy to provide a pull request, once I understand your motivation.
I'm getting ~/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/jekyll-2.1.0/lib/jekyll/cleaner.rb:59: stack level too deep (SystemStackError)
while generating a Jekyll page and was able to reproduce the error with a minimal setup (joelmeyerhamme/jekyll_alias_issue#1):
jekyll new jekyll_alias_issue && cd jekyll_alias_issue
mkdir _plugins
curl https://raw.githubusercontent.com/tsmango/jekyll_alias_generator/master/_plugins/alias_generator.rb\
> _plugins/alias_generator.rb
rm *.html *.md
cat <<EOF > index.md
---
layout: page
title: Index
alias: "/index/"
---
This is the base Jekyll theme.
EOF
jekyll build
It was working fine on jekyll 1.4.3... Now I updated ruby to 2.0 and jekyll to 2.1.1 and getting the following error
Configuration file: /home/fareez/sites/fareez.info/_config.yml
Source: /home/fareez/sites/fareez.info
Destination: /home/fareez/sites/fareez.info/_site
Generating...
/home/fareez/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15: stack level too deep (SystemStackError)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.