You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/Saga/Item.swift
+14-17Lines changed: 14 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -10,22 +10,24 @@ public struct EmptyMetadata: Metadata {
10
10
11
11
/// A type-erased version of ``Item``.
12
12
publicprotocolAnyItem:AnyObject{
13
+
varabsoluteSource:Path{get}
13
14
varrelativeSource:Path{get}
14
15
varfilenameWithoutExtension:String{get}
15
16
varrelativeDestination:Path{getset}
16
17
vartitle:String{getset}
17
-
varrawContent:String{getset}
18
18
varbody:String{getset}
19
-
varpublished:Date{getset}
20
-
varcreated:Date{getset}
21
-
varlastModified:Date{getset}
19
+
vardate:Date{getset}
20
+
varlastModified:Date{get}
22
21
varurl:String{get}
23
22
}
24
23
25
24
/// A model reprenting an item.
26
25
///
27
26
/// An item can be any text file (like a Markdown or RestructedText file). ``Reader``s will turn the file into an ``Item``, and ``Writer``s will turn the ``Item`` into a `String` (for example HTML or RSS) to be written to disk.
28
27
publicclassItem<M:Metadata>:AnyItem{
28
+
/// The absolute path of the file
29
+
publicletabsoluteSource:Path
30
+
29
31
/// The path of the file, relative to the site's `input`.
30
32
publicletrelativeSource:Path
31
33
@@ -35,32 +37,27 @@ public class Item<M: Metadata>: AnyItem {
35
37
/// The title of the item.
36
38
publicvartitle:String
37
39
38
-
/// The raw contents of the file, not parsed in any way.
39
-
publicvarrawContent:String
40
-
41
40
/// The body of the file, without the metadata header, and without the first title.
42
41
publicvarbody:String
43
42
44
-
/// The published date of the item.
45
-
publicvarpublished:Date
46
-
47
-
/// The creation date of the item.
48
-
publicvarcreated:Date
43
+
/// The date of the item, defaults to the creation date.
44
+
/// Pleaae note that the creation date value can be inconsistent when cloning or pulling from git, see https://github.com/loopwerk/Saga/issues/21.
45
+
publicvardate:Date
49
46
50
47
/// The last modified date of the item.
51
-
publicvarlastModified:Date
48
+
/// Pleaae note that this value can be inconsistent when cloning or pulling from git, see https://github.com/loopwerk/Saga/issues/21.
49
+
publicletlastModified:Date
52
50
53
51
/// The parsed metadata. ``Metadata`` can be any `Codable` object.
0 commit comments