mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 11:44:41 +08:00
#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:
@@ -37,6 +37,12 @@ namespace Orchard.Blogs.Routing {
|
||||
var archiveIndex = path.IndexOf("/archive/", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (archiveIndex == -1) {
|
||||
|
||||
// archive for blog as homepage ?
|
||||
if(path.StartsWith("archive/", StringComparison.OrdinalIgnoreCase)) {
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -47,6 +53,12 @@ namespace Orchard.Blogs.Routing {
|
||||
var archiveIndex = path.IndexOf("/archive/", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (archiveIndex == -1) {
|
||||
|
||||
// archive for blog as homepage ?
|
||||
if (path.StartsWith("archive/", StringComparison.OrdinalIgnoreCase)) {
|
||||
return new ArchiveData(path.Substring("archive/".Length));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -30,11 +30,16 @@ namespace Orchard.Blogs.Routing {
|
||||
}
|
||||
|
||||
public string FindPath(string path) {
|
||||
if (!path.EndsWith("/rsd", StringComparison.OrdinalIgnoreCase)) {
|
||||
return null;
|
||||
if (path.EndsWith("/rsd", StringComparison.OrdinalIgnoreCase)) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user