add twitter [etc] card previews
This commit is contained in:
parent
8865b951fa
commit
5ad4e3dc30
9 changed files with 115 additions and 57 deletions
|
@ -5,17 +5,26 @@ import qualified Data.Text.Lazy as Lazy
|
|||
import BuilderQQ
|
||||
import Info
|
||||
|
||||
make :: IndexInfo -> Lazy.Text
|
||||
make info = toLazyText $ make' info
|
||||
make :: Text -> IndexInfo -> Lazy.Text
|
||||
make root info = toLazyText $ make' root info
|
||||
|
||||
make' :: IndexInfo -> Builder
|
||||
make' (IndexInfo {title, galleries, links, footer}) = [b|@0
|
||||
make' :: Text -> IndexInfo -> Builder
|
||||
make' root (IndexInfo {title, desc, galleries, links, footer}) = [b|@0
|
||||
<!DOCTYPE html>
|
||||
<html lang=en>
|
||||
<meta charset=utf-8>
|
||||
<link rel=stylesheet href=/style/shiny/index.css>
|
||||
<link rel=icon href=/style/niss.svg>
|
||||
|
||||
<meta property=og:type content=og:website>
|
||||
<meta property=og:title content="$*title">
|
||||
<meta property=og:site_name content="$*title">
|
||||
<meta property=og:description content="$*desc">
|
||||
<meta property=og:image content="$*root/style/card.png">
|
||||
<meta property=og:url content="$url">
|
||||
<meta name=twitter:site content=@gec_ko_>
|
||||
<meta name=twitter:card content=summary>
|
||||
|
||||
<title>$*title</title>
|
||||
|
||||
<header>
|
||||
|
@ -53,6 +62,7 @@ make' (IndexInfo {title, galleries, links, footer}) = [b|@0
|
|||
$2*f
|
||||
</footer>
|
||||
|]
|
||||
url = [b|$*root|]
|
||||
|
||||
makeItem :: GalleryInfo -> Builder
|
||||
makeItem (GalleryInfo {title, desc, prefix, filters}) = [b|@6
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue