All Projects → jekyll → Jekyll Redirect From

jekyll / Jekyll Redirect From

Licence: mit
🔀 Seamlessly specify multiple redirections URLs for your pages and posts.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Jekyll Redirect From

jekyll-imgix
A plugin for integrating imgix into Jekyll sites
Stars: ✭ 49 (-92.22%)
Mutual labels:  jekyll, jekyll-plugin
jekyll-manager
A repackaged Jekyll Admin fork with some alterations.
Stars: ✭ 48 (-92.38%)
Mutual labels:  jekyll, jekyll-plugin
jekyll-pwa
Jekyll plugin for PWA
Stars: ✭ 95 (-84.92%)
Mutual labels:  jekyll, jekyll-plugin
Jekyll Minifier
Jekyll HTML/XML/CSS/JS Minifier utilising yui-compressor, and htmlcompressor
Stars: ✭ 215 (-65.87%)
Mutual labels:  jekyll, jekyll-plugin
jekyll-commonmark
CommonMark generator for Jekyll
Stars: ✭ 28 (-95.56%)
Mutual labels:  jekyll, jekyll-plugin
Jekyll Admin
A Jekyll plugin that provides users with a traditional CMS-style graphical interface to author content and administer Jekyll sites.
Stars: ✭ 2,531 (+301.75%)
Mutual labels:  jekyll, jekyll-plugin
jekyll-pwa-workbox
A Jekyll plugin using Workbox to make your PWA / Website available offline.
Stars: ✭ 22 (-96.51%)
Mutual labels:  jekyll, jekyll-plugin
Jekyll Embed Video
Embed videos in Jekyll webpages without a plugin (Youtube, Vimeo, Twitch, Streamable, Mixer, Google Drive clips + more)
Stars: ✭ 135 (-78.57%)
Mutual labels:  jekyll, jekyll-plugin
jekyll-default-layout
Silently sets default layouts for Jekyll pages and posts
Stars: ✭ 45 (-92.86%)
Mutual labels:  jekyll, jekyll-plugin
jekyll-stickyposts
Jekyll Stickyposts - move selected posts to the top of the list
Stars: ✭ 23 (-96.35%)
Mutual labels:  jekyll, jekyll-plugin
Jekyll Spaceship
🚀 A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, mermaid, emoji, video, audio, youtube, vimeo, dailymotion, soundcloud, spotify, etc.
Stars: ✭ 196 (-68.89%)
Mutual labels:  jekyll, jekyll-plugin
Jekyll Paginate V2
Pagination Generator for Jekyll 3 (enhanced replacement for the old built-in jekyll-paginate gem) ⛺
Stars: ✭ 412 (-34.6%)
Mutual labels:  jekyll, jekyll-plugin
Github Metadata
Jekyll plugin to propagate the `site.github` namespace and set default values for use with GitHub Pages.
Stars: ✭ 184 (-70.79%)
Mutual labels:  jekyll, jekyll-plugin
Jekyll Gist
📃 Liquid tag for displaying GitHub Gists in Jekyll sites.
Stars: ✭ 218 (-65.4%)
Mutual labels:  jekyll, jekyll-plugin
Jekyll Analytics
Plugin to easily add webanalytics to your jekyll site. Currently Google Analytics, Piwik and mPulse are supported.
Stars: ✭ 166 (-73.65%)
Mutual labels:  jekyll, jekyll-plugin
jekyll-ideal-image-slider
Add image sliders to Jekyll with Ideal Image Slider. Ruby plugin version. (This repository is archived. Issues are disabled. Pull requests will be ignored.)
Stars: ✭ 17 (-97.3%)
Mutual labels:  jekyll, jekyll-plugin
Pages Gem
A simple Ruby Gem to bootstrap dependencies for setting up and maintaining a local Jekyll environment in sync with GitHub Pages
Stars: ✭ 1,670 (+165.08%)
Mutual labels:  jekyll, jekyll-plugin
Jekyll Timeago
⌛️ Ruby library to compute distance of dates in words. Originally built for Jekyll.
Stars: ✭ 130 (-79.37%)
Mutual labels:  jekyll, jekyll-plugin
japr
Jekyll Asset Pipeline Reborn - Powerful asset pipeline for Jekyll that collects, converts and compresses JavaScript and CSS assets.
Stars: ✭ 52 (-91.75%)
Mutual labels:  jekyll, jekyll-plugin
Jekyll Gallery Generator
A Jekyll plugin that generates photo galleries from directories full of images.
Stars: ✭ 315 (-50%)
Mutual labels:  jekyll, jekyll-plugin

JekyllRedirectFrom

Give your Jekyll posts and pages multiple URLs.

When importing your posts and pages from, say, Tumblr, it's annoying and impractical to create new pages in the proper subdirectories so they, e.g. /post/123456789/my-slug-that-is-often-incompl, redirect to the new post URL.

Instead of dealing with maintaining those pages for redirection, let jekyll-redirect-from handle it for you.

Build Status

How it Works

Redirects are performed by serving an HTML file with an HTTP-REFRESH meta tag which points to your destination. No .htaccess file, nginx conf, xml file, or anything else will be generated. It simply creates HTML files.

Installation

Add this line to your application's Gemfile:

gem 'jekyll-redirect-from'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jekyll-redirect-from

Once it's installed into your evironment, add it to your _config.yml:

plugins:
  - jekyll-redirect-from

💡 If you are using a Jekyll version less than 3.5.0, use the gems key instead of plugins.

If you're using Jekyll in safe mode to mimic GitHub Pages, make sure to add jekyll-redirect-from to your whitelist:

whitelist:
  - jekyll-redirect-from

Then run jekyll <cmd> --safe like normal.

Usage

The object of this gem is to allow an author to specify multiple URLs for a page, such that the alternative URLs redirect to the new Jekyll URL.

To use it, simply add the array to the YAML front-matter of your page or post:

title: My amazing post
redirect_from:
  - /post/123456789/
  - /post/123456789/my-amazing-post/

Redirects including a trailing slash will generate a corresponding subdirectory containing an index.html, while redirects without a trailing slash will generate a corresponding filename without an extension, and without a subdirectory.

For example...

redirect_from:
  - /post/123456789/my-amazing-post

...will generate the following page in the destination:

/post/123456789/my-amazing-post

While...

redirect_from:
  - /post/123456789/my-amazing-post/

...will generate the following page in the destination:

/post/123456789/my-amazing-post/index.html

These pages will contain an HTTP-REFRESH meta tag which redirect to your URL.

You can also specify just one url like this:

title: My other awesome post
redirect_from: /post/123456798/

Prefix

If site.url is set, its value, together with site.baseurl, is used as a prefix for the redirect url automatically. This is useful for scenarios where a site isn't available from the domain root, so the redirects point to the correct path. If site.url is not set, only site.baseurl is used, if set.

Note: If you are hosting your Jekyll site on GitHub Pages, and site.url is not set, the prefix is set to the pages domain name i.e. http://example.github.io/project or a custom CNAME.

Redirect To

Sometimes, you may want to redirect a site page to a totally different website. This plugin also supports that with the redirect_to key:

title: My amazing post
redirect_to: http://www.github.com

Note: Using redirect_to or redirect_from with collections will only work with files which are output to HTML, such as .md, .textile, .html etc.

Customizing the redirect template

If you want to customize the redirect template, you can. Simply create a layout in your site's _layouts directory called redirect.html.

Your layout will get the following variables:

  • page.redirect.from - the relative path to the redirect page
  • page.redirect.to - the absolute URL (where available) to the target page

Configuration

You can configure this plugin in _config.yml by adding to the redirect_from key.

Disabling redirects.json

By default, a file called redirects.json, which can be used for automated testing or to implement server-side redirects, will be included in the output. To exclude it from the output, set the json key to false:

redirect_from:
  json: false

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].