From 22fec5906934b2bb3339265af486a61d7c268afe Mon Sep 17 00:00:00 2001 From: Avinal Kumar Date: Tue, 31 Jan 2023 00:50:35 +0530 Subject: [PATCH] add robots and alt Signed-off-by: Avinal Kumar --- src/Pages/Home_.elm | 2 +- src/Pages/Posts.elm | 6 +++--- src/Pages/Posts/Category_.elm | 4 ++-- src/Pages/Posts/Category_/Post_.elm | 3 ++- static/robots.txt | 4 ++++ 5 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 static/robots.txt diff --git a/src/Pages/Home_.elm b/src/Pages/Home_.elm index d98a222..3b49657 100644 --- a/src/Pages/Home_.elm +++ b/src/Pages/Home_.elm @@ -149,7 +149,7 @@ subscriptions model = view : Model -> View Msg view model = - { title = "Be my SpaceTime" + { title = "Welcome to my website" , body = [ Html.div [ onClick LiveLife, onMouseLeave LiveLife ] [ universeSvg model ] ] } diff --git a/src/Pages/Posts.elm b/src/Pages/Posts.elm index e5b537c..ba3c98c 100644 --- a/src/Pages/Posts.elm +++ b/src/Pages/Posts.elm @@ -3,7 +3,7 @@ module Pages.Posts exposing (Model, Msg, page) import Components.Footer exposing (footerLinksToSide) import Effect exposing (Effect) import Html exposing (Html) -import Html.Attributes exposing (class, datetime, href, src, target) +import Html.Attributes exposing (alt, class, datetime, href, src, target) import Http import Json.Decode as Json import Page exposing (Page) @@ -104,7 +104,7 @@ view model = first :: rest -> Html.div [ class "max-w-6xl p-6 mx-auto space-y-6 sm:space-y-12 mb-16" ] [ Html.div [ class "block max-w-sm gap-3 mx-auto sm:max-w-full group hover:no-underline focus:no-underline lg:grid lg:grid-cols-12 bg-neutral-900" ] - [ Html.a [ class "lg:col-span-7", href <| "/posts/" ++ first.category ++ "/" ++ first.slug ] [ Html.img [ class "object-cover w-full h-64 rounded sm:h-96 lg:col-span-7", src first.image ] [] ] + [ Html.a [ class "lg:col-span-7", href <| "/posts/" ++ first.category ++ "/" ++ first.slug ] [ Html.img [ class "object-cover w-full h-64 rounded sm:h-96 lg:col-span-7", src first.image, alt first.title ] [] ] , Html.div [ class "p-6 space-y-2 lg:col-span-5" ] [ Html.a [ href <| "/posts/" ++ first.category ++ "/" ++ first.slug ] [ Html.h3 [ class "text-2xl font-semibold sm:text-4xl group-hover:underline group-focus:underline" ] @@ -124,7 +124,7 @@ view model = card : JsonMeta -> Html msg card blog = Html.div [ class "max-w-sm mx-auto group hover:no-underline focus:no-underline bg-neutral-900", href ("/posts/" ++ blog.category ++ "/" ++ blog.slug) ] - [ Html.a [ href <| "/posts/" ++ blog.category ++ "/" ++ blog.slug ] [ Html.img [ class "object-cover w-full h-44 rounded", src blog.image ] [] ] + [ Html.a [ href <| "/posts/" ++ blog.category ++ "/" ++ blog.slug ] [ Html.img [ class "object-cover w-full h-44 rounded", src blog.image, alt blog.title ] [] ] , Html.div [ class "p-6 space-y-2" ] [ 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 ] diff --git a/src/Pages/Posts/Category_.elm b/src/Pages/Posts/Category_.elm index e9184c2..af1ff07 100644 --- a/src/Pages/Posts/Category_.elm +++ b/src/Pages/Posts/Category_.elm @@ -3,7 +3,7 @@ module Pages.Posts.Category_ exposing (Model, Msg, page) import Components.Footer exposing (footerLinksToSide) import Effect exposing (Effect) import Html exposing (Html) -import Html.Attributes exposing (class, datetime, href, src) +import Html.Attributes exposing (alt, class, datetime, href, src) import Http import Json.Decode as Json import Page exposing (Page) @@ -104,7 +104,7 @@ view model = Html.a [ class "flex flex-wrap mb-6 ", href <| "/posts/" ++ blog.category ++ "/" ++ blog.slug ] [ Html.div [ class "grow-0 shrink-0 basis-auto w-full md:w-3/12 md:mb-0 ml-auto" ] [ Html.div [ class "overflow-hidden relative bg-no-repeat bg-cover ripple" ] - [ Html.img [ src blog.image, class "w-full h-44 object-cover rounded" ] [] + [ Html.img [ src blog.image, class "w-full h-44 object-cover rounded", alt blog.title ] [] ] ] , 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" ] diff --git a/src/Pages/Posts/Category_/Post_.elm b/src/Pages/Posts/Category_/Post_.elm index 91d3160..7c1e86d 100644 --- a/src/Pages/Posts/Category_/Post_.elm +++ b/src/Pages/Posts/Category_/Post_.elm @@ -3,7 +3,7 @@ module Pages.Posts.Category_.Post_ exposing (Model, Msg, page) import Components.Footer exposing (avatarAndLinks) import Effect exposing (Effect) import Html exposing (Html) -import Html.Attributes exposing (class, datetime, href, rel, src) +import Html.Attributes exposing (alt, class, datetime, href, rel, src) import Http import Layouts import Page exposing (Page) @@ -130,6 +130,7 @@ view model = [ Html.img [ class "object-cover w-full h-60 sm:h-96 rounded" , src blog.meta.image + , alt blog.meta.title ] [] , articleNode blog.content model.fragment diff --git a/static/robots.txt b/static/robots.txt new file mode 100644 index 0000000..aa58dd5 --- /dev/null +++ b/static/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://www.example.com/sitemap.xml \ No newline at end of file