Skip to content

Commit 0c14dff

Browse files
committed
implement #107
1 parent bcc7760 commit 0c14dff

File tree

14 files changed

+72
-19
lines changed

14 files changed

+72
-19
lines changed

Sources/Swiftinit/Swiftinit.Root.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ extension Swiftinit
1010
case asset
1111
case blog
1212
case docs
13+
case docc
1314
case hist
1415
case login
1516
case lunr
@@ -49,6 +50,7 @@ extension Swiftinit.Root:Identifiable
4950
case .asset: "asset"
5051
case .blog: "articles"
5152
case .docs: "docs"
53+
case .docc: "docc"
5254
case .hist: "hist"
5355
case .login: "login"
5456
case .lunr: "lunr"

Sources/SwiftinitPages/Surfaces/Swiftinit.VertexLayer.swift

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,41 @@ protocol _SwiftinitVertexLayer
1515
static
1616
var docs:Swiftinit.Root { get }
1717

18+
static
19+
var docc:Swiftinit.Root { get }
20+
1821
static
1922
var hist:Swiftinit.Root { get }
2023
}
2124
extension Swiftinit.VertexLayer
2225
{
23-
static
24-
subscript(volume:Unidoc.VolumeMetadata) -> URI
26+
private static
27+
subscript(volume:Unidoc.VolumeSelector, cdecl cdecl:Bool) -> URI
2528
{
26-
let volume:Unidoc.VolumeSelector = volume.selector
27-
28-
if case nil = volume.version
29+
if case _? = volume.version
30+
{
31+
Self.hist / "\(volume)"
32+
}
33+
else if cdecl
2934
{
30-
return Self.docs / "\(volume)"
35+
Self.docc / "\(volume)"
3136
}
3237
else
3338
{
34-
return Self.hist / "\(volume)"
39+
Self.docs / "\(volume)"
3540
}
3641
}
3742

43+
static
44+
subscript(volume:Unidoc.VolumeMetadata) -> URI
45+
{
46+
Self[volume.selector, cdecl: false]
47+
}
48+
3849
static
3950
subscript(volume:Unidoc.VolumeMetadata, route:Unidoc.Route) -> URI
4051
{
41-
var uri:URI = Self[volume]
52+
var uri:URI = Self[volume.selector, cdecl: route.cdecl]
4253

4354
uri.path += route.stem
4455
uri["hash"] = route.hash?.description

Sources/SwiftinitPages/Surfaces/Vertices/Swiftinit.Blog.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ extension Swiftinit.Blog:Swiftinit.VertexLayer
99
static
1010
var docs:Swiftinit.Root { .blog }
1111

12+
static
13+
var docc:Swiftinit.Root { .blog }
14+
1215
static
1316
var hist:Swiftinit.Root { .blog }
1417
}

Sources/SwiftinitPages/Surfaces/Vertices/Swiftinit.Docs.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ extension Swiftinit.Docs:Swiftinit.VertexLayer
99
static
1010
var docs:Swiftinit.Root { .docs }
1111

12+
static
13+
var docc:Swiftinit.Root { .docc }
14+
1215
static
1316
var hist:Swiftinit.Root { .hist }
1417
}

Sources/SwiftinitPages/Surfaces/Vertices/Swiftinit.Stats.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ extension Swiftinit.Stats:Swiftinit.VertexLayer
99
static
1010
var docs:Swiftinit.Root { .stats }
1111

12+
static
13+
var docc:Swiftinit.Root { .stats }
14+
1215
static
1316
var hist:Swiftinit.Root { .stats }
1417
}

Sources/SwiftinitServer/Swiftinit.IntegralRequest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ extension Swiftinit.IntegralRequest
184184
endpoint = .get(articles: trunk,
185185
with: .init(uri.query?.parameters, tag: tag))
186186

187-
case Swiftinit.Root.docs.id, Swiftinit.Root.hist.id:
187+
case Swiftinit.Root.docs.id, Swiftinit.Root.docc.id, Swiftinit.Root.hist.id:
188188
endpoint = .get(docs: trunk, path,
189189
with: .init(uri.query?.parameters, tag: tag))
190190

Sources/UnidocRecords/Volumes/Trees/Unidoc.Noun.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ extension Unidoc
2323
extension Unidoc.Noun
2424
{
2525
@inlinable public
26-
var route:Unidoc.Route { .init(shoot: shoot, swift: type.swift) }
26+
var route:Unidoc.Route { .init(shoot: shoot, cdecl: type.cdecl) }
2727
}

Sources/UnidocRecords/Volumes/Trees/Unidoc.NounTable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extension Unidoc.NounTable
3333
}
3434
extension Unidoc.NounTable
3535
{
36-
@usableFromInline static
36+
@inlinable internal static
3737
var version:BSON.BinarySubtype { .custom(code: 0x80) }
3838
}
3939
extension Unidoc.NounTable:BSONEncodable

Sources/UnidocRecords/Volumes/Trees/Unidoc.NounType.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ extension Unidoc
1313
extension Unidoc.NounType
1414
{
1515
@inlinable internal
16-
var swift:Bool
16+
var cdecl:Bool
1717
{
1818
switch self
1919
{
20-
case .stem(_, let flags?): flags.language == .swift
20+
case .stem(_, let flags?): flags.language == .c
2121
case .stem(_, nil): false
2222
case .text: false
2323
}

Sources/UnidocRecords/Volumes/Vertices/Unidoc.DeclVertex.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ extension Unidoc.DeclVertex:Unidoc.PrincipalVertex
102102
@inlinable public
103103
var route:Unidoc.Route
104104
{
105-
.init(shoot: self.shoot, swift: self.flags.language == .swift)
105+
.init(shoot: self.shoot, cdecl: self.flags.language == .c)
106106
}
107107

108108
@inlinable public

0 commit comments

Comments
 (0)