#18441: Fixing blog archives and rsd when on homepage

Work Item: 18441

--HG--
branch : 1.x
rename : src/Orchard.Web/Modules/Orchard.Blogs/Routing/ARCHIVECONSTRAINT.CS => src/Orchard.Web/Modules/Orchard.Blogs/Routing/ArchiveConstraint.CS
rename : src/Orchard.Web/Modules/Orchard.Blogs/Routing/IARCHIVECONSTRAINT.CS => src/Orchard.Web/Modules/Orchard.Blogs/Routing/IArchiveConstraint.CS
rename : src/Orchard.Web/Modules/Orchard.Blogs/Routing/IRSDCONSTRAINT.CS => src/Orchard.Web/Modules/Orchard.Blogs/Routing/IRsdConstraint.CS
rename : src/Orchard.Web/Modules/Orchard.Blogs/Routing/RSDCONSTRAINT.CS => src/Orchard.Web/Modules/Orchard.Blogs/Routing/RsdConstraint.CS
This commit is contained in:
Sebastien Ros
2012-02-17 11:10:34 -08:00
parent ce4d39c8d4
commit 8bff4c8f1a
4 changed files with 20 additions and 3 deletions

View File

@@ -37,6 +37,12 @@ namespace Orchard.Blogs.Routing {
var archiveIndex = path.IndexOf("/archive/", StringComparison.OrdinalIgnoreCase); var archiveIndex = path.IndexOf("/archive/", StringComparison.OrdinalIgnoreCase);
if (archiveIndex == -1) { if (archiveIndex == -1) {
// archive for blog as homepage ?
if(path.StartsWith("archive/", StringComparison.OrdinalIgnoreCase)) {
return String.Empty;
}
return null; return null;
} }
@@ -47,6 +53,12 @@ namespace Orchard.Blogs.Routing {
var archiveIndex = path.IndexOf("/archive/", StringComparison.OrdinalIgnoreCase); var archiveIndex = path.IndexOf("/archive/", StringComparison.OrdinalIgnoreCase);
if (archiveIndex == -1) { if (archiveIndex == -1) {
// archive for blog as homepage ?
if (path.StartsWith("archive/", StringComparison.OrdinalIgnoreCase)) {
return new ArchiveData(path.Substring("archive/".Length));
}
return null; return null;
} }

View File

@@ -30,11 +30,16 @@ namespace Orchard.Blogs.Routing {
} }
public string FindPath(string path) { public string FindPath(string path) {
if (!path.EndsWith("/rsd", StringComparison.OrdinalIgnoreCase)) { if (path.EndsWith("/rsd", StringComparison.OrdinalIgnoreCase)) {
return null; return path.Substring(0, path.Length - "/rsd".Length);
} }
return path.Substring(0, path.Length - "/rsd".Length); // blog is on homepage
if(path.Equals("rsd", StringComparison.OrdinalIgnoreCase)) {
return String.Empty;
}
return null;
} }
} }
} }