mirror of
https://github.com/avinal/avinal.github.io.git
synced 2026-07-04 07:40:09 +05:30
add date parser and refactor
- remove unused variables, methods - move footer into a separate folder - add date parser - add datetime Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
@@ -6,3 +6,4 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
*.pem
|
*.pem
|
||||||
/static/main.css
|
/static/main.css
|
||||||
|
/temp
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
module Components.Footer exposing (..)
|
||||||
|
|
||||||
|
import Html exposing (Html)
|
||||||
|
import Html.Attributes exposing (class, href, src)
|
||||||
|
import Utils.Constants exposing (IconLink, Link, footerLinks)
|
||||||
|
|
||||||
|
|
||||||
|
singleLink : Link -> Html msg
|
||||||
|
singleLink link =
|
||||||
|
Html.li []
|
||||||
|
[ Html.a
|
||||||
|
[ href link.url
|
||||||
|
, class "mr-4 md:mr-6 underline decoration-cyan-500 hover:decoration-pink-500"
|
||||||
|
]
|
||||||
|
[ Html.text link.text ]
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
iconedLink : IconLink -> Html msg
|
||||||
|
iconedLink iconLink =
|
||||||
|
Html.a [ href iconLink.url, class "hover:text-pink-500 inline-flex text-2xl p-3 no-underline" ]
|
||||||
|
[ Html.i [ class iconLink.icon ] []
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
footerLinksToSide : Html msg
|
||||||
|
footerLinksToSide =
|
||||||
|
Html.div [ class "fixed bottom-0 left-0 bg-neutral-900 z-20 p-4 w-full md:flex md:items-center md:justify-between md:p-4" ]
|
||||||
|
[ Html.ul [ class "flex flex-wrap items-center mt-3 text-xl sm:mt-0 text-gray-400" ]
|
||||||
|
(List.map singleLink <|
|
||||||
|
{ text = "Home", url = "/" }
|
||||||
|
:: footerLinks
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
iconLinkToCenter : Html msg
|
||||||
|
iconLinkToCenter =
|
||||||
|
Html.div [ class "flex justify-center flex-wrap" ] (List.map iconedLink Utils.Constants.iconLinks)
|
||||||
|
|
||||||
|
|
||||||
|
avatarAndLinks : Html msg
|
||||||
|
avatarAndLinks =
|
||||||
|
Html.div []
|
||||||
|
[ Html.div [ class "flex flex-col md:space-y-0 md:space-x-6 md:flex-row border-t border-neutral-700" ]
|
||||||
|
[ Html.img
|
||||||
|
[ class "self-center flex-shrink-0 w-24 h-24 border rounded-full md:justify-self-start"
|
||||||
|
, src "https://github.com/avinal.png"
|
||||||
|
]
|
||||||
|
[]
|
||||||
|
, Html.div [ class "flex flex-col self-center" ]
|
||||||
|
[ Html.h4 [ class "text-xl font-semibold sm:justify-self-start" ] [ Html.text "Avinal Kumar" ]
|
||||||
|
, Html.p [ class "text-gray-400" ]
|
||||||
|
[ Html.text "I am a Associate Software Engineer at Red Hat and I work for Hybrid Cloud Engineering. I contribute to Open Source projects and write blogs in tech and literature."
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
, Html.div [ class "flex justify-center align-center text-neutral-700 text-xl" ] (List.map iconedLink Utils.Constants.iconLinks)
|
||||||
|
]
|
||||||
+7
-24
@@ -1,8 +1,9 @@
|
|||||||
module Layouts.Blog exposing (Model, Msg, Settings, layout)
|
module Layouts.Blog exposing (Model, Msg, Settings, layout)
|
||||||
|
|
||||||
|
import Components.Footer exposing (footerLinksToSide)
|
||||||
import Effect exposing (Effect)
|
import Effect exposing (Effect)
|
||||||
import Html exposing (Html)
|
import Html
|
||||||
import Html.Attributes exposing (class, href)
|
import Html.Attributes exposing (class)
|
||||||
import Layout exposing (Layout)
|
import Layout exposing (Layout)
|
||||||
import Route exposing (Route)
|
import Route exposing (Route)
|
||||||
import Shared
|
import Shared
|
||||||
@@ -15,7 +16,7 @@ type alias Settings =
|
|||||||
|
|
||||||
|
|
||||||
layout : Settings -> Shared.Model -> Route () -> Layout Model Msg mainMsg
|
layout : Settings -> Shared.Model -> Route () -> Layout Model Msg mainMsg
|
||||||
layout settings shared route =
|
layout settings _ _ =
|
||||||
Layout.new
|
Layout.new
|
||||||
{ init = init settings
|
{ init = init settings
|
||||||
, update = update
|
, update = update
|
||||||
@@ -33,7 +34,7 @@ type alias Model =
|
|||||||
|
|
||||||
|
|
||||||
init : Settings -> () -> ( Model, Effect Msg )
|
init : Settings -> () -> ( Model, Effect Msg )
|
||||||
init settings _ =
|
init _ _ =
|
||||||
( {}
|
( {}
|
||||||
, Effect.none
|
, Effect.none
|
||||||
)
|
)
|
||||||
@@ -55,7 +56,7 @@ update msg model =
|
|||||||
|
|
||||||
|
|
||||||
subscriptions : Model -> Sub Msg
|
subscriptions : Model -> Sub Msg
|
||||||
subscriptions model =
|
subscriptions _ =
|
||||||
Sub.none
|
Sub.none
|
||||||
|
|
||||||
|
|
||||||
@@ -72,30 +73,12 @@ view : { fromMsg : Msg -> mainMsg, content : View mainMsg, model : Model } -> Vi
|
|||||||
view { fromMsg, model, content } =
|
view { fromMsg, model, content } =
|
||||||
{ title = content.title
|
{ title = content.title
|
||||||
, body =
|
, body =
|
||||||
let
|
|
||||||
footerLinkToLeft : Link -> Html msg
|
|
||||||
footerLinkToLeft link =
|
|
||||||
Html.li []
|
|
||||||
[ Html.a
|
|
||||||
[ href link.url
|
|
||||||
, class "mr-4 md:mr-6 underline decoration-cyan-500 hover:decoration-pink-500"
|
|
||||||
]
|
|
||||||
[ Html.text link.text ]
|
|
||||||
]
|
|
||||||
in
|
|
||||||
[ Html.div [ class "min-h-screen py-4 flex flex-col justify-center relative overflow-hidden " ]
|
[ Html.div [ class "min-h-screen py-4 flex flex-col justify-center relative overflow-hidden " ]
|
||||||
[ Html.div [ class "relative w-full py-4 bg-neutral md:max-w-3xl md:mx-auto lg:max-w-4xl lg:pb-28" ]
|
[ Html.div [ class "relative w-full py-4 bg-neutral md:max-w-3xl md:mx-auto lg:max-w-4xl lg:pb-28" ]
|
||||||
[ Html.article [ class blogTheme ]
|
[ Html.article [ class blogTheme ]
|
||||||
content.body
|
content.body
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
, Html.div [ class "fixed bottom-0 left-0 bg-neutral-900 z-20 p-4 w-full md:flex md:items-center md:justify-between md:p-4" ]
|
, footerLinksToSide
|
||||||
[ Html.ul
|
|
||||||
[ class "flex flex-wrap items-center mt-3 text-xl text-neutral-500 sm:mt-0" ]
|
|
||||||
(List.map footerLinkToLeft <|
|
|
||||||
{ text = "Home", url = "/" }
|
|
||||||
:: Utils.Constants.footerLinks
|
|
||||||
)
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-10
@@ -1,5 +1,6 @@
|
|||||||
module Layouts.Home exposing (Model, Msg, Settings, layout)
|
module Layouts.Home exposing (Model, Msg, Settings, layout)
|
||||||
|
|
||||||
|
import Components.Footer exposing (iconLinkToCenter)
|
||||||
import Effect exposing (Effect)
|
import Effect exposing (Effect)
|
||||||
import Html exposing (Html)
|
import Html exposing (Html)
|
||||||
import Html.Attributes exposing (class, href)
|
import Html.Attributes exposing (class, href)
|
||||||
@@ -15,7 +16,7 @@ type alias Settings =
|
|||||||
|
|
||||||
|
|
||||||
layout : Settings -> Shared.Model -> Route () -> Layout Model Msg mainMsg
|
layout : Settings -> Shared.Model -> Route () -> Layout Model Msg mainMsg
|
||||||
layout settings shared route =
|
layout _ _ _ =
|
||||||
Layout.new
|
Layout.new
|
||||||
{ init = init
|
{ init = init
|
||||||
, update = update
|
, update = update
|
||||||
@@ -57,7 +58,7 @@ update msg model =
|
|||||||
|
|
||||||
|
|
||||||
subscriptions : Model -> Sub Msg
|
subscriptions : Model -> Sub Msg
|
||||||
subscriptions model =
|
subscriptions _ =
|
||||||
Sub.none
|
Sub.none
|
||||||
|
|
||||||
|
|
||||||
@@ -75,18 +76,12 @@ view { fromMsg, model, content } =
|
|||||||
, class "underline decoration-cyan-500 hover:decoration-pink-500 inline-flex text-xl p-3"
|
, class "underline decoration-cyan-500 hover:decoration-pink-500 inline-flex text-xl p-3"
|
||||||
]
|
]
|
||||||
[ Html.text link.text ]
|
[ Html.text link.text ]
|
||||||
|
|
||||||
iconLinkToCenter : IconLink -> Html msg
|
|
||||||
iconLinkToCenter iconLink =
|
|
||||||
Html.a [ href iconLink.url, class " hover:text-pink-500 inline-flex text-2xl p-3" ]
|
|
||||||
[ Html.i [ class iconLink.icon ] [] ]
|
|
||||||
in
|
in
|
||||||
{ title = content.title
|
{ title = content.title
|
||||||
, body =
|
, body =
|
||||||
[ Html.section [ class "flex items-center justify-center flex-col h-screen text-neutral-400" ]
|
[ Html.section [ class "flex items-center justify-center flex-col h-screen text-gray-400" ]
|
||||||
[ Html.header [ class "object-cover object-center p-8" ] content.body
|
[ Html.header [ class "object-cover object-center p-8" ] content.body
|
||||||
, Html.div [ class "flex justify-center flex-wrap" ]
|
, iconLinkToCenter
|
||||||
(List.map iconLinkToCenter Utils.Constants.iconLinks)
|
|
||||||
, Html.div [ class "text-center text-xl p-2" ] [ Html.text "I'm Avinal and I work at Red Hat as an Associate Software Engineer for Hybrid Cloud Engineering." ]
|
, Html.div [ class "text-center text-xl p-2" ] [ Html.text "I'm Avinal and I work at Red Hat as an Associate Software Engineer for Hybrid Cloud Engineering." ]
|
||||||
, Html.footer [ class "flex justify-center flex-wrap" ]
|
, Html.footer [ class "flex justify-center flex-wrap" ]
|
||||||
(List.map footerLinkToCenter Utils.Constants.footerLinks)
|
(List.map footerLinkToCenter Utils.Constants.footerLinks)
|
||||||
|
|||||||
+2
-2
@@ -17,7 +17,7 @@ import View exposing (View)
|
|||||||
|
|
||||||
|
|
||||||
page : Shared.Model -> Route () -> Page Model Msg
|
page : Shared.Model -> Route () -> Page Model Msg
|
||||||
page model route =
|
page _ _ =
|
||||||
Page.new
|
Page.new
|
||||||
{ init = init
|
{ init = init
|
||||||
, update = update
|
, update = update
|
||||||
@@ -32,7 +32,7 @@ page model route =
|
|||||||
|
|
||||||
|
|
||||||
layout : Model -> Layouts.Layout
|
layout : Model -> Layouts.Layout
|
||||||
layout model =
|
layout _ =
|
||||||
Layouts.Home
|
Layouts.Home
|
||||||
{ home = {}
|
{ home = {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
module Pages.Meet exposing (page)
|
||||||
|
|
||||||
|
import Components.Footer exposing (footerLinksToSide)
|
||||||
|
import Html
|
||||||
|
import View exposing (View)
|
||||||
|
|
||||||
|
|
||||||
|
page : View msg
|
||||||
|
page =
|
||||||
|
{ title = "Schedule a meet with me"
|
||||||
|
, body = [ footerLinksToSide, Html.node "calcom" [] [] ]
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
module Pages.Pages.AboutMe exposing (page)
|
module Pages.Pages.AboutMe exposing (page)
|
||||||
|
|
||||||
import Html exposing (Html)
|
|
||||||
import View exposing (View)
|
import View exposing (View)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,13 @@ module Pages.Pages.Projects exposing (Model, Msg, page)
|
|||||||
|
|
||||||
import Effect exposing (Effect)
|
import Effect exposing (Effect)
|
||||||
import Route exposing (Route)
|
import Route exposing (Route)
|
||||||
import Html
|
|
||||||
import Page exposing (Page)
|
import Page exposing (Page)
|
||||||
import Shared
|
import Shared
|
||||||
import View exposing (View)
|
import View exposing (View)
|
||||||
|
|
||||||
|
|
||||||
page : Shared.Model -> Route () -> Page Model Msg
|
page : Shared.Model -> Route () -> Page Model Msg
|
||||||
page shared route =
|
page _ _ =
|
||||||
Page.new
|
Page.new
|
||||||
{ init = init
|
{ init = init
|
||||||
, update = update
|
, update = update
|
||||||
@@ -55,7 +54,7 @@ update msg model =
|
|||||||
|
|
||||||
|
|
||||||
subscriptions : Model -> Sub Msg
|
subscriptions : Model -> Sub Msg
|
||||||
subscriptions model =
|
subscriptions _ =
|
||||||
Sub.none
|
Sub.none
|
||||||
|
|
||||||
|
|
||||||
@@ -64,5 +63,5 @@ subscriptions model =
|
|||||||
|
|
||||||
|
|
||||||
view : Model -> View Msg
|
view : Model -> View Msg
|
||||||
view model =
|
view _ =
|
||||||
View.fromString "Pages.Pages.Projects"
|
View.fromString "Pages.Pages.Projects"
|
||||||
|
|||||||
+7
-23
@@ -1,8 +1,9 @@
|
|||||||
module Pages.Posts exposing (Model, Msg, page)
|
module Pages.Posts exposing (Model, Msg, page)
|
||||||
|
|
||||||
|
import Components.Footer exposing (footerLinksToSide)
|
||||||
import Effect exposing (Effect)
|
import Effect exposing (Effect)
|
||||||
import Html exposing (Html)
|
import Html exposing (Html)
|
||||||
import Html.Attributes exposing (class, href, src, target)
|
import Html.Attributes exposing (class, datetime, href, src, target)
|
||||||
import Http
|
import Http
|
||||||
import Json.Decode as Json
|
import Json.Decode as Json
|
||||||
import Page exposing (Page)
|
import Page exposing (Page)
|
||||||
@@ -15,7 +16,7 @@ import View exposing (View)
|
|||||||
|
|
||||||
|
|
||||||
page : Shared.Model -> Route () -> Page Model Msg
|
page : Shared.Model -> Route () -> Page Model Msg
|
||||||
page shared route =
|
page _ _ =
|
||||||
Page.new
|
Page.new
|
||||||
{ init = init
|
{ init = init
|
||||||
, update = update
|
, update = update
|
||||||
@@ -86,7 +87,7 @@ update msg model =
|
|||||||
|
|
||||||
|
|
||||||
subscriptions : Model -> Sub Msg
|
subscriptions : Model -> Sub Msg
|
||||||
subscriptions model =
|
subscriptions _ =
|
||||||
Sub.none
|
Sub.none
|
||||||
|
|
||||||
|
|
||||||
@@ -108,7 +109,7 @@ view model =
|
|||||||
[ Html.a [ href <| "/posts/" ++ first.category ++ "/" ++ first.slug ]
|
[ Html.a [ href <| "/posts/" ++ first.category ++ "/" ++ first.slug ]
|
||||||
[ Html.h3 [ class "text-2xl font-semibold sm:text-4xl group-hover:underline group-focus:underline" ]
|
[ Html.h3 [ class "text-2xl font-semibold sm:text-4xl group-hover:underline group-focus:underline" ]
|
||||||
[ Html.text first.title ]
|
[ Html.text first.title ]
|
||||||
, Html.span [ class "text-gray-400" ] [ Html.text first.date ]
|
, Html.time [ class "text-gray-400", datetime first.date ] [ Html.text <| UU.getFormattedDate first.date ]
|
||||||
, Html.p [] [ Html.text <| String.left 200 first.description ]
|
, Html.p [] [ Html.text <| String.left 200 first.description ]
|
||||||
]
|
]
|
||||||
, Html.a [ href <| "/posts/" ++ first.category, target "_blank" ] [ UU.categoryNtags first.category [] ]
|
, Html.a [ href <| "/posts/" ++ first.category, target "_blank" ] [ UU.categoryNtags first.category [] ]
|
||||||
@@ -127,22 +128,12 @@ view model =
|
|||||||
, Html.div [ class "p-6 space-y-2" ]
|
, Html.div [ class "p-6 space-y-2" ]
|
||||||
[ Html.a [ href <| "/posts/" ++ blog.category ++ "/" ++ blog.slug ]
|
[ Html.a [ href <| "/posts/" ++ blog.category ++ "/" ++ blog.slug ]
|
||||||
[ Html.h3 [ class "text-2xl font-semibold group-hover:underline group-focus:underline" ] [ Html.text blog.title ]
|
[ Html.h3 [ class "text-2xl font-semibold group-hover:underline group-focus:underline" ] [ Html.text blog.title ]
|
||||||
, Html.span [ class " text-gray-400" ] [ Html.text <| UU.getFormattedDate blog.date ]
|
, Html.time [ class " text-gray-400", datetime blog.date ] [ Html.text <| UU.getFormattedDate blog.date ]
|
||||||
, Html.p [] [ Html.text <| String.left 200 blog.description ]
|
, Html.p [] [ Html.text <| String.left 200 blog.description ]
|
||||||
]
|
]
|
||||||
, Html.a [ href <| "/posts/" ++ blog.category, target "_blank" ] [ UU.categoryNtags blog.category [] ]
|
, Html.a [ href <| "/posts/" ++ blog.category, target "_blank" ] [ UU.categoryNtags blog.category [] ]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
footerLinkToLeft : Link -> Html msg
|
|
||||||
footerLinkToLeft link =
|
|
||||||
Html.li []
|
|
||||||
[ Html.a
|
|
||||||
[ href link.url
|
|
||||||
, class "mr-4 md:mr-6 underline decoration-cyan-500 hover:decoration-pink-500"
|
|
||||||
]
|
|
||||||
[ Html.text link.text ]
|
|
||||||
]
|
|
||||||
in
|
in
|
||||||
case model.blogList of
|
case model.blogList of
|
||||||
Just blogList ->
|
Just blogList ->
|
||||||
@@ -151,14 +142,7 @@ view model =
|
|||||||
[ Html.section [ class "text-gray-100" ]
|
[ Html.section [ class "text-gray-100" ]
|
||||||
[ Html.h1 [ class "text-5xl font-bold mb-6 mt-12 text-center text-white" ] [ Html.text <| "Welcome to my blog" ]
|
[ Html.h1 [ class "text-5xl font-bold mb-6 mt-12 text-center text-white" ] [ Html.text <| "Welcome to my blog" ]
|
||||||
, maincard blogList
|
, maincard blogList
|
||||||
, Html.div [ class "fixed bottom-0 left-0 bg-neutral-900 z-20 p-4 w-full md:flex md:items-center md:justify-between md:p-4" ]
|
, footerLinksToSide
|
||||||
[ Html.ul
|
|
||||||
[ class "flex flex-wrap items-center mt-3 text-xl text-neutral-500 sm:mt-0" ]
|
|
||||||
(List.map footerLinkToLeft <|
|
|
||||||
{ text = "Home", url = "/" }
|
|
||||||
:: Utils.Constants.footerLinks
|
|
||||||
)
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
module Pages.Posts.Category_ exposing (Model, Msg, page)
|
module Pages.Posts.Category_ exposing (Model, Msg, page)
|
||||||
|
|
||||||
|
import Components.Footer exposing (footerLinksToSide)
|
||||||
import Effect exposing (Effect)
|
import Effect exposing (Effect)
|
||||||
import Html exposing (Html)
|
import Html exposing (Html)
|
||||||
import Html.Attributes exposing (class, href, src)
|
import Html.Attributes exposing (class, datetime, href, src)
|
||||||
import Http
|
import Http
|
||||||
import Json.Decode as Json
|
import Json.Decode as Json
|
||||||
import Page exposing (Page)
|
import Page exposing (Page)
|
||||||
@@ -14,7 +15,7 @@ import View exposing (View)
|
|||||||
|
|
||||||
|
|
||||||
page : Shared.Model -> Route { category : String } -> Page Model Msg
|
page : Shared.Model -> Route { category : String } -> Page Model Msg
|
||||||
page shared route =
|
page _ route =
|
||||||
Page.new
|
Page.new
|
||||||
{ init = init route
|
{ init = init route
|
||||||
, update = update
|
, update = update
|
||||||
@@ -87,7 +88,7 @@ update msg model =
|
|||||||
|
|
||||||
|
|
||||||
subscriptions : Model -> Sub Msg
|
subscriptions : Model -> Sub Msg
|
||||||
subscriptions model =
|
subscriptions _ =
|
||||||
Sub.none
|
Sub.none
|
||||||
|
|
||||||
|
|
||||||
@@ -108,20 +109,10 @@ view model =
|
|||||||
]
|
]
|
||||||
, Html.div [ class "grow-0 shrink-0 basis-auto w-full md:w-9/12 xl:w-7/12 p-3 md:mb-0 mr-auto bg-neutral-900" ]
|
, Html.div [ class "grow-0 shrink-0 basis-auto w-full md:w-9/12 xl:w-7/12 p-3 md:mb-0 mr-auto bg-neutral-900" ]
|
||||||
[ Html.h5 [ class "text-2xl font-bold mb-2" ] [ Html.text blog.title ]
|
[ Html.h5 [ class "text-2xl font-bold mb-2" ] [ Html.text blog.title ]
|
||||||
, Html.span [ class "text-gray-400 text-sm" ] [ Html.text blog.date ]
|
, Html.time [ class "text-gray-400 text-sm", datetime blog.date ] [ Html.text <| UU.getFormattedDate blog.date ]
|
||||||
, Html.p [ class "text-gray-500 mt-4 text-md" ] [ Html.text <| String.left 200 blog.description ]
|
, Html.p [ class "text-gray-500 mt-4 text-md" ] [ Html.text <| String.left 200 blog.description ]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
footerLinkToLeft : Link -> Html msg
|
|
||||||
footerLinkToLeft link =
|
|
||||||
Html.li []
|
|
||||||
[ Html.a
|
|
||||||
[ href link.url
|
|
||||||
, class "mr-4 md:mr-6 underline decoration-cyan-500 hover:decoration-pink-500"
|
|
||||||
]
|
|
||||||
[ Html.text link.text ]
|
|
||||||
]
|
|
||||||
in
|
in
|
||||||
case model.blogList of
|
case model.blogList of
|
||||||
Just blogList ->
|
Just blogList ->
|
||||||
@@ -142,14 +133,7 @@ view model =
|
|||||||
[ Html.section [ class "mb-32 text-gray-200 text-center md:text-left" ] <|
|
[ Html.section [ class "mb-32 text-gray-200 text-center md:text-left" ] <|
|
||||||
Html.h1 [ class "text-5xl font-bold mb-12 mt-12 text-center text-white" ] [ Html.text "Posts in ", Html.i [ class "text-pink-600" ] [ Html.text model.category ], Html.text " category" ]
|
Html.h1 [ class "text-5xl font-bold mb-12 mt-12 text-center text-white" ] [ Html.text "Posts in ", Html.i [ class "text-pink-600" ] [ Html.text model.category ], Html.text " category" ]
|
||||||
:: List.map card clist
|
:: List.map card clist
|
||||||
, Html.div [ class "fixed bottom-0 left-0 bg-neutral-900 z-20 p-4 w-full md:flex md:items-center md:justify-between md:p-4" ]
|
, footerLinksToSide
|
||||||
[ Html.ul
|
|
||||||
[ class "flex flex-wrap items-center mt-3 text-xl text-neutral-500 sm:mt-0" ]
|
|
||||||
(List.map footerLinkToLeft <|
|
|
||||||
{ text = "Home", url = "/" }
|
|
||||||
:: Utils.Constants.footerLinks
|
|
||||||
)
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
module Pages.Posts.Category_.Post_ exposing (Model, Msg, page)
|
module Pages.Posts.Category_.Post_ exposing (Model, Msg, page)
|
||||||
|
|
||||||
|
import Components.Footer exposing (avatarAndLinks)
|
||||||
import Effect exposing (Effect)
|
import Effect exposing (Effect)
|
||||||
import Html exposing (Html)
|
import Html exposing (Html)
|
||||||
import Html.Attributes exposing (class, href, rel, src)
|
import Html.Attributes exposing (class, datetime, href, rel, src)
|
||||||
import Http
|
import Http
|
||||||
import Layouts
|
import Layouts
|
||||||
import Page exposing (Page)
|
import Page exposing (Page)
|
||||||
@@ -11,14 +12,13 @@ import Shared
|
|||||||
import Svg exposing (path, svg)
|
import Svg exposing (path, svg)
|
||||||
import Svg.Attributes as SvgAttr
|
import Svg.Attributes as SvgAttr
|
||||||
import Url exposing (Protocol(..))
|
import Url exposing (Protocol(..))
|
||||||
import Utils.Constants
|
|
||||||
import Utils.Utils as UU
|
import Utils.Utils as UU
|
||||||
import View exposing (View)
|
import View exposing (View)
|
||||||
import Yaml.Decode as Yaml
|
import Yaml.Decode as Yaml
|
||||||
|
|
||||||
|
|
||||||
page : Shared.Model -> Route { category : String, post : String } -> Page Model Msg
|
page : Shared.Model -> Route { category : String, post : String } -> Page Model Msg
|
||||||
page shared route =
|
page _ route =
|
||||||
Page.new
|
Page.new
|
||||||
{ init = init route
|
{ init = init route
|
||||||
, update = update
|
, update = update
|
||||||
@@ -33,7 +33,7 @@ page shared route =
|
|||||||
|
|
||||||
|
|
||||||
layout : Model -> Layouts.Layout
|
layout : Model -> Layouts.Layout
|
||||||
layout model =
|
layout _ =
|
||||||
Layouts.Blog
|
Layouts.Blog
|
||||||
{ blog =
|
{ blog =
|
||||||
{}
|
{}
|
||||||
@@ -113,7 +113,7 @@ update msg model =
|
|||||||
|
|
||||||
|
|
||||||
subscriptions : Model -> Sub Msg
|
subscriptions : Model -> Sub Msg
|
||||||
subscriptions model =
|
subscriptions _ =
|
||||||
Sub.none
|
Sub.none
|
||||||
|
|
||||||
|
|
||||||
@@ -134,32 +134,13 @@ view model =
|
|||||||
[]
|
[]
|
||||||
, articleNode blog.content model.fragment
|
, articleNode blog.content model.fragment
|
||||||
, Html.div [ class "text-center text-neutral-300 border-t border-dashed border-teal-500 p-2" ]
|
, Html.div [ class "text-center text-neutral-300 border-t border-dashed border-teal-500 p-2" ]
|
||||||
[ Html.text <| "Published on " ++ blog.meta.date ++ " under "
|
[ Html.time [ datetime blog.meta.date ] [ Html.text <| "Published on " ++ UU.getFormattedDate blog.meta.date ++ " under " ]
|
||||||
, Html.a [ href "https://www.mozilla.org/en-US/MPL/2.0/" ] [ Html.text "Mozilla Public License 2.0" ]
|
, Html.a [ href "https://www.mozilla.org/en-US/MPL/2.0/" ] [ Html.text "Mozilla Public License 2.0" ]
|
||||||
, Html.text " if you found an issue with the page, please report it "
|
, Html.text " if you found an issue with the page, please report it "
|
||||||
, Html.a [ href <| "https://github.com/avinal/avinal.github.io/issues/new?title=bug:+" ++ String.replace " " "+" blog.meta.title ] [ Html.text "here." ]
|
, Html.a [ href <| "https://github.com/avinal/avinal.github.io/issues/new?title=bug:+" ++ String.replace " " "+" blog.meta.title ] [ Html.text "here." ]
|
||||||
]
|
]
|
||||||
, UU.categoryNtags blog.meta.category blog.meta.tags
|
, UU.categoryNtags blog.meta.category blog.meta.tags
|
||||||
, Html.div [ class "flex flex-col space-y-2 md:space-y-0 md:space-x-6 md:flex-row border-t border-neutral-700" ]
|
, avatarAndLinks
|
||||||
[ Html.img
|
|
||||||
[ class "self-center flex-shrink-0 w-24 h-24 border rounded-full md:justify-self-start"
|
|
||||||
, src "https://github.com/avinal.png"
|
|
||||||
]
|
|
||||||
[]
|
|
||||||
, Html.div [ class "flex flex-col self-center" ]
|
|
||||||
[ Html.h4 [ class "text-xl font-semibold " ] [ Html.text "Avinal Kumar" ]
|
|
||||||
, Html.p [ class "text-gray-400" ]
|
|
||||||
[ Html.text "I am a Associate Software Engineer at Red Hat and I work for Hybrid Cloud Engineering. I contribute to Open Source projects and write blogs in tech and literature."
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
, Html.div [ class "flex justify-center space-x-4 align-center text-neutral-600 text-xl" ]
|
|
||||||
(List.map
|
|
||||||
(\iconlink ->
|
|
||||||
Html.a [ href iconlink.url, class "hover:text-pink-500" ] [ Html.i [ class iconlink.icon ] [] ]
|
|
||||||
)
|
|
||||||
Utils.Constants.iconLinks
|
|
||||||
)
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+24
-31
@@ -1,6 +1,7 @@
|
|||||||
module Utils.Utils exposing (..)
|
module Utils.Utils exposing (..)
|
||||||
|
|
||||||
import Array exposing (Array)
|
import Array
|
||||||
|
|
||||||
import Html exposing (Html)
|
import Html exposing (Html)
|
||||||
import Html.Attributes exposing (class, href, target)
|
import Html.Attributes exposing (class, href, target)
|
||||||
import Http exposing (Error(..))
|
import Http exposing (Error(..))
|
||||||
@@ -8,50 +9,42 @@ import Parser exposing (..)
|
|||||||
import Utils.Constants exposing (..)
|
import Utils.Constants exposing (..)
|
||||||
|
|
||||||
|
|
||||||
type alias Date =
|
type alias DateTime =
|
||||||
{ day : Int
|
{ year : Int
|
||||||
, month : Int
|
, month : Int
|
||||||
, year : Int
|
, day : Int
|
||||||
|
, hour : Int
|
||||||
|
, minute : Int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
day : Parser Int
|
|
||||||
day =
|
|
||||||
succeed identity
|
|
||||||
|= int
|
|
||||||
|
|
||||||
|
|
||||||
month : Parser Int
|
|
||||||
month =
|
|
||||||
succeed identity
|
|
||||||
|= int
|
|
||||||
|
|
||||||
|
|
||||||
year : Parser Int
|
|
||||||
year =
|
|
||||||
succeed identity
|
|
||||||
|= int
|
|
||||||
|
|
||||||
|
|
||||||
getFormattedDate : String -> String
|
getFormattedDate : String -> String
|
||||||
getFormattedDate dateString =
|
getFormattedDate dateString =
|
||||||
case Parser.run dateParser dateString of
|
case Parser.run dateParser dateString of
|
||||||
Ok date ->
|
Ok date ->
|
||||||
(Maybe.withDefault "Month" <| Array.get (date.month - 1) months) ++ " " ++ String.fromInt date.day ++ ", " ++ String.fromInt date.year
|
(Maybe.withDefault "Month" <| Array.get (date.month - 1) months) ++ " " ++ String.fromInt date.day ++ ", " ++ String.fromInt date.year
|
||||||
|
|
||||||
Err err ->
|
Err _ ->
|
||||||
"Invalid date!!"
|
"Invalid date!!"
|
||||||
|
|
||||||
|
|
||||||
dateParser : Parser Date
|
dateParser : Parser DateTime
|
||||||
dateParser =
|
dateParser =
|
||||||
succeed Date
|
succeed DateTime
|
||||||
|= day
|
|= int
|
||||||
|. symbol "-"
|
|. token "-"
|
||||||
|= month
|
|. chompWhile (\c -> c == '0')
|
||||||
|. symbol "-"
|
|= int
|
||||||
|= year
|
|. token "-"
|
||||||
|
|. chompWhile (\c -> c == '0')
|
||||||
|
|= int
|
||||||
|
|. spaces
|
||||||
|
|. chompWhile (\c -> c == '0')
|
||||||
|
|= int
|
||||||
|
|. token ":"
|
||||||
|
|. chompWhile (\c -> c == '0')
|
||||||
|
|= int
|
||||||
|
|. end
|
||||||
|
|
||||||
|
|
||||||
categoryNtags : String -> List String -> Html msg
|
categoryNtags : String -> List String -> Html msg
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ module View exposing
|
|||||||
|
|
||||||
import Browser
|
import Browser
|
||||||
import Html exposing (Html)
|
import Html exposing (Html)
|
||||||
import Html.Attributes exposing (class, href)
|
import Html.Attributes exposing (class)
|
||||||
import Route exposing (Route)
|
import Route exposing (Route)
|
||||||
import Shared.Model
|
import Shared.Model
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user