Add a site-wide title

This commit is contained in:
Danielle McLean 2017-10-02 22:04:20 +11:00
parent b0d997dabc
commit 3d4c21e18e
Signed by: 00dani
GPG key ID: 3844A6973C6058F1
3 changed files with 11 additions and 12 deletions

View file

@ -31,4 +31,5 @@ database:
database: "_env:MYSQL_DATABASE:lebd"
poolsize: "_env:MYSQL_POOLSIZE:10"
title: 00dani.me
#analytics: UA-YOURCODE

View file

@ -62,6 +62,8 @@ data AppSettings = AppSettings
-- Example app-specific configuration values.
, appAnalytics :: Maybe Text
-- ^ Google Analytics code
, appTitle :: Maybe Text
-- ^ Site-wide title.
, appAuthDummyLogin :: Bool
-- ^ Indicate if auth dummy login should be enabled.
@ -91,6 +93,7 @@ instance FromJSON AppSettings where
appSkipCombining <- o .:? "skip-combining" .!= defaultDev
appAnalytics <- o .:? "analytics"
appTitle <- o .:? "title"
-- This code enables MySQL's strict mode, without which MySQL will truncate data.
-- See https://github.com/yesodweb/persistent/wiki/Database-Configuration#strict-mode for details

View file

@ -1,13 +1,14 @@
<!-- Static navbar -->
<nav .navbar.navbar-default.navbar-static-top>
<div .container>
<div .navbar-header>
<button type="button" .navbar-toggle.collapsed data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span .sr-only>Toggle navigation
<span .icon-bar>
<span .icon-bar>
<span .icon-bar>
$maybe title <- appTitle $ appSettings master
<a class="navbar-brand" href="@{HomeR}">#{title}
<div #navbar .collapse.navbar-collapse>
<ul .nav.navbar-nav>
@ -21,7 +22,6 @@
<a href="@{route}">#{label}
<!-- Page Contents -->
<div .container>
$if not $ Just HomeR == mcurrentRoute
<ul .breadcrumb>
@ -35,13 +35,8 @@
<div .alert.alert-info #message>#{msg}
$if (Just HomeR == mcurrentRoute)
<main>
^{widget}
$else
<div .container>
<div .row>
<div .col-md-12>
^{widget}
<!-- Footer -->
<footer .footer>