From abb5503dfe1b0e1bccf40d18989d6a4257b8acf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=AF=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2=D0=BB=D0=B5=D0=B2?= Date: Wed, 30 Sep 2015 16:09:38 +0300 Subject: [PATCH 1/2] Option to use icons in top-level navigation User can choose to not use icons, use icons before text, after text or instead text. Also this option support menu defined in site.yaml. Fixed: Prevent duplicating meta charset: if charset not set in page, used utf-8 by default. Site title used for title in navbar instead hardcoded "Grav" string. --- .gitignore | 1 + CHANGELOG.md | 6 +++++ blueprints.yaml | 15 ++++++++++++ bootstrap.yaml | 2 ++ templates/partials/base.html.twig | 1 - templates/partials/metadata.html.twig | 7 +++++- templates/partials/navigation.html.twig | 32 +++++++++++++++++++++---- 7 files changed, 58 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4b11432..2d5b433 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .sass-cache .DS_Store +Thumbs.db diff --git a/CHANGELOG.md b/CHANGELOG.md index e7ed662..ef2a29c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.5.0 +## 09/30/2015 + +1. [](#new) + * Option to use icons in top-level navigation + # v1.4.1 ## 09/16/2015 diff --git a/blueprints.yaml b/blueprints.yaml index 7ef9dad..b546a19 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -18,6 +18,11 @@ dependencies: form: validation: strict fields: + menu.section: + type: section + title: Menu settings + underline: false + dropdown.enabled: type: toggle label: Dropdown in navbar @@ -28,3 +33,13 @@ form: 0: Disabled validate: type: bool + + menu.icons: + type: select + label: Use icons in top-level navigation + default: 0 + options: + 0: No, only text + 1: Yes, before text + 2: Yes, after text + 3: Yes, instead text diff --git a/bootstrap.yaml b/bootstrap.yaml index 17c9ed6..7cc5889 100644 --- a/bootstrap.yaml +++ b/bootstrap.yaml @@ -1,2 +1,4 @@ dropdown: enabled: false +menu: + icons: 0 diff --git a/templates/partials/base.html.twig b/templates/partials/base.html.twig index de89268..390c97b 100644 --- a/templates/partials/base.html.twig +++ b/templates/partials/base.html.twig @@ -2,7 +2,6 @@ {% block head %} - {% include 'partials/metadata.html.twig' %} diff --git a/templates/partials/metadata.html.twig b/templates/partials/metadata.html.twig index e98963f..e07bcc2 100644 --- a/templates/partials/metadata.html.twig +++ b/templates/partials/metadata.html.twig @@ -1,3 +1,8 @@ +{% if meta.charset %} + +{% else %} + +{% endif %} {% for meta in page.metadata %} - + {% endfor %} diff --git a/templates/partials/navigation.html.twig b/templates/partials/navigation.html.twig index 98b9df8..3a7eadf 100644 --- a/templates/partials/navigation.html.twig +++ b/templates/partials/navigation.html.twig @@ -7,7 +7,7 @@ - Grav + {{ config.site.title }}