mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-12-24 08:28:50 -05:00
Added 404, moved archives from /blog/archives to /archives, added migration in update_source rake task. Closes #375
This commit is contained in:
parent
a49651fdfd
commit
741107291b
8
.themes/classic/source/404.markdown
Normal file
8
.themes/classic/source/404.markdown
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
layout: page
|
||||
title: Page Not Found
|
||||
---
|
||||
|
||||
Oops, I couldn’t find that page! Sorry about that.
|
||||
|
||||
Maybe try the search box (top right), or look through the [archives](/archives)?
|
@ -1,4 +1,4 @@
|
||||
<ul class="main-navigation">
|
||||
<li><a href="{{ root_url }}/">Blog</a></li>
|
||||
<li><a href="{{ root_url }}/blog/archives">Archives</a></li>
|
||||
<li><a href="{{ root_url }}/archives">Archives</a></li>
|
||||
</ul>
|
||||
|
@ -13,7 +13,7 @@ layout: default
|
||||
{% if paginator.next_page %}
|
||||
<a class="prev" href="{{paginator.next_page}}">← Older</a>
|
||||
{% endif %}
|
||||
<a href="/blog/archives">Blog Archives</a>
|
||||
<a href="/archives">Blog Archives</a>
|
||||
{% if paginator.previous_page %}
|
||||
<a class="next" href="{{paginator.previous_page}}">Newer →</a>
|
||||
{% endif %}
|
||||
|
11
Rakefile
11
Rakefile
@ -200,9 +200,14 @@ task :update_source, :theme do |t, args|
|
||||
cp "#{source_dir}.old/favicon.png", source_dir
|
||||
mv "#{source_dir}/index.html", "#{blog_index_dir}", :force=>true if blog_index_dir != source_dir
|
||||
cp "#{source_dir}.old/index.html", source_dir if blog_index_dir != source_dir && File.exists?("#{source_dir}.old/index.html")
|
||||
if File.exists?("#{source_dir}/archives/index.html")
|
||||
rm "#{source_dir}/archives/index.html"
|
||||
mv "#{source_dir}/blog/archives/index.html", "#{source_dir}/archives/index.html"
|
||||
if File.exists?("#{source_dir}/blog/archives/index.html")
|
||||
puts "## Moving blog/archives to /archives (standard location as of 2.1) ##"
|
||||
file = "#{source_dir}/_includes/custom/navigation.html"
|
||||
navigation = IO.read(file)
|
||||
navigation = navigation.gsub(/(.*)\/blog(\/archives)(.*$)/m, '\1\2\3')
|
||||
File.open(file, 'w') do |f|
|
||||
f.write navigation
|
||||
end
|
||||
rm_r "#{source_dir}/blog/archives"
|
||||
rm_r "#{source_dir}/blog" if Dir.entries("#{source_dir}/blog").join == "..."
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user