mirror of
https://github.com/danog/sass-site.git
synced 2024-11-27 04:24:50 +01:00
Link to URLs without ".html" at the end
This commit is contained in:
parent
837a475ddd
commit
e704afbd74
@ -51,6 +51,10 @@ module SassHelpers
|
||||
pages.flatten
|
||||
end
|
||||
|
||||
def without_html(page)
|
||||
url_for(page).sub(/\.html$/, '')
|
||||
end
|
||||
|
||||
def documentation_toc
|
||||
_toc_level(nil, data.documentation.toc)
|
||||
end
|
||||
|
@ -6,12 +6,12 @@ per_page: 5
|
||||
|
||||
- if paginate && num_pages > 1
|
||||
%p Page #{page_number} of #{num_pages}
|
||||
%p= link_to 'Previous page', prev_page if prev_page
|
||||
%p= link_to 'Previous page', without_html(prev_page) if prev_page
|
||||
|
||||
- page_articles.each_with_index do |article, i|
|
||||
%h2= link_to article.title, article
|
||||
%h2= link_to article.title, without_html(article)
|
||||
= partial 'layouts/components/attribution', locals: {page: article}
|
||||
= article.summary
|
||||
|
||||
- if paginate
|
||||
%p= link_to 'Next page', next_page if next_page
|
||||
%p= link_to 'Next page', without_html(next_page) if next_page
|
||||
|
@ -9,7 +9,7 @@ xml.feed xmlns: "http://www.w3.org/2005/Atom" do
|
||||
|
||||
blog.articles[0..5].each do |article|
|
||||
xml.entry do
|
||||
url = config[:host] + article.url
|
||||
url = config[:host] + without_html(article.url)
|
||||
xml.title article.title
|
||||
xml.link href: url, rel: "alternate"
|
||||
xml.id url
|
||||
|
Loading…
Reference in New Issue
Block a user