Merge remote-tracking branch 'refs/remotes/halogenica/master'

# Conflicts:
#	layouts/index.html
This commit is contained in:
Li-Wen Yip 2017-03-08 20:31:31 +00:00
commit b9d04230d9
14 changed files with 78 additions and 73 deletions

View File

@ -1,6 +1,6 @@
+++
title = ""
subtitle = ""
date = "2014-07-11T10:54:24+02:00"
bigimg = ""
+++
---
subtitle: ""
comments:
tags: []
bigimg: [{}]
---

View File

@ -2,6 +2,7 @@ baseurl = "https://username.github.io"
languageCode = "en-us"
title = "Beautiful Hugo"
theme = "beautifulhugo"
metaDataFormat = "yaml"
pygmentsUseClasses = true
pygmentCodeFences = true
#disqusShortname = "XXX"
@ -16,6 +17,16 @@ pygmentCodeFences = true
rss = true
comments = true
#[[Params.bigimg]]
# src = "img/triangle.jpg"
# desc = "Triangle"
#[[Params.bigimg]]
# src = "img/sphere.jpg"
# desc = "Sphere"
#[[Params.bigimg]]
# src = "img/hexagon.jpg"
# desc = "Hexagon"
[Author]
name = "Some Person"
email = "youremail@domain.com"
@ -50,22 +61,22 @@ pygmentCodeFences = true
name = "Samples"
weight = 2
[[menu.main]]
parent = "samples"
name = "Big Image Sample"
url = "/post/2017-03-07-bigimg-sample"
weight = 1
[[menu.main]]
parent = "samples"
name = "Math Sample"
url = "/post/2017-03-05-math-sample"
weight = 1
weight = 2
[[menu.main]]
parent = "samples"
name = "Code Sample"
url = "/post/2016-03-08-code-sample"
weight = 2
[[menu.main]]
parent = "samples"
name = "Test Markdown"
url = "/post/2015-02-20-test-markdown"
weight = 3
[[menu.main]]

View File

@ -2,7 +2,7 @@
title: Flake it till you make it
subtitle: Excerpt from Soulshaping by Jeff Brown
date: 2015-02-26
bigimg: /img/path.jpg
bigimg: [{src: "/img/path.jpg", desc: "Path"}]
---
Under what circumstances should we step off a path? When is it essential that we finish what we start? If I bought a bag of peanuts and had an allergic reaction, no one would fault me if I threw it out. If I ended a relationship with a woman who hit me, no one would say that I had a commitment problem. But if I walk away from a seemingly secure route because my soul has other ideas, I am a flake?

View File

@ -0,0 +1,40 @@
---
title: Big Image Sample
subtitle: Using Multiple Images
date: 2017-03-07
tags: ["example", "bigimg"]
bigimg: [{src: "/img/triangle.jpg", desc: "Triangle"}, {src: "/img/sphere.jpg", desc: "Sphere"}, {src: "/img/hexagon.jpg", desc: "Hexagon"}]
---
The image banners at the top of the page are refered to as "bigimg" in this theme. They are optional, and one more more can be specified. If more than one is specified, the images rotate every 10 seconds. In the front matter, bigimgs are specified using an array of hashes.
<!--more-->
A single bigimg can be specified in the front matter by the following YAML:
```
bigimg: [{src: "/img/triangle.jpg", desc: "Triangle"}]
```
Multiple bigimgs can be specified in the front matter by the following YAML:
```
bigimg: [{src: "/img/triangle.jpg", desc: "Triangle"},
{src: "/img/sphere.jpg", desc: "Sphere"},
{src: "/img/hexagon.jpg", desc: "Hexagon"}]
```
Also note that the description field is optional, and images could instead be specified by:
```
bigimg: [{src: "/img/triangle.jpg"},
{src: "/img/sphere.jpg"},
{src: "/img/hexagon.jpg"}]
```
The above YAML array of hashes were written in "flow" style. However when generating a new page or post with `hugo new post/mypost.md`, hugo may interpret the archetype for bigimg in the default YAML style. Defining multiple bigimg's complete with descriptions in this style would be specified by:
```
bigimg:
- {src: "/img/triangle.jpg", desc: "Triangle"}
- {src: "/img/sphere.jpg", desc: "Sphere"}
- {src: "/img/hexagon.jpg", desc: "Hexagon"}
```
Additional information can be found [in this YAML tutorial](https://rhnh.net/2011/01/31/yaml-tutorial/).

View File

@ -7,12 +7,12 @@
{{ partial "nav.html" . }}
{{ if .Site.Params.bigimg }}
{{ if isset .Site.Params.bigimg 1 }}
<div id="header-big-imgs" data-num-img={{len .Site.Params.bigimg}} {{range $i, $img := .Site.Params.bigimg}}data-img-src-{{add $i 1}}="{{$img.src}}" data-img-desc-{{add $i 1}}="{{$img.desc}}"{{end}}></div>
{{ end }}
<header class="header-section {{ if .Site.Params.bigimg }}has-img{{ end }}">
<div class="intro-header {{ if .Site.Params.bigimg }}big-img{{ else }}no-img{{ end }}">
<header class="header-section {{ if isset .Site.Params.bigimg 1 }}has-img{{ end }}">
<div class="intro-header {{ if isset .Site.Params.bigimg 1 }}big-img{{ else }}no-img{{ end }}">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">

View File

@ -1,4 +1,4 @@
{{ if (.Params.comments) | or (and (not (isset .Params "comments")) (.Site.Params.comments)) }}
{{ if (.Params.comments) | or (and (or (not (isset .Params "comments")) (eq .Params.comments nil)) (.Site.Params.comments)) }}
{{ if .Site.DisqusShortname }}
<div class="comments">
{{ template "_internal/disqus.html" . }}

View File

@ -165,7 +165,7 @@
{{ end }}
{{ if .Site.Params.rss }}
<li>
<a href="{{ .Site.BaseURL}}index.xml" title="RSS">
<a href="{{ .Site.BaseURL}}/index.xml" title="RSS">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-rss fa-stack-1x fa-inverse"></i>

View File

@ -44,7 +44,6 @@
<meta property="og:type" content="website" />
{{ if .Params.id }}
<<<<<<< HEAD
<meta property="og:url" content="{{ .URL | absURL }}" />
<link rel="canonical" href="{{ .URL | absURL }}" />
{{ else }}
@ -58,21 +57,6 @@
<meta property="og:image" content="{{ .Params.bigimg | absURL }}" />
{{ else if .Site.Params.logo }}
<meta property="og:image" content="{{ .Site.Params.logo | absURL }}" />
=======
<meta property="og:url" content="{{ .URL | absURL }}" />
<link rel="canonical" href="{{ .URL | absURL }}" />
{{ else }}
<meta property="og:url" content="{{ .URL | absURL }}" />
<link rel="canonical" href="{{ .URL | absURL }}" />
{{ end }}
{{ if .Params.share_img }}
<meta property="og:image" content="{{ .Params.share_img | absURL }}" />
{{ else if .Params.bigimg }}
<meta property="og:image" content="{{ .Params.bigimg | absURL }}" />
{{ else if .Site.Params.logo }}
<meta property="og:image" content="{{ .Site.Params.logo | absURL }}" />
>>>>>>> refs/remotes/halogenica/master
{{ end }}
<!-- Twitter summary cards -->
@ -81,30 +65,6 @@
<meta name="twitter:creator" content="@{{ .Site.Author.twitter }}" />
{{ if .Params.meta_title }}
<<<<<<< HEAD
<meta name="twitter:title" content="{{ .Params.meta_title }}" />
{{ else if .Title }}
<meta name="twitter:title" content="{{ .Title }}" />
{{ else }}
<meta name="twitter:title" content="{{ .Site.Title }}" />
{{ end }}
{{ if .Params.meta_description }}
<meta name="twitter:description" content="{{ .Params.meta_description }}">
{{ else if .Params.subtitle }}
<meta name="twitter:description" content="{{ .Params.subtitle }}">
{{ else }}
<meta name="twitter:description" content="{{ .Content | plainify | htmlEscape | truncate 200 }}">
{{ end }}
{{ if .Params.share_img }}
<meta name="twitter:image" content="{{ .Params.share_img }}" />
{{ else if .Params.bigimg }}
<meta name="twitter:image" content="{{ .Params.bigimg | absURL }}" />
{{ else if .Site.Params.logo }}
<meta name="twitter:image" content="{{ .Site.Params.logo | absURL }}" />
{{ end }}
=======
<meta name="twitter:title" content="{{ .Params.meta_title }}" />
{{ else if .Title }}
<meta name="twitter:title" content="{{ .Title }}" />
@ -127,6 +87,5 @@
{{ else if .Site.Params.logo }}
<meta name="twitter:image" content="{{ .Site.Params.logo | absURL }}" />
{{ end }}
>>>>>>> refs/remotes/halogenica/master
</head>

View File

@ -1,17 +1,12 @@
{{ if or .Params.bigimg .Title }}
{{ if .Params.bigimg }}
<div id="header-big-imgs" data-num-img=1 data-img-src-1="{{.Params.bigimg}}"></div>
{{ if isset .Params.bigimg 1 }}
<div id="header-big-imgs" data-num-img={{len .Params.bigimg}} {{range $i, $img := .Params.bigimg}}data-img-src-{{add $i 1}}="{{$img.src}}" {{ if $img.desc}}data-img-desc-{{add $i 1}}="{{$img.desc}}"{{end}}{{end}}></div>
{{ end }}
<header class="header-section {{ if .Params.bigimg }}has-img{{ end }}">
{{ if .Params.bigimg }}
<div class="big-img intro-header">
{{ partial "header.html" . }}
<span class='img-desc'></span>
</div>
{{ end }}
<div class="intro-header no-img">
<header class="header-section {{ if isset .Params.bigimg 1 }}has-img{{ end }}">
<div class="intro-header {{ if isset .Params.bigimg 1 }}big-img{{ else }}no-img{{ end }}">
{{ partial "header.html" . }}
<span class="img-desc" style="display: inline;"></span>
</div>
</header>
{{ else }}

View File

@ -2,7 +2,7 @@
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
{{ .Content }}
{{ if (.Params.comments) | or (and (not (isset .Params "comments")) (.Site.Params.comments)) }}
{{ if (.Params.comments) | or (and (or (not (isset .Params "comments")) (eq .Params.comments nil)) (.Site.Params.comments)) }}
{{ if .Site.DisqusShortname }}
<div class="disqus-comments">
{{ template "_internal/disqus.html" . }}

View File

@ -18,7 +18,7 @@
{{ end }}
</ul>
{{ if (.Params.comments) | or (and (not (isset .Params "comments")) (.Site.Params.comments)) }}
{{ if (.Params.comments) | or (and (or (not (isset .Params "comments")) (eq .Params.comments nil)) (.Site.Params.comments)) }}
{{ if .Site.DisqusShortname }}
<div class="disqus-comments">
{{ template "_internal/disqus.html" . }}

BIN
static/img/hexagon.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

BIN
static/img/sphere.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
static/img/triangle.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB