Support setting an fb:app_id in settings.yml

This commit is contained in:
Danielle McLean 2017-10-14 17:22:07 +11:00
parent 2956550a6c
commit fa110ae820
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
3 changed files with 7 additions and 0 deletions

View file

@ -36,3 +36,4 @@ app-name: lebd
username: dani
repository: https://gitlab.com/00dani/lebd
#analytics: UA-YOURCODE
fb-app-id: "_env:FB_APP_ID:142105433189339"

View file

@ -62,6 +62,9 @@ data AppSettings = AppSettings
-- Example app-specific configuration values.
, appAnalytics :: Maybe Text
-- ^ Google Analytics code
, appFacebookId :: Maybe Int
-- ^ Facebook app ID, also used for analytics.
, siteTitle :: Text
-- ^ Site-wide title.
, siteUsername :: Text
@ -96,6 +99,7 @@ instance FromJSON AppSettings where
appSkipCombining <- o .:? "skip-combining" .!= defaultDev
appAnalytics <- o .:? "analytics"
appFacebookId <- o .:? "fb-app-id"
siteTitle <- o .: "title"
siteUsername <- o .: "username"

View file

@ -9,6 +9,8 @@ $doctype 5
$maybe route <- mcurrentRoute
<link rel="canonical" href=@{route}>
<meta property="og:url" content=@{route}>
$maybe fb <- appFacebookId $ appSettings master
<meta property="fb:app_id" content=#{fb}>
<link rel="sitemap" href=@{SitemapR}>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">