Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/devcows/hugo-universal-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge W Langham <georgelangham1990@gmail.com>2017-06-10 15:29:06 +0300
committerGitHub <noreply@github.com>2017-06-10 15:29:06 +0300
commit8a0c0921875205fa3b100f0c83458b5883b7964d (patch)
tree97c12da2a293b8e94a4af5adc67473e3b91f476b
parent277a69a52c2662fe28552bd7f6fbf662ae3d7e58 (diff)
parentd3aba1997defef8dd0ce354140f9cc632a951005 (diff)
Merge branch 'master' into french-translation
-rw-r--r--README.md29
-rw-r--r--exampleSite/config.toml39
-rw-r--r--i18n/ru.yaml2
-rw-r--r--layouts/index.html2
-rw-r--r--layouts/partials/head.html2
-rw-r--r--layouts/partials/map.html1
-rw-r--r--layouts/partials/top.html18
-rw-r--r--static/js/gmaps.init.js2
8 files changed, 92 insertions, 3 deletions
diff --git a/README.md b/README.md
index 968230e..0927aae 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,7 @@ This Hugo theme was ported from [Bootstrapious](http://bootstrapious.com/p/unive
* [Menu](#menu)
* [Sidebar widgets](#sidebar-widgets)
* [Blog post thumbnails](#blog-post-thumbnails)
+ * [Top bar](#top-bar)
* [Landing page](#landing-page)
* [Carousel](#carousel)
* [Features](#features)
@@ -174,6 +175,34 @@ You can enable/disable them under `params.widgets`.
tags = true
```
+### Top bar
+
+The top bar is typically used to provide contact information and social links. It is disabled by default, and it can be enabled inside the `params.topbar` settings.
+
+```toml
+[params.topbar]
+ enable = true
+ text = "<p>Contact us on +420 777 555 333 or hello@universal.com.</p>"
+```
+
+The `text` shows up on the left side and accepts HTML.
+
+The social links on the right side are configured as a top-level menu.
+
+```toml
+[[menu.topbar]]
+ weight = 1
+ name = "GitHub"
+ url = "https://github.com/devcows/hugo-universal-theme"
+ pre = "<i class='fa fa-2x fa-github'></i>"
+
+[[menu.topbar]]
+ weight = 2
+ name = "Facebook"
+ url = "http://facebook.com"
+ pre = "<i class='fa fa-2x fa-facebook'></i>"
+```
+
### Blog post thumbnails
After creating a new post you can define a banner by entering the relative path to the image.
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 0e19508..7786bfb 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -14,6 +14,8 @@ paginate = 10
[menu]
+# Main menu
+
[[menu.main]]
name = "Home"
url = "/"
@@ -35,6 +37,32 @@ paginate = 10
url = "/contact/"
weight = 4
+# Top bar social links menu
+
+[[menu.topbar]]
+ weight = 1
+ name = "GitHub"
+ url = "https://github.com/devcows/hugo-universal-theme"
+ pre = "<i class='fa fa-2x fa-github'></i>"
+
+[[menu.topbar]]
+ weight = 2
+ name = "Facebook"
+ url = "http://facebook.com"
+ pre = "<i class='fa fa-2x fa-facebook'></i>"
+
+[[menu.topbar]]
+ weight = 3
+ name = "Twitter"
+ url = "http://twitter.com"
+ pre = "<i class='fa fa-2x fa-twitter'></i>"
+
+[[menu.topbar]]
+ weight = 4
+ name = "Email"
+ url = "mailto:your@email.com"
+ pre = "<i class='fa fa-2x fa-envelope'></i>"
+
[params]
viewMorePostLink = "/blog/"
author = "DevCows"
@@ -42,7 +70,7 @@ paginate = 10
defaultDescription = "Site template made by devcows using hugo"
# Google Maps API key (if not set will default to not passing a key.)
- googleMapsApiKey = ""
+ googleMapsApiKey = "AIzaSyCFhtWLJcE30xOAjcbSFi-0fnoVmQZPb1Y"
# Style options: default (light-blue), blue, green, marsala, pink, red, turquoise, violet
style = "default"
@@ -84,6 +112,15 @@ paginate = 10
[Permalinks]
blog = "/blog/:year/:month/:day/:filename/"
+# Enable or disable top bar with social icons
+[params.topbar]
+ enable = true
+ text = """<p class="hidden-sm hidden-xs">Contact us on +420 777 555 333 or hello@universal.com.</p>
+ <p class="hidden-md hidden-lg"><a href="#" data-animate-hover="pulse"><i class="fa fa-phone"></i></a>
+ <a href="#" data-animate-hover="pulse"><i class="fa fa-envelope"></i></a>
+ </p>
+ """
+
# Enable and disable widgets for the right sidebar
[params.widgets]
categories = true
diff --git a/i18n/ru.yaml b/i18n/ru.yaml
index 9d915c8..7a70e93 100644
--- a/i18n/ru.yaml
+++ b/i18n/ru.yaml
@@ -35,7 +35,7 @@
translation: "перейти на главную"
- id: navToggle
- translation: "Toggle Navigation"
+ translation: "Переключить навигацию"
- id: categoriesTitle
translation: "Категории"
diff --git a/layouts/index.html b/layouts/index.html
index 24a22fa..8635f77 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -9,6 +9,8 @@
<header>
+ {{ partial "top.html" . }}
+
{{ partial "nav.html" . }}
</header>
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 65adc3f..2651fc9 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -41,10 +41,12 @@
<link href="{{ .Site.BaseURL }}css/custom.css" rel="stylesheet">
<!-- Responsivity for older IE -->
+ {{ `
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
+ ` | safeHTML }}
<!-- Favicon and apple touch icons-->
<link rel="shortcut icon" href="{{ .Site.BaseURL }}img/favicon.ico" type="image/x-icon" />
diff --git a/layouts/partials/map.html b/layouts/partials/map.html
index 645c7da..4b1499e 100644
--- a/layouts/partials/map.html
+++ b/layouts/partials/map.html
@@ -3,6 +3,7 @@
<div class="hidden">
<input id="gmap-lat" value="{{ .Site.Params.latitude }}" />
<input id="gmap-lng" value="{{ .Site.Params.longitude }}" />
+ <input id="gmap-marker" value="{{ .Site.BaseURL }}img/marker.png" />
{{ if isset .Site.Params "direction" }}
<input id="gmap-dir" value="{{ .Site.Params.direction }}" />
{{ else }}
diff --git a/layouts/partials/top.html b/layouts/partials/top.html
new file mode 100644
index 0000000..441944b
--- /dev/null
+++ b/layouts/partials/top.html
@@ -0,0 +1,18 @@
+{{ if .Site.Params.topbar.enable }}
+<div id="top">
+ <div class="container">
+ <div class="row">
+ <div class="col-xs-5">
+ {{ .Site.Params.topbar.text | safeHTML }}
+ </div>
+ <div class="col-xs-7">
+ <div class="social">
+ {{ range .Site.Menus.topbar.ByWeight }}
+ <a href="{{ .URL }}" target="_blank" style="opacity: 1;">{{ .Pre }}</a>
+ {{ end }}
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{ end }}
diff --git a/static/js/gmaps.init.js b/static/js/gmaps.init.js
index de77e63..2227dda 100644
--- a/static/js/gmaps.init.js
+++ b/static/js/gmaps.init.js
@@ -9,7 +9,7 @@ function map () {
var lat = $('#gmap-lat').val()
var lng = $('#gmap-lng').val()
var direction = $('#gmap-dir').val()
- var image = '/img/marker.png'
+ var image = $('#gmap-marker').val()
var styles =
[