Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

allow Wikidata identifiers in /things/ URLs

  • Loading branch information...
commit a3f5fca110edcb55b3fea9abd48caeedb95ec347 1 parent a61236c
@njh authored
Showing with 6 additions and 2 deletions.
  1. +5 −1 dbpedialite.rb
  2. +1 −1  views/index.erb
View
6 dbpedialite.rb
@@ -189,7 +189,11 @@ def format_iso8061(datetime)
redirect_from_title(title)
end
- get %r{^/wikidata/Q(\d+)$} do |id|
+ get %r{^/wikidata/[qQ](\d+)$} do |id|
+ redirect_from_wikidata(id)
+ end
+
+ get %r{^/things/[Qq](\d+)$} do |id|
redirect_from_wikidata(id)
end
View
2  views/index.erb
@@ -34,7 +34,7 @@
<li><a href="/titles/Ermine">Ermine</a></li>
<li><a href="/titles/Ceres,_Fife">Ceres, Fife</a></li>
<li><a href="/titles/Berlin">Berlin</a></li>
- <li><a href="/wikidata/Q9531">British Broadcasting Corporation</a></li>
+ <li><a href="/things/Q9531">British Broadcasting Corporation</a></li>
</ul>
<h2>Example Categories</h2>
Please sign in to comment.
Something went wrong with that request. Please try again.