From eb0f82524469280f521894544c49e5b1180d5b9a Mon Sep 17 00:00:00 2001 From: Avinal Kumar Date: Fri, 16 Sep 2022 18:49:40 +0530 Subject: [PATCH] Fix blog posting Signed-off-by: Avinal Kumar --- content/posts/posts.json | 4 ++-- elm.json | 1 - src/Blog.elm | 19 ++++++++----------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/content/posts/posts.json b/content/posts/posts.json index 8107660..4d7c04a 100644 --- a/content/posts/posts.json +++ b/content/posts/posts.json @@ -3,7 +3,7 @@ "title": "The Big Red Ants", "date": "2012-02-27 22:47", "category": "article", - "description": "The Big Red Ants", + "description": "As I observed them making and reparing their nests, I concluded that they are laborious and intellectual. They create their nests bybinding two or more leaves (maybe up to 500) together. They stich the leaves using a stinky white substance either excreted by themselves or from trees.", "slug": "big-red-ants" }, { @@ -31,7 +31,7 @@ "title": "Google Summer of Code 2021", "date": "2021-08-19 23:07", "category": "development", - "description": "This is the final report of my Google Summer of Code 2021 at The FOSSology Project.", + "description": "This is the final report of my Google Summer of Code 2021 at The FOSSology Project. One of the major improvements over the previous build system is faster build times. CMake generates parallel build-enabled configurations for all generators.", "slug": "final-evaulation" }, { diff --git a/elm.json b/elm.json index 47751ba..20a0f48 100644 --- a/elm.json +++ b/elm.json @@ -7,7 +7,6 @@ "dependencies": { "direct": { "MaybeJustJames/yaml": "2.1.2", - "NoRedInk/elm-json-decode-pipeline": "1.0.1", "elm/browser": "1.0.2", "elm/core": "1.0.5", "elm/html": "1.0.0", diff --git a/src/Blog.elm b/src/Blog.elm index 751355f..af697fe 100644 --- a/src/Blog.elm +++ b/src/Blog.elm @@ -5,7 +5,6 @@ import Html exposing (..) import Html.Attributes exposing (class, datetime, href, id, src, style) import Http exposing (Error(..)) import Json.Decode as Json -import Json.Decode.Pipeline exposing (required) import Url exposing (Protocol(..)) import Yaml.Decode as Yaml @@ -166,20 +165,18 @@ viewBlogListItem meta = , div [ class "foo-term-story" ] [ div [] [ span [] - [ i [ class "fa-regular fa-clock" ] [] + [ i [ class "fa-regular fa-clock" ] [ text " " ] , time [ datetime meta.date ] [ text meta.date ] , text " in " - , i [ class "fa-regular fa-folder-open" ] [] + , i [ class "fa-regular fa-folder-open" ] [ text " " ] , a [ href ("/posts/" ++ meta.category) ] [ text meta.category ] ] ] - , br [] [] , h2 [] [ a [ href ("/posts/" ++ meta.category ++ "/" ++ meta.slug) ] [ text meta.title ] ] - , br [] [] , p [] [ text meta.description ] ] ] @@ -303,12 +300,12 @@ getPostLists url = jsonMetaDecoder : Json.Decoder JsonMeta jsonMetaDecoder = - required "title" Json.string <| - required "date" Json.string <| - required "description" Json.string <| - required "category" Json.string <| - required "slug" Json.string <| - Json.succeed JsonMeta + Json.map5 JsonMeta + (Json.field "title" Json.string) + (Json.field "date" Json.string) + (Json.field "description" Json.string) + (Json.field "category" Json.string) + (Json.field "slug" Json.string) getMarkdown : String -> Cmd Msg