Remove relative permalinks
This commit is contained in:
parent
786f6e1985
commit
9ab3c201c8
|
@ -36,17 +36,13 @@ module Jekyll
|
|||
end
|
||||
|
||||
def deprecated_relative_permalinks(site)
|
||||
contains_deprecated_pages = false
|
||||
site.pages.each do |page|
|
||||
if page.uses_relative_permalinks
|
||||
Jekyll::Deprecator.deprecation_message "'#{page.path}' uses relative" +
|
||||
" permalinks which will be deprecated in" +
|
||||
" Jekyll v2.0.0 and beyond."
|
||||
contains_deprecated_pages = true
|
||||
if site.config['relative_permalinks']
|
||||
Jekyll::Deprecator.deprecation_message "Your site still uses relative" +
|
||||
" permalinks, which was removed in" +
|
||||
" Jekyll v3.0.0."
|
||||
return true
|
||||
end
|
||||
end
|
||||
contains_deprecated_pages
|
||||
end
|
||||
|
||||
def conflicting_urls(site)
|
||||
conflicting_urls = false
|
||||
|
|
|
@ -45,9 +45,6 @@ module Jekyll
|
|||
'host' => '127.0.0.1',
|
||||
'baseurl' => '',
|
||||
|
||||
# Backwards-compatibility options
|
||||
'relative_permalinks' => false,
|
||||
|
||||
# Output Configuration
|
||||
'permalink' => 'date',
|
||||
'paginate_path' => '/page:num',
|
||||
|
|
|
@ -52,12 +52,8 @@ module Jekyll
|
|||
# Returns the String permalink or nil if none has been set.
|
||||
def permalink
|
||||
return nil if data.nil? || data['permalink'].nil?
|
||||
if site.config['relative_permalinks']
|
||||
File.join(@dir, data['permalink'])
|
||||
else
|
||||
data['permalink']
|
||||
end
|
||||
end
|
||||
|
||||
# The template of the permalink.
|
||||
#
|
||||
|
@ -156,9 +152,5 @@ module Jekyll
|
|||
def index?
|
||||
basename == 'index'
|
||||
end
|
||||
|
||||
def uses_relative_permalinks
|
||||
permalink && !@dir.empty? && site.config['relative_permalinks']
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -287,8 +287,8 @@ module Jekyll
|
|||
#
|
||||
# Returns
|
||||
def relative_permalinks_are_deprecated
|
||||
if config['relative_permalinks'] && has_relative_page?
|
||||
Jekyll::Deprecator.deprecation_message "Since v2.0, permalinks for pages" +
|
||||
if config['relative_permalinks']
|
||||
Jekyll.logger.abort_with "Since v3.0, permalinks for pages" +
|
||||
" in subfolders must be relative to the" +
|
||||
" site source directory, not the parent" +
|
||||
" directory. Check http://jekyllrb.com/docs/upgrading/"+
|
||||
|
@ -370,14 +370,6 @@ module Jekyll
|
|||
|
||||
private
|
||||
|
||||
# Checks if the site has any pages containing relative links
|
||||
#
|
||||
# Returns a Boolean: true for usage of relateive permalinks, false
|
||||
# if it doesn't
|
||||
def has_relative_page?
|
||||
pages.any? { |page| page.uses_relative_permalinks }
|
||||
end
|
||||
|
||||
# Limits the current posts; removes the posts which exceed the limit_posts
|
||||
#
|
||||
# Returns nothing
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
markdown: kramdown
|
||||
highlighter: pygments
|
||||
relative_permalinks: false
|
||||
permalink: /news/:year/:month/:day/:title/
|
||||
excerpt_separator: ""
|
||||
|
||||
|
|
|
@ -502,9 +502,6 @@ port: 4000
|
|||
host: 127.0.0.1
|
||||
baseurl: "" # does not include hostname
|
||||
|
||||
# Backwards-compatibility
|
||||
relative_permalinks: false
|
||||
|
||||
# Outputting
|
||||
permalink: date
|
||||
paginate_path: /page:num
|
||||
|
|
|
@ -42,19 +42,12 @@ your site.
|
|||
In Jekyll v1.0, we introduced absolute permalinks for pages in
|
||||
subdirectories. Starting with v2.0, absolute permalinks are opt-out,
|
||||
meaning Jekyll will default to using absolute permalinks instead of
|
||||
relative permalinks.
|
||||
|
||||
* To use absolute permalinks, set `relative_permalinks: false` in your
|
||||
configuration file.
|
||||
* To continue using relative permalinks, set `relative_permalinks: true` in
|
||||
your configuration file.
|
||||
relative permalinks. Relative permalink backwards-compatibility was removed in v3.0.
|
||||
|
||||
<div class="note warning" id="absolute-permalinks-warning">
|
||||
<h5 markdown="1">Absolute permalinks will be default in v2.0 and on</h5>
|
||||
<h5 markdown="1">Absolute permalinks will be required in v3.0 and on</h5>
|
||||
<p markdown="1">
|
||||
Starting with Jekyll v2.0, `relative_permalinks` will default to `false`,
|
||||
meaning all pages will be built using the absolute permalink behaviour.
|
||||
The switch will still exist until v2.0.
|
||||
Starting with Jekyll v3.0, relative permalinks functionality will be removed and thus unavailable for use.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue