Captured Versions

Because the Publish fact captures the title and content that the author wishes to display on the site, the author can make changes without affecting what appears on the site.

var editedPostContent1 = await jinagaClient.Fact(new PostContent(
    post1, "Let me tell you some more.", [postContent1]));

jinagaClient.RenderFacts(editedPostContent1)
%0 eLG0D2gojV+51Ix80JNo2Uh4EQTKvjbZUq5JNrf9K5gSXEqRmi7LBSleOl09F/bWdrlWUgDkalEH847v83U7fA== Jinaga.User publicKey --- FAKE USER --- fRStq94kRaFpm+n+5BCGNRP7e7NOyihLThCOo0vRo+inA0LbPUbVkJsNJwcWCKIVb9lUylMwc7Bt2vfHTbicPg== Blog.Site createdAt 2024-05-18T20:32:02.... fRStq94kRaFpm+n+5BCGNRP7e7NOyihLThCOo0vRo+inA0LbPUbVkJsNJwcWCKIVb9lUylMwc7Bt2vfHTbicPg==->eLG0D2gojV+51Ix80JNo2Uh4EQTKvjbZUq5JNrf9K5gSXEqRmi7LBSleOl09F/bWdrlWUgDkalEH847v83U7fA== creator 8Cl5MsQaiRie2EbqjNUhj5Jf8TjJ8e/0O1+Knfsw3pyIHKTaaJ2okiPxoDtGEztPS3MXQiDMV1G8jCC5G0mvbw== Blog.Post createdAt 2024-05-18T20:32:03.... 8Cl5MsQaiRie2EbqjNUhj5Jf8TjJ8e/0O1+Knfsw3pyIHKTaaJ2okiPxoDtGEztPS3MXQiDMV1G8jCC5G0mvbw==->eLG0D2gojV+51Ix80JNo2Uh4EQTKvjbZUq5JNrf9K5gSXEqRmi7LBSleOl09F/bWdrlWUgDkalEH847v83U7fA== author 8Cl5MsQaiRie2EbqjNUhj5Jf8TjJ8e/0O1+Knfsw3pyIHKTaaJ2okiPxoDtGEztPS3MXQiDMV1G8jCC5G0mvbw==->fRStq94kRaFpm+n+5BCGNRP7e7NOyihLThCOo0vRo+inA0LbPUbVkJsNJwcWCKIVb9lUylMwc7Bt2vfHTbicPg== site petnLBBgNIGTKz+tPUctalOq0LgKZC7zfsehdIYy1mG0tQZZKWACchVY/U5CKfogTLgQr19x5k7AN9DUqKU0GQ== Blog.Post.Content markdown Let me tell you abou... petnLBBgNIGTKz+tPUctalOq0LgKZC7zfsehdIYy1mG0tQZZKWACchVY/U5CKfogTLgQr19x5k7AN9DUqKU0GQ==->8Cl5MsQaiRie2EbqjNUhj5Jf8TjJ8e/0O1+Knfsw3pyIHKTaaJ2okiPxoDtGEztPS3MXQiDMV1G8jCC5G0mvbw== post HiTvQ6xSplJ0J5vnBu8Fng56qj90n8Th8TBTZIIvMHJrJLVYGR4VHX6IC1N/Nsn9gd0ecB6NVF7YX0VPV1pMxg== Blog.Post.Content markdown Let me tell you some... HiTvQ6xSplJ0J5vnBu8Fng56qj90n8Th8TBTZIIvMHJrJLVYGR4VHX6IC1N/Nsn9gd0ecB6NVF7YX0VPV1pMxg==->8Cl5MsQaiRie2EbqjNUhj5Jf8TjJ8e/0O1+Knfsw3pyIHKTaaJ2okiPxoDtGEztPS3MXQiDMV1G8jCC5G0mvbw== post HiTvQ6xSplJ0J5vnBu8Fng56qj90n8Th8TBTZIIvMHJrJLVYGR4VHX6IC1N/Nsn9gd0ecB6NVF7YX0VPV1pMxg==->petnLBBgNIGTKz+tPUctalOq0LgKZC7zfsehdIYy1mG0tQZZKWACchVY/U5CKfogTLgQr19x5k7AN9DUqKU0GQ== prior

The author can see the edits they are making. Their view model selects the current content of a post.

posts = await jinagaClient.Query(postsInSite, site);

postsViewModel = posts.Select(p => new
{
    Title = p.Title.FirstOrDefault() ?? "New post",
    Content = p.Content.FirstOrDefault() ?? ""
});

postsViewModel

However, visitors to the site will still see the published version of the post. Their view model is based on the Publish fact.

publishedPosts = await jinagaClient.Query(publishedPostsInSite, site);

var publishedPostsViewModel = publishedPosts.Select(p => new
{
    Title = p.Title,
    Content = p.Content
});

publishedPostsViewModel

When the author is ready, they can publish the updated version.

var post1Publish1 = await jinagaClient.Fact(new PostPublish(
    post1, postTitle1, editedPostContent1, [post1Publish0]));

jinagaClient.RenderFacts(post1Publish1)
%0 eLG0D2gojV+51Ix80JNo2Uh4EQTKvjbZUq5JNrf9K5gSXEqRmi7LBSleOl09F/bWdrlWUgDkalEH847v83U7fA== Jinaga.User publicKey --- FAKE USER --- fRStq94kRaFpm+n+5BCGNRP7e7NOyihLThCOo0vRo+inA0LbPUbVkJsNJwcWCKIVb9lUylMwc7Bt2vfHTbicPg== Blog.Site createdAt 2024-05-18T20:32:02.... fRStq94kRaFpm+n+5BCGNRP7e7NOyihLThCOo0vRo+inA0LbPUbVkJsNJwcWCKIVb9lUylMwc7Bt2vfHTbicPg==->eLG0D2gojV+51Ix80JNo2Uh4EQTKvjbZUq5JNrf9K5gSXEqRmi7LBSleOl09F/bWdrlWUgDkalEH847v83U7fA== creator 8Cl5MsQaiRie2EbqjNUhj5Jf8TjJ8e/0O1+Knfsw3pyIHKTaaJ2okiPxoDtGEztPS3MXQiDMV1G8jCC5G0mvbw== Blog.Post createdAt 2024-05-18T20:32:03.... 8Cl5MsQaiRie2EbqjNUhj5Jf8TjJ8e/0O1+Knfsw3pyIHKTaaJ2okiPxoDtGEztPS3MXQiDMV1G8jCC5G0mvbw==->eLG0D2gojV+51Ix80JNo2Uh4EQTKvjbZUq5JNrf9K5gSXEqRmi7LBSleOl09F/bWdrlWUgDkalEH847v83U7fA== author 8Cl5MsQaiRie2EbqjNUhj5Jf8TjJ8e/0O1+Knfsw3pyIHKTaaJ2okiPxoDtGEztPS3MXQiDMV1G8jCC5G0mvbw==->fRStq94kRaFpm+n+5BCGNRP7e7NOyihLThCOo0vRo+inA0LbPUbVkJsNJwcWCKIVb9lUylMwc7Bt2vfHTbicPg== site AMe9xpS8GHaCTkyBmnvHESY48H7xtHshMrpi5kjUYaoJZTf9LavJdtFr3DR8pBzC1z3UJtBcxe+eCqd0qqG5Qw== Blog.Post.Title value Interesting Facts AMe9xpS8GHaCTkyBmnvHESY48H7xtHshMrpi5kjUYaoJZTf9LavJdtFr3DR8pBzC1z3UJtBcxe+eCqd0qqG5Qw==->8Cl5MsQaiRie2EbqjNUhj5Jf8TjJ8e/0O1+Knfsw3pyIHKTaaJ2okiPxoDtGEztPS3MXQiDMV1G8jCC5G0mvbw== post petnLBBgNIGTKz+tPUctalOq0LgKZC7zfsehdIYy1mG0tQZZKWACchVY/U5CKfogTLgQr19x5k7AN9DUqKU0GQ== Blog.Post.Content markdown Let me tell you abou... petnLBBgNIGTKz+tPUctalOq0LgKZC7zfsehdIYy1mG0tQZZKWACchVY/U5CKfogTLgQr19x5k7AN9DUqKU0GQ==->8Cl5MsQaiRie2EbqjNUhj5Jf8TjJ8e/0O1+Knfsw3pyIHKTaaJ2okiPxoDtGEztPS3MXQiDMV1G8jCC5G0mvbw== post HiTvQ6xSplJ0J5vnBu8Fng56qj90n8Th8TBTZIIvMHJrJLVYGR4VHX6IC1N/Nsn9gd0ecB6NVF7YX0VPV1pMxg== Blog.Post.Content markdown Let me tell you some... HiTvQ6xSplJ0J5vnBu8Fng56qj90n8Th8TBTZIIvMHJrJLVYGR4VHX6IC1N/Nsn9gd0ecB6NVF7YX0VPV1pMxg==->8Cl5MsQaiRie2EbqjNUhj5Jf8TjJ8e/0O1+Knfsw3pyIHKTaaJ2okiPxoDtGEztPS3MXQiDMV1G8jCC5G0mvbw== post HiTvQ6xSplJ0J5vnBu8Fng56qj90n8Th8TBTZIIvMHJrJLVYGR4VHX6IC1N/Nsn9gd0ecB6NVF7YX0VPV1pMxg==->petnLBBgNIGTKz+tPUctalOq0LgKZC7zfsehdIYy1mG0tQZZKWACchVY/U5CKfogTLgQr19x5k7AN9DUqKU0GQ== prior Q8BZQrwz1UvD1F/SoTzXIKrYp+U1Rb2XCZZarkQjJ4Mvq2CBW/GJxPdgNYJ20kCOCfaaw77Tg4PrSpoK+HO0EQ== Blog.Post.Publish Q8BZQrwz1UvD1F/SoTzXIKrYp+U1Rb2XCZZarkQjJ4Mvq2CBW/GJxPdgNYJ20kCOCfaaw77Tg4PrSpoK+HO0EQ==->8Cl5MsQaiRie2EbqjNUhj5Jf8TjJ8e/0O1+Knfsw3pyIHKT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hl3Ks1ZDQxxY4WorNkOCtKMwAX9cLad7J5ZsMp/LQBQDHOpobcunEaBRHGewnfB2aw==->Q8BZQrwz1UvD1F/SoTzXIKrYp+U1Rb2XCZZarkQjJ4Mvq2CBW/GJxPdgNYJ20kCOCfaaw77Tg4PrSpoK+HO0EQ== prior

Now visitors to the site will see the updated content.

publishedPosts = await jinagaClient.Query(publishedPostsInSite, site);

publishedPostsViewModel = publishedPosts.Select(p => new
{
    Title = p.Title,
    Content = p.Content
});

publishedPostsViewModel

Continue With

Additional Workflow Steps

Jinaga is a product of Jinaga LLC.

Michael L Perry, President