feat: added two articles

This commit is contained in:
Nick 2024-12-17 02:17:06 -06:00
parent a751136971
commit 6cfdf6200e
166 changed files with 3507 additions and 237 deletions

43
frontend/src/Pages/Blog/Seedoils.elm Normal file → Executable file
View file

@ -24,6 +24,7 @@ import Config.Helpers.Header
, headerMaker
)
import Config.Helpers.Markdown exposing (..)
import Config.Helpers.References exposing (makeReference)
import Config.Helpers.Response
exposing
( pageList
@ -37,6 +38,7 @@ import Config.Helpers.StrengthBar
import Config.Helpers.ToolTip exposing (..)
import Config.Helpers.Viewport exposing (resetViewport)
import Config.Pages.Blog.Records.SeedOils exposing (articleSeedOils)
import Config.Pages.Blog.Types exposing (BlogArticle)
import Config.Pages.Contact.Types exposing (..)
import Config.Pages.Interviews.Types exposing (..)
import Config.Pages.Products.Types exposing (..)
@ -124,7 +126,7 @@ subscriptions model =
view : Shared.Model -> Model -> View Msg
view shared model =
{ title = pageNames.pageHyperBlog ++ "(seedOils)"
{ title = pageNames.pageHyperBlog ++ " (seedOils)"
, attributes = []
, element = articleContainer shared.device
}
@ -137,16 +139,23 @@ articleContainer device =
articleList : Device -> Element msg
articleList device =
column pageList <|
column
(case ( device.class, device.orientation ) of
_ ->
pageList
)
<|
List.concat
(case ( device.class, device.orientation ) of
[ (case ( device.class, device.orientation ) of
_ ->
[ [ articleMaker ] ]
)
List.map articleMaker
)
[ articleSeedOils ]
]
articleMaker : Element msg
articleMaker =
articleMaker : BlogArticle -> Element msg
articleMaker article =
column
topLevelBox
[ cardMaker
@ -158,9 +167,29 @@ articleMaker =
[ cardSubTitleMaker
[ articleImage articleSeedOils.articleImage
, renderDeviceMarkdown articleSeedOils.articleBody
, articleReferences article
]
]
]
]
]
]
articleReferences : BlogArticle -> Element msg
articleReferences article =
column
[ width fill
, height fill
, paddingEach
{ top = 10
, right = 0
, bottom = 0
, left = 0
}
]
[ column [ width fill, F.size 15, spacing 10 ] <|
List.map2 (\x y -> makeReference x y)
article.articleReferences
(List.range 1 (List.length article.articleReferences))
]