feat: added article

This commit is contained in:
Nick 2024-12-16 04:19:13 -06:00
parent cf9caa1a66
commit a751136971
7 changed files with 198 additions and 25 deletions

View file

@ -168,6 +168,8 @@ cardImageMaker size1 size2 image urlLink =
|| urlLink
== Path.toString Path.Blog
|| urlLink
== Path.toString Path.Blog_Seedoils
|| urlLink
== Path.toString Path.Interviews
|| urlLink
== Path.toString Path.Nutridex

View file

@ -19,3 +19,10 @@ formatSocial name =
|> String.replace "https://www.threads.net/@" "@"
|> String.replace "https://bsky.app/profile/" "@"
|> String.replace "https://www.instagram.com/" "@"
wordCount : String -> Int
wordCount text =
text
|> String.words
|> List.length

View file

@ -126,14 +126,23 @@ elmUiRenderer =
\image ->
case image.title of
Just title ->
el [] <|
el
[ width fill ]
<|
column
[ width fill
, E.centerX
[ E.centerX
, E.centerY
, width fill
, E.paddingEach
{ top = 0
, bottom = 10
, left = 10
, right = 10
}
]
[ E.image
[ E.centerX
, width <| px 600
, width (fill |> maximum 600)
]
{ src = image.src
, description = image.alt
@ -149,7 +158,7 @@ elmUiRenderer =
, E.centerY
, width fill
, E.paddingEach
{ top = 0
{ top = 3
, bottom = 10
, left = 10
, right = 10

View file

@ -1,12 +1,18 @@
module Config.Pages.Blog.Records.SeedOils exposing (..)
import Config.Pages.Blog.Types exposing (..)
import Route.Path as Path
articleSeedOils : BlogArticle
articleSeedOils =
{ articleName = "A Comprehensive Rebuttal to Seed Oil Sophistry"
, articleDescription = "The article argues that vegetable oils, often criticized in recent years, are not harmful and may even offer health benefits, such as preventing heart disease and type 2 diabetes. It challenges claims based on mechanistic or ecological research, which lack strong evidence linking vegetable oils to chronic diseases. Instead, the article supports their inclusion in a balanced diet, cautioning against overconsumption, and debunking myths based on speculative studies."
, articleLink = Path.toString Path.Blog_Seedoils
, articleAuthor = "Nick Hiebert"
, isNewTabLink = False
, articleImage = "seedoils"
, articlePublished = "Oct 31, 2021"
, articleBody = """
The popular consciousness has accepted many dietary villains over the course of the last half century, ranging from fat, to protein, to salt, to carbohydrates. More often than not, dietary constituents that have fallen under such scrutiny have been exonerated in time, as more and more scientific data is brought to light. I suspect that there is a growing number of people who are now wrongfully demonizing vegetable oils as well. Both skepticism and generally negative attitudes toward these oils appear to have skyrocketed in recent years, and it can be seen seemingly everywhere.

View file

@ -5,4 +5,9 @@ type alias BlogArticle =
{ articleName : String
, articleBody : String
, articleImage : String
, articleLink : String
, articleAuthor : String
, isNewTabLink : Bool
, articlePublished : String
, articleDescription : String
}