Commit 7c4371df authored by Fabien Maniere's avatar Fabien Maniere

improve tile tpl

parent fe9fe6da
This diff is collapsed.
......@@ -89,16 +89,16 @@ main = hakyllWith config $ do
postCtx :: Context String
postCtx =
dateField "date" "%B %e, %Y" `mappend`
shortUrlField `mappend`
domainUrlField `mappend`
defaultContext
shortUrlField :: Context String
shortUrlField = field "short_url" $ \item -> do
domainUrlField :: Context String
domainUrlField = field "domain_url" $ \item -> do
url <- getMetadataField' (itemIdentifier item) "url"
return $ getShortUrl url
return $ getDomainUrl url
getShortUrl :: String -> String
getShortUrl url = case parseURI url >>= uriAuthority of
getDomainUrl :: String -> String
getDomainUrl url = case parseURI url >>= uriAuthority of
Just auth -> uriRegName auth
Nothing -> url
......
<div class="col">
<div class="card h-100 border-0 bg-transparent" style="">
<div class="row g-0">
$if(image)$
<div class="img-wrapper col-md-5">
<img src="$image$" class="img-fluid rounded-start" alt="...">
</div>
$endif$
<div class="col-md-7">
<div class="card-body pt-0">
<h5 class="card-title">$title$</h5>
<p class="card-text">$description$</p>
<p class="card-text"><small class="text-muted">$domain_url$ <i class="fa fa-external-link " aria-hidden="true"></i></small></p>
<a href="$url$" target="_blank" class="btn btn-primary">Voir <i class="fa fa-external-link " aria-hidden="true"></i></a>
</div>
</div>
</div>
</div>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment