&l
ref
attribute// reference to the exact version
hm://d/otorBG9gLJZMi4D2fB9NtZ?v=bafy2bzaceaz5lsnvfgrwqzhtdu4xmb4uhfeihp5hzyzc62jzyrce6akalaxmq.bafy2bzacebctassmwajzfcedl5kyqpraoyfnejsyahpqh7zq7oqsdkzkm4i6q
// reference to the latest version in the current node
hm://d/otorBG9gLJZMi4D2fB9NtZ
{
type: 'embed',
id: '12345',
ref: 'hm://d/otorBG9gLJZMi4D2fB9NtZ?v=bafy2bzaceaz5lsnvfgrwqzhtdu4xmb4uhfeihp5hzyzc62jzyrce6akalaxmq.bafy2bzacebctassmwajzfcedl5kyqpraoyfnejsyahpqh7zq7oqsdkzkm4i6q',
text: '',
attributes: {
view: 'card',
showLatest: 'false',
sourceRef:
'hm://d/otorBG9gLJZMi4D2fB9NtZ?v=bafy2bzaceaz5lsnvfgrwqzhtdu4xmb4uhfeihp5hzyzc62jzyrce6akalaxmq.bafy2bzacebctassmwajzfcedl5kyqpraoyfnejsyahpqh7zq7oqsdkzkm4i6q',
childrenType: 'div',
},
}
sourceRef
and ref
can have redundant data (documentID). We can avoid this problem by Storing sourceVersion
instead of sourceRef
.{
type: 'embed',
id: '12345',
ref: 'hm://d/otorBG9gLJZMi4D2fB9NtZ?v=bafy2bzaceaz5lsnvfgrwqzhtdu4xmb4uhfeihp5hzyzc62jzyrce6akalaxmq.bafy2bzacebctassmwajzfcedl5kyqpraoyfnejsyahpqh7zq7oqsdkzkm4i6q',
text: '',
attributes: {
view: 'card',
showLatest: 'false',
sourceVersion: 'bafy2bzaceaz5lsnvfgrwqzhtdu4xmb4uhfeihp5hzyzc62jzyrce6akalaxm',
childrenType: 'div',
},
}
ref
attribute is important because this is the way we make sure the backend consider all the changes of a document as reference materials when pushing content to sites/gateways.showLatest
is true
, we will render the latest version the current client have available for the defined reference. While this was the author's intent, we believe we need to be explicit with the reader by exposing the fact that what is being displayed is the latest version.sourceVersion
attribute is significant as it allows us to determine whether there is a discrepancy between the current version and the one referenced by the author at the time of publication. If these values differ, we can display a visual cue, such as a banner, to indicate that the version being viewed is more recent than the original.sourceURL
which was a attribute to store in the block metadata will not be included in this project.