Bootstrap \o/

This commit is contained in:
Wilfried OLLIVIER 2017-09-03 18:13:29 +02:00
commit f5391008e6
78 changed files with 5134 additions and 0 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "beautifulhugo"]
path = beautifulhugo
url = https://github.com/halogenica/beautifulhugo.git

19
Readme.md Normal file
View file

@ -0,0 +1,19 @@
# Blog
## Tools
* Hugo : https://gohugo.io
* Blog theme : https://github.com/halogenica/beautifulhugo
* pygments (python package) for syntax coloration
## Run, check
hugo server -D
## Generate
# in order to add git commit on blog pages
EXPORT GIT_COMMIT_SHA=`git rev-parse --verify HEAD`
EXPORT GIT_COMMIT_SHA_SHORT=`git rev-parse --short HEAD`
# gen blog inside ./static folder
hugo

6
archetypes/default.md Normal file
View file

@ -0,0 +1,6 @@
---
title: "{{ replace .TranslationBaseName "-" " " | title }}"
date: {{ .Date }}
draft: true
---

1
beautifulhugo Submodule

@ -0,0 +1 @@
Subproject commit b760205613cde1527fff49f8d1a3587fe9e6cedc

35
config.toml Normal file
View file

@ -0,0 +1,35 @@
baseurl = "https://blog.papey.fr"
DefaultContentLanguage = "en"
title = "import {} from 'blog';"
theme = "beautifulhugo"
metaDataFormat = "yaml"
pygmentsUseClasses = true
pygmentCodeFences = true
[Params]
subtitle = "Articles about stuff I use or build…"
logo = "img/avatar-icon.png"
favicon = "img/favicon.ico"
commit = true
rss = true
comments = false
[Author]
name = "Wilfried OLLIVIER"
website = "papey.fr"
email = "wollivier@fdn.fr"
github = "papey"
twitter = "MarcelMonfort"
stackoverflow = "users/7925197/papey"
spotify = "MarcelMonfort"
telegram = "@P4p3y"
[[menu.main]]
name = "Blog"
url = ""
weight = 1
[[menu.main]]
name = "Tags"
url = "tags"
weight = 3

17
themes/beautifulhugo/.gitattributes vendored Normal file
View file

@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

50
themes/beautifulhugo/.gitignore vendored Normal file
View file

@ -0,0 +1,50 @@
# Themes directory of example site; ignored so that we can clone the repo
# inside the themes directory and test the example site with "hugo server".
exampleSite/themes/
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
# Vim swap files
*.swp
# =========================
# Operating System Files
# =========================
# OSX
# =========================
.DS_Store
.AppleDouble
.LSOverride
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

View file

@ -0,0 +1,22 @@
The MIT License (MIT)
Original work Copyright (c) 2015 Dean Attali
Modified work Copyright (c) 2017 Michael Romero
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,67 @@
# Beautiful Hugo - A port of Beautiful Jekyll Theme
![Beautiful Hugo Theme Screenshot](https://github.com/halogenica/beautifulhugo/blob/master/images/screenshot.png)
## Installation
$ mkdir themes
$ cd themes
$ git clone https://github.com/halogenica/beautifulhugo.git beautifulhugo
See [the Hugo documentation](http://gohugo.io/themes/installing/) for more information.
## Extra Features
### Responsive
This theme is designed to look great on both large-screen and small-screen (mobile) devices.
### Syntax highlighting
This theme has support for both server side and client side highlighting.
#### Server side syntax highlighting
Use the `highlight` shortcode (with Pygments),
see [the Hugo documentation](http://gohugo.io/extras/highlighting/) for more information.
To use this feature install Pygments (`pip install Pygments`) and add `pygmentsuseclasses = true` to your `config.toml`.
#### Client side syntax highlighting
Use triple backticks ( ``` ) or triple tilde ( ~~~ ) around code blocks.
Client side highlighting does not require pygments to be installed.
### Disqus support
To use this feature, uncomment and fill out the `disqusShortname` parameter in `config.toml`.
### Google Analytics
To add Google Analytics, simply sign up to [Google Analytics](http://www.google.com/analytics/) to obtain your Google Tracking ID, and add this tracking ID to the `googleAnalytics` parameter in `config.toml`.
### Commit SHA on the footer
If the source of your site is in a Git repo, the SHA corresponding to the commit the site is built from can be shown on the footer. To do so, two environment variables have to be set (`GIT_COMMIT_SHA` and `GIT_COMMIT_SHA_SHORT`) and parameter `commit` has to be defined in the config file:
```
[Params]
commit = "https://github.com/<username>/<siterepo>/tree/"
```
This can be achieved by running the next command prior to calling Hugo:
```
GIT_COMMIT_SHA=`git rev-parse --verify HEAD` GIT_COMMIT_SHA_SHORT=`git rev-parse --short HEAD`
```
See at [xor-gate/xor-gate.org](https://github.com/xor-gate/xor-gate.org) an example of how to add it to a continuous integration system.
## About
This is a port of the Jekyll theme [Beautiful Jekyll](http://deanattali.com/beautiful-jekyll/) by [Dean Attali](http://deanattali.com/aboutme#contact). It supports most of the features of the original theme.
## License
MIT Licensed, see [LICENSE](https://github.com/halogenica/Hugo-BeautifulHugo/blob/master/LICENSE).

View file

@ -0,0 +1,6 @@
---
title: "{{ replace .TranslationBaseName "-" " " | title }}"
date: {{ .Date }}
subtitle: ""
tags: []
---

View file

@ -0,0 +1 @@
./beautifulhugo

View file

@ -0,0 +1,125 @@
[[social_icons]]
id = "email"
url = "mailto:%s"
title = "Email me"
icon = "fa-envelope"
[[social_icons]]
id = "facebook"
url = "https://www.facebook.com/%s"
title = "Facebook"
icon = "fa-facebook"
[[social_icons]]
id = "googleplus"
url = "https://plus.google.com/%s"
title = "Google+"
icon = "fa-google-plus"
[[social_icons]]
id = "github"
url = "https://github.com/%s"
title = "GitHub"
icon = "fa-github"
[[social_icons]]
id = "gitlab"
url = "https://gitlab.com/%s"
title = "GitLab"
icon = "fa-gitlab"
[[social_icons]]
id = "twitter"
url = "https://twitter.com/%s"
title = "Twitter"
icon = "fa-twitter"
[[social_icons]]
id = "reddit"
url = "https://reddit.com/u/%s"
title = "Reddit"
icon = "fa-reddit-alien"
[[social_icons]]
id = "linkedin"
url = "https://linkedin.com/in/%s"
title = "LinkedIn"
icon = "fa-linkedin"
[[social_icons]]
id = "xing"
url = "https://www.xing.com/profile/%s"
title = "Xing"
icon = "fa-xing"
[[social_icons]]
id = "stackoverflow"
url = "https://stackoverflow.com/%s"
title = "StackOverflow"
icon = "fa-stack-overflow"
[[social_icons]]
id = "snapchat"
url = "https://www.snapchat.com/add/%s"
title = "Snapchat"
icon = "fa-snapchat-ghost"
[[social_icons]]
id = "instagram"
url = "https://www.instagram.com/%s"
title = "Instagram"
icon = "fa-instagram"
[[social_icons]]
id = "youtube"
url = "https://www.youtube.com/%s"
title = "Youtube"
icon = "fa-youtube"
[[social_icons]]
id = "soundcloud"
url = "https://soundcloud.com/%s"
title = "SoundCloud"
icon = "fa-soundcloud"
[[social_icons]]
id = "spotify"
url = "https://open.spotify.com/user/%s"
title = "Spotify"
icon = "fa-spotify"
[[social_icons]]
id = "bandcamp"
url = "https://%s.bandcamp.com/"
title = "Bandcamp"
icon = "fa-bandcamp"
[[social_icons]]
id = "itchio"
url = "https://itch.io/profile/%s"
title = "Itch.io"
icon = "fa-gamepad"
[[social_icons]]
id = "keybase"
url = "https://keybase.io/%s"
title = "Keybase"
icon = "fa-key"
[[social_icons]]
id = "vk"
url = "https://vk.com/%s"
title = "VK"
icon = "fa-vk"
[[social_icons]]
id = "paypal"
url = "https://paypal.me/%s"
title = "PayPal"
icon = "fa-paypal"
[[social_icons]]
id = "telegram"
url = "https://telegram.me/%s"
title = "Telegram"
icon = "fa-telegram"

View file

@ -0,0 +1,92 @@
baseurl = "https://username.github.io"
DefaultContentLanguage = "en"
#DefaultContentLanguage = "ja"
title = "Beautiful Hugo"
theme = "beautifulhugo"
metaDataFormat = "yaml"
pygmentsUseClasses = true
pygmentCodeFences = true
#disqusShortname = "XXX"
#googleAnalytics = "XXX"
[Params]
subtitle = "Build a beautiful and simple website in minutes"
logo = "img/avatar-icon.png"
favicon = "img/favicon.ico"
dateFormat = "January 2, 2006"
commit = false
rss = true
comments = true
# gcse = "012345678901234567890:abcdefghijk" # Get your code from google.com/cse. Make sure to go to "Look and Feel" and change Layout to "Full Width" and Theme to "Classic"
#[[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"
website = "yourwebsite.com"
email = "youremail@domain.com"
facebook = "username"
googleplus = "+username" # or xxxxxxxxxxxxxxxxxxxxx
github = "username"
gitlab = "username"
twitter = "username"
reddit = "username"
linkedin = "username"
xing = "username"
stackoverflow = "users/XXXXXXX/username"
snapchat = "username"
instagram = "username"
youtube = "user/username" # or channel/channelname
soundcloud = "username"
spotify = "username"
bandcamp = "username"
itchio = "username"
vk = "username"
paypal = "username"
telegram = "username"
[[menu.main]]
name = "Blog"
url = ""
weight = 1
[[menu.main]]
name = "About"
url = "page/about/"
weight = 3
[[menu.main]]
identifier = "samples"
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 = 2
[[menu.main]]
parent = "samples"
name = "Code Sample"
url = "post/2016-03-08-code-sample"
weight = 3
[[menu.main]]
name = "Tags"
url = "tags"
weight = 3

View file

@ -0,0 +1,2 @@
## Front Page Content
`beautifulhugo` supports content on your front page. Edit `/content/_index.md` to change what appears here. Delete `/content/_index.md` if you don't want any content here.

View file

@ -0,0 +1,16 @@
---
title: About me
subtitle: Why you'd want to go on a date with me
comments: false
---
My name is Inigo Montoya. I have the following qualities:
- I rock a great mustache
- I'm extremely loyal to my family
What else do you need?
### my history
To be honest, I'm having some trouble remembering right now, so why don't you just watch [my movie](http://en.wikipedia.org/wiki/The_Princess_Bride_%28film%29) and it will answer **all** your questions.

View file

@ -0,0 +1,6 @@
---
title: First post!
date: 2015-01-05
---
This is my first post, how exciting!

View file

@ -0,0 +1,6 @@
---
title: Pirates arrrr
date: 2015-01-15
---
Piracy is typically an act of robbery or criminal violence at sea. The term can include acts committed on land, in the air, or in other major bodies of water or on a shore. It does not normally include crimes committed against persons traveling on the same vessel as the perpetrator (e.g. one passenger stealing from others on the same vessel). The term has been used throughout history to refer to raids across land borders by non-state agents.

View file

@ -0,0 +1,11 @@
---
title: Soccer
subtitle: Best sport ever!
date: 2015-01-19
---
From Wikipedia:
Association football, more commonly known as football or soccer,[2] is a sport played between two teams of eleven players with a spherical ball. It is played by 250 million players in over 200 countries, making it the world's most popular sport.[3][4][5][6] The game is played on a rectangular field with a goal at each end. The object of the game is to score by getting the ball into the opposing goal.
The goalkeepers are the only players allowed to touch the ball with their hands or arms while it is in play and then only in their penalty area. Outfield players mostly use their feet to strike or pass the ball, but may use their head or torso to strike the ball instead. The team that scores the most goals by the end of the match wins. If the score is level at the end of the game, either a draw is declared or the game goes into extra time and/or a penalty shootout depending on the format of the competition. The Laws of the Game were originally codified in England by The Football Association in 1863. Association football is governed internationally by the International Federation of Association Football (FIFA; French: Fédération Internationale de Football Association) which organises a World Cup every four years.[7]

View file

@ -0,0 +1,6 @@
---
title: Dear diary
date: 2015-01-27
---
What is it with that Mary girl? Dragging me to school every day. As if I had a choice. What you don't hear in those nursery rhymes is that she starves me if I don't go to school with her; it's the only way I can stay alive! I'm thinking about being adopted by Little Bo Peep, sure I may get lost, but anything is better than being with Mary and those little brats at school (shudder, shudder).

View file

@ -0,0 +1,41 @@
---
title: To be
subtitle: ... or not to be?
date: 2015-02-13
---
To be, or not to be--that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune
Or to take arms against a sea of troubles
And by opposing end them. To die, to sleep--
No more--and by a sleep to say we end
The heartache, and the thousand natural shocks
That flesh is heir to. 'Tis a consummation
Devoutly to be wished. To die, to sleep--
To sleep--perchance to dream: ay, there's the rub,
For in that sleep of death what dreams may come
When we have shuffled off this mortal coil,
Must give us pause. There's the respect
That makes calamity of so long life.
For who would bear the whips and scorns of time,
Th' oppressor's wrong, the proud man's contumely
The pangs of despised love, the law's delay,
The insolence of office, and the spurns
That patient merit of th' unworthy takes,
When he himself might his quietus make
With a bare bodkin? Who would fardels bear,
To grunt and sweat under a weary life,
But that the dread of something after death,
The undiscovered country, from whose bourn
No traveller returns, puzzles the will,
And makes us rather bear those ills we have
Than fly to others that we know not of?
Thus conscience does make cowards of us all,
And thus the native hue of resolution
Is sicklied o'er with the pale cast of thought,
And enterprise of great pitch and moment
With this regard their currents turn awry
And lose the name of action. -- Soft you now,
The fair Ophelia! -- Nymph, in thy orisons
Be all my sins remembered.

View file

@ -0,0 +1,35 @@
---
title: Test markdown
subtitle: Each post also has a subtitle
date: 2015-02-20
tags: ["example", "markdown"]
---
You can write regular [markdown](http://markdowntutorial.com/) here and Jekyll will automatically convert it to a nice webpage. I strongly encourage you to [take 5 minutes to learn how to write in markdown](http://markdowntutorial.com/) - it'll teach you how to transform regular text into bold/italics/headings/tables/etc.
**Here is some bold text**
## Here is a secondary heading
Here's a useless table:
| Number | Next number | Previous number |
| :------ |:--- | :--- |
| Five | Six | Four |
| Ten | Eleven | Nine |
| Seven | Eight | Six |
| Two | Three | One |
How about a yummy crepe?
![Crepe](http://s3-media3.fl.yelpcdn.com/bphoto/cQ1Yoa75m2yUFFbY2xwuqw/348s.jpg)
Here's a code chunk with syntax highlighting:
```javascript
var foo = function(x) {
return(x + 5);
}
foo(3)
```

View file

@ -0,0 +1,14 @@
---
title: Flake it till you make it
subtitle: Excerpt from Soulshaping by Jeff Brown
date: 2015-02-26
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?
The truth is that no one else can definitively know the path we are here to walk. Its tempting to listen—many of us long for the omnipotent other—but unless they are genuine psychic intuitives, they cant know. All others can know is their own truth, and if theyve actually done the work to excavate it, they will have the good sense to know that they cannot genuinely know anyone elses. Only soul knows the path it is here to walk. Since you are the only one living in your temple, only you can know its scriptures and interpretive structure.
At the heart of the struggle are two very different ideas of success—survival-driven and soul-driven. For survivalists, success is security, pragmatism, power over others. Success is the absence of material suffering, the nourishing of the soul be damned. It is an odd and ironic thing that most of the material power in our world often resides in the hands of younger souls. Still working in the egoic and material realms, they love the sensations of power and focus most of their energy on accumulation. Older souls tend not to be as materially driven. They have already played the worldly game in previous lives and they search for more subtle shades of meaning in this one—authentication rather than accumulation. They are often ignored by the culture at large, although they really are the truest warriors.
A soulful notion of success rests on the actualization of our innate image. Success is simply the completion of a soul step, however unsightly it may be. We have finished what we started when the lesson is learned. What a fear-based culture calls a wonderful opportunity may be fruitless and misguided for the soul. Staying in a passionless relationship may satisfy our need for comfort, but it may stifle the soul. Becoming a famous lawyer is only worthwhile if the soul demands it. It is an essential failure if you are called to be a monastic this time around. If you need to explore and abandon ten careers in order to stretch your soul toward its innate image, then so be it. Flake it till you make it.

View file

@ -0,0 +1,42 @@
---
title: Code Sample
subtitle: Using Hugo or Pygments
date: 2016-03-08
tags: ["example", "code"]
---
The following are two code samples using syntax highlighting.
<!--more-->
The following is a code sample using triple backticks ( ``` ) code fencing provided in Hugo. This is client side highlighting and does not require any special installation.
```javascript
var num1, num2, sum
num1 = prompt("Enter first number")
num2 = prompt("Enter second number")
sum = parseInt(num1) + parseInt(num2) // "+" means "add"
alert("Sum = " + sum) // "+" means combine into a string
```
The following is a code sample using the "highlight" shortcode provided in Hugo. This is server side highlighting and requires Python and Pygments to be installed.
{{< highlight javascript >}}
var num1, num2, sum
num1 = prompt("Enter first number")
num2 = prompt("Enter second number")
sum = parseInt(num1) + parseInt(num2) // "+" means "add"
alert("Sum = " + sum) // "+" means combine into a string
{{</ highlight >}}
And here is the same code with line numbers:
{{< highlight javascript "linenos=inline">}}
var num1, num2, sum
num1 = prompt("Enter first number")
num2 = prompt("Enter second number")
sum = parseInt(num1) + parseInt(num2) // "+" means "add"
alert("Sum = " + sum) // "+" means combine into a string
{{</ highlight >}}

View file

@ -0,0 +1,49 @@
---
title: Math Sample
subtitle: Using KaTeX
date: 2017-03-05
tags: ["example", "math"]
---
KaTeX can be used to generate complex math formulas server-side.
$$
\phi = \frac{(1+\sqrt{5})}{2} = 1.6180339887\cdots
$$
Additional details can be found on [GitHub](https://github.com/Khan/KaTeX) or on the [Wiki](http://tiddlywiki.com/plugins/tiddlywiki/katex/).
<!--more-->
### Example 1
If the text between $$ contains newlines it will rendered in display mode:
```
$$
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
$$
```
$$
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
$$
### Example 2
```
$$
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }
$$
```
$$
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }
$$
### Example 3
```
$$
1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1.
$$
```
$$
1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1.
$$

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

@ -0,0 +1,37 @@
---
title: Photoswipe Gallery Sample
subtitle: Making a Gallery
date: 2017-03-20
tags: ["example", "photoswipe"]
---
Beautiful Hugo adds a few custom shortcodes created by [Li-Wen Yip](https://www.liwen.id.au/heg/) and [Gert-Jan van den Berg](https://github.com/GjjvdBurg/HugoPhotoSwipe) for making galleries with [PhotoSwipe](http://photoswipe.com) .
{{< gallery caption-effect="fade" >}}
{{< figure thumb="-thumb" link="/img/hexagon.jpg" >}}
{{< figure thumb="-thumb" link="/img/sphere.jpg" caption="Sphere" >}}
{{< figure thumb="-thumb" link="/img/triangle.jpg" caption="Triangle" alt="This is a long comment about a triangle" >}}
{{< /gallery >}}
<!--more-->
## Example
The above gallery was created using the following shortcodes:
```
{{</* gallery caption-effect="fade" */>}}
{{</* figure thumb="-thumb" link="/img/hexagon.jpg" */>}}
{{</* figure thumb="-thumb" link="/img/sphere.jpg" caption="Sphere" */>}}
{{</* figure thumb="-thumb" link="/img/triangle.jpg" caption="Triangle" alt="This is a long comment about a triangle" */>}}
{{</* /gallery */>}}
```
## Usage
For full details please see the [hugo-easy-gallery GitHub](https://github.com/liwenyip/hugo-easy-gallery/) page. Basic usages from above are:
- Create a gallery with open and close tags `{{</* gallery */>}}` and `{{</* /gallery */>}}`
- `{{</* figure src="image.jpg" */>}}` will use `image.jpg` for thumbnail and lightbox
- `{{</* figure src="thumb.jpg" link="image.jpg" */>}}` will use `thumb.jpg` for thumbnail and `image.jpg` for lightbox
- `{{</* figure thumb="-small" link="image.jpg" */>}}` will use `image-small.jpg` for thumbnail and `image.jpg` for lightbox
- All the [features/parameters](https://gohugo.io/extras/shortcodes) of Hugo's built-in `figure` shortcode work as normal, i.e. src, link, title, caption, class, attr (attribution), attrlink, alt
- `{{</* gallery caption-effect="fade" */>}}` will fade in captions for all figures in this gallery instead of the default slide-up behavior
- Many gallery styles for captions and hover effects exist; view the [hugo-easy-gallery GitHub](https://github.com/liwenyip/hugo-easy-gallery/) for all options
- Note that this theme will load the photoswipe gallery theme and scripts by default, no need to load photoswipe on your individual pages

View file

@ -0,0 +1,7 @@
<!--
If you want to include any custom html just before </body>, put it in this file.
Or you can delete these file if you don't need it.
-->
<!-- for example, you could include some js libraries:
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.19.1/vis.js" integrity="sha256-HdIuWBZj4eftihsoDCJoMYjZi6aNVaw7YlUpzKT3ZxI=" crossorigin="anonymous"></script>
-->

View file

@ -0,0 +1,18 @@
<!--
If you want to include any custom html just before </head>, put it in this file.
Or you can delete these file if you don't need it.
-->
<!-- for example, you could insert this custom css, which makes the bigimg not stretch:
<style>
.intro-header.big-img, .intro-header.big-img .big-img-transition {
-webkit-background-size: contain !important;
-moz-background-size: contain !important;
background-size: contain !important;
-o-background-size: contain !important;
background-color: lightgrey;
}
</style>
-->
<!-- or you could include some additional css libraries:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.19.1/vis.css" integrity="sha256-I1UoFd33KHIydu88R9owFaQWzwkiZV4hXXug5aYaM28=" crossorigin="anonymous" />
-->

View file

@ -0,0 +1,39 @@
# Content
- id: dateFormat
translation: "02.01.2006"
- id: postedOnDate
translation: "Gepostet am {{ .Count }}"
- id: translationsLabel
translation: "Andere Sprachen: "
- id: translationsSeparator
translation: ", "
- id: readMore
translation: "Mehr"
- id: olderPosts
translation: "Ältere Posts"
- id: newerPosts
translation: "Neuere Posts"
- id: previousPost
translation: "Letzter Post"
- id: nextPost
translation: "Nächster Post"
# 404 page
- id: pageNotFound
translation: "Ups, diese Seite existiert nicht. (404 Error)"
# Footer
- id: poweredBy # Accepts HTML
translation: '<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> powered &nbsp;&bull;&nbsp; Theme by <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapted to <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
# Navigation
- id: toggleNavigation
translation: "Navigation"
- id: languageSwitcherLabel
translation: "Sprache"
- id: gcseLabelShort
translation: "Suche"
- id: gcseLabelLong
translation: "Suche {{ .Site.Title }}"
- id: gcseClose
translation: "Schließen"

View file

@ -0,0 +1,40 @@
# Content
- id: dateFormat
translation: "January 2, 2006"
- id: postedOnDate
translation: "Posted on {{ .Count }}"
- id: translationsLabel
translation: "Other languages: "
- id: translationsSeparator
translation: ", "
- id: readMore
translation: "Read More"
- id: olderPosts
translation: "Older Posts"
- id: newerPosts
translation: "Newer Posts"
- id: previousPost
translation: "Previous Post"
- id: nextPost
translation: "Next Post"
# 404 page
- id: pageNotFound
translation: "Whoops, this page doesn't exist. Move along. (404 error)"
# Footer
- id: poweredBy # Accepts HTML
translation: '<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> powered &nbsp;&bull;&nbsp; Theme by <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapted to <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
# Navigation
- id: toggleNavigation
translation: "Toggle navigation"
- id: languageSwitcherLabel
translation: "Language"
- id: gcseLabelShort
translation: "Search"
- id: gcseLabelLong
translation: "Search {{ .Site.Title }}"
- id: gcseClose
translation: "Close"

View file

@ -0,0 +1,38 @@
# Content
- id: dateFormat
translation: "2006年1月2日"
- id: postedOnDate
translation: "{{ .Count }}に投稿"
- id: translationsLabel
translation: "翻訳:"
- id: translationsSeparator
translation: "・"
- id: readMore
translation: "続きを読む"
- id: olderPosts
translation: "古いページ"
- id: newerPosts
translation: "新しいページ"
- id: previousPost
translation: "前ページ"
- id: nextPost
translation: "次ページ"
# 404 page
- id: pageNotFound
translation: "おっと、このページが存在しない。他にあたってください。404エラー"
# Footer
- id: poweredBy # Accepts HTML
translation: '起動力に<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> &nbsp;&bull;&nbsp; テーマに<a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>に基づいている<a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
# Navigation
- id: toggleNavigation
translation: "メニューを切り替え"
- id: gcseLabelShort
translation: "検索"
- id: gcseLabelLong
translation: "{{ .Site.Title }}を検索"
- id: gcseClose
translation: "閉じる"

View file

@ -0,0 +1,40 @@
# Content
- id: dateFormat
translation: "Январь 2, 2006"
- id: postedOnDate
translation: "Опубликовано {{ .Count }}"
- id: translationsLabel
translation: "Другие языки: "
- id: translationsSeparator
translation: ", "
- id: readMore
translation: "Далее"
- id: olderPosts
translation: "Предыдущие записи"
- id: newerPosts
translation: "Новые записи"
- id: previousPost
translation: "Предыдущий"
- id: nextPost
translation: "Следующий"
# 404 page
- id: pageNotFound
translation: "Уууупс, страница не найдена. Поищите ещё. (ошибка 404)"
# Footer
- id: poweredBy # Accepts HTML
translation: 'На базе <a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> &nbsp;&bull;&nbsp; Тема <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a> на базе <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>'
# Navigation
- id: toggleNavigation
translation: "Навигация"
- id: languageSwitcherLabel
translation: "Язык"
- id: gcseLabelShort
translation: "Поиск"
- id: gcseLabelLong
translation: "Поиск по {{ .Site.Title }}"
- id: gcseClose
translation: "Закрыть"

View file

@ -0,0 +1,40 @@
# Content
- id: dateFormat
translation: "January 2, 2006"
- id: postedOnDate
translation: "发表于 {{ .Count }}"
- id: translationsLabel
translation: "其它语言: "
- id: translationsSeparator
translation: ", "
- id: readMore
translation: "阅读全文"
- id: olderPosts
translation: "下一页"
- id: newerPosts
translation: "上一页"
- id: previousPost
translation: "前一篇"
- id: nextPost
translation: "后一篇"
# 404 page
- id: pageNotFound
translation: "啊哦,这篇文章不存在。 (404 错误)"
# Footer
- id: poweredBy # Accepts HTML
translation: '由 <a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> 强力驱动 &nbsp;&bull;&nbsp; 主题 <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a> 移植自 <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>'
# Navigation
- id: toggleNavigation
translation: "切换导航"
- id: languageSwitcherLabel
translation: "语言"
- id: gcseLabelShort
translation: "搜索"
- id: gcseLabelLong
translation: "搜索 {{ .Site.Title }}"
- id: gcseClose
translation: "关闭"

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View file

@ -0,0 +1,11 @@
{{ define "header" }}<!-- No header on 404 pages -->{{ end }}
{{ define "main" }}
<div role="main" class="container main-content">
<div class="text-center">
<h1>{{ i18n "pageNotFound" }}</h1>
<br/>
<img src="{{ .Site.BaseURL }}/img/404-southpark.jpg" />
</div>
</div>
{{ end }}

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="{{ .Lang }}">
{{ partial "head.html" . }}
<body>
{{ partial "nav.html" . }}
{{ block "header" . }}{{ partial "header.html" . }}{{ end }}
{{ block "main" . }}{{ end }}
{{ partial "footer.html" . }}
</body>
</html>

View file

@ -0,0 +1,80 @@
{{ define "header" }}
<header class="header-section ">
<div class="intro-header no-img">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="page-heading">
<h1>{{ if .Data.Singular }}#{{ end }}{{ .Title }}</h1>
<hr class="small">
</div>
</div>
</div>
</div>
</div>
</header>
{{ end }}
{{ define "main" }}
<div class="container" role="main">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
{{ with .Content }}
<div class="well">
{{.}}
</div>
{{ end }}
<div class="posts-list">
{{ range .Paginator.Pages }}
<article class="post-preview">
<a href="{{ .Permalink }}">
<h2 class="post-title">{{ .Title }}</h2>
{{ if .Params.subtitle }}
<h3 class="post-subtitle">
{{ .Params.subtitle }}
</h3>
{{ end }}
</a>
<p class="post-meta">
{{ default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format | i18n "postedOnDate" }}
</p>
<div class="post-entry">
{{ if .Truncated }}
{{ .Summary }}
<a href="{{ .Permalink }}" class="post-read-more">[{{ i18n "readMore" }}]</a>
{{ else }}
{{ .Content }}
{{ end }}
</div>
{{ if .Params.tags }}
<span class="post-meta">
{{ range .Params.tags }}
#<a href="{{ $.Site.LanguagePrefix | absURL }}tags/{{ . | urlize }}/">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
</article>
{{ end }}
</div>
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
<ul class="pager main-pager">
{{ if .Paginator.HasPrev }}
<li class="previous">
<a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}">&larr; {{ i18n "newerPosts" }}</a>
</li>
{{ end }}
{{ if .Paginator.HasNext }}
<li class="next">
<a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}">{{ i18n "olderPosts" }} &rarr;</a>
</li>
{{ end }}
</ul>
{{ end }}
</div>
</div>
</div>
{{ end }}

View file

@ -0,0 +1,33 @@
{{ define "main" }}
<div class="container" role="main">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<article role="main" class="blog-post">
{{ .Content }}
</article>
<ul class="pager blog-pager">
{{ if .PrevInSection }}
<li class="previous">
<a href="{{ .PrevInSection.Permalink }}" data-toggle="tooltip" data-placement="top" title="{{ .PrevInSection.Title }}">&larr; {{ i18n "previousPost" }}</a>
</li>
{{ end }}
{{ if .NextInSection }}
<li class="next">
<a href="{{ .NextInSection.Permalink }}" data-toggle="tooltip" data-placement="top" title="{{ .NextInSection.Title }}">{{ i18n "nextPost" }} &rarr;</a>
</li>
{{ end }}
</ul>
{{ 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" . }}
</div>
{{ end }}
{{ end }}
</div>
</div>
</div>
{{ end }}

View file

@ -0,0 +1,14 @@
{{ define "main" }}
{{ $data := .Data }}
<div class="container" role="main">
<article class="post-preview">
<div class="list-group col-lg-4 col-lg-offset-4 col-md-6 col-md-offset-3">
{{ range $key, $value := .Data.Terms.ByCount }}
<a href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/" class="list-group-item">
{{ $value.Name }}<span class="badge">{{ $value.Count }}</span></a>
{{ end }}
</div>
</article>
</div>
{{ end }}

View file

@ -0,0 +1,63 @@
{{ define "main" }}
<div role="main" class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
{{ with .Content }}
<div class="well">
{{.}}
</div>
{{ end }}
<div class="posts-list">
{{ $pag := .Paginate (where .Data.Pages "Type" "post") }}
{{ range $pag.Pages }}
<article class="post-preview">
<a href="{{ .Permalink }}">
<h2 class="post-title">{{ .Title }}</h2>
{{ if .Params.subtitle }}
<h3 class="post-subtitle">
{{ .Params.subtitle }}
</h3>
{{ end }}
</a>
{{ partial "post_meta.html" . }}
<div class="post-entry">
{{ if .Truncated }}
{{ .Summary }}
<a href="{{ .Permalink }}" class="post-read-more">[{{ i18n "readMore" }}]</a>
{{ else }}
{{ .Content }}
{{ end }}
</div>
{{ if .Params.tags }}
<span class="post-meta">
{{ range .Params.tags }}
#<a href="{{ $.Site.LanguagePrefix | absURL }}tags/{{ . | urlize }}/">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
</article>
{{ end }}
</div>
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
<ul class="pager main-pager">
{{ if .Paginator.HasPrev }}
<li class="previous">
<a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}">&larr; {{ i18n "newerPosts" }}</a>
</li>
{{ end }}
{{ if .Paginator.HasNext }}
<li class="next">
<a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}">{{ i18n "olderPosts" }} &rarr;</a>
</li>
{{ end }}
</ul>
{{ end }}
</div>
</div>
</div>
{{ end }}

View file

@ -0,0 +1,7 @@
{{ 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" . }}
</div>
{{ end }}
{{ end }}

View file

@ -0,0 +1,82 @@
<footer>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<ul class="list-inline text-center footer-links">
{{ range .Site.Data.beautifulhugo.social.social_icons }}
{{- if isset $.Site.Author .id }}
<li>
<a href="{{ printf .url (index $.Site.Author .id) }}" title="{{ .title }}">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa {{ .icon }} fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
{{- end -}}
{{ end }}
{{ if .Site.Params.rss }}
<li>
<a href="{{ "index.xml" | absLangURL }}" 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>
</span>
</a>
</li>
{{ end }}
</ul>
<p class="credits copyright text-muted">
{{ if .Site.Author.name }}
{{ if .Site.Author.website }}
<a href="{{ .Site.Author.website }}">{{ .Site.Author.name }}</a>
{{ else }}
{{ .Site.Author.name }}
{{ end }}
{{ end }}
&nbsp;&bull;&nbsp;
{{ .Site.LastChange.Format "2006" }}
{{ if .Site.Title }}
&nbsp;&bull;&nbsp;
<a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a>
{{ end }}
</p>
<!-- Please don't remove this, keep my open source work credited :) -->
<p class="credits theme-by text-muted">
{{ i18n "poweredBy" . | safeHTML }}
{{ with .Site.Params.commit }}&nbsp;&bull;&nbsp;[<a href="{{.}}{{ getenv "GIT_COMMIT_SHA" }}">{{ getenv "GIT_COMMIT_SHA_SHORT" }}</a>]{{ end }}
</p>
</div>
</div>
</div>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.js" integrity="sha384-/y1Nn9+QQAipbNQWU65krzJralCnuOasHncUFXGkdwntGeSvQicrYkiUBwsgUqc1" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/contrib/auto-render.min.js" integrity="sha384-dq1/gEHSxPZQ7DdrM82ID4YVol9BYyU7GbWlIwnwyPzotpoc57wDw/guX8EaYGPx" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="{{ "js/main.js" | absURL }}"></script>
<script src="{{ "js/highlight.min.js" | absURL }}"></script>
<script> hljs.initHighlightingOnLoad(); </script>
<script> renderMathInElement(document.body); </script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.1/photoswipe.min.js" integrity="sha256-UplRCs9v4KXVJvVY+p+RSo5Q4ilAUXh7kpjyIP5odyc=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.1/photoswipe-ui-default.min.js" integrity="sha256-PWHOlUzc96pMc8ThwRIXPn8yH4NOLu42RQ0b9SpnpFk=" crossorigin="anonymous"></script>
<script src="{{ "js/load-photoswipe.js" | absURL }}"></script>
<!-- Google Custom Search Engine -->
{{ if .Site.Params.gcse }}
<script>
(function() {
var cx = '{{ .Site.Params.gcse }}';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
{{ end }}
{{- partial "footer_custom.html" . }}

View file

@ -0,0 +1,4 @@
<!--
If you want to include any custom html just before </body>, put it in /layouts/footer_custom.html
Do not put anything in this file - it's only here so that hugo won't throw an error if /layouts/footer_custom.html doesn't exist.
-->

View file

@ -0,0 +1,52 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<!-- Site Title, Description, Author, and Favicon -->
{{- with .Title | default .Site.Title }}
<title>{{ . }}</title>
<meta property="og:title" content="{{ . }}" />
<meta name="twitter:title" content="{{ . | truncate 70 }}" />
{{- end }}
{{- with .Description | default .Params.subtitle | default .Summary }}
<meta name="description" content="{{ . }}">
<meta property="og:description" content="{{ . }}">
<meta name="twitter:description" content="{{ . | truncate 200 }}">
{{- end }}
<meta name="author" content="{{ .Site.Author.name }}"/>
{{- with .Site.Params.favicon }}
<link href='{{ . | absURL }}' rel='icon' type='image/x-icon'/>
{{- end -}}
<!-- Social Media Tags -->
{{- with .Params.share_img | default .Params.image | default .Site.Params.logo }}
<meta property="og:image" content="{{ . | absURL }}" />
<meta name="twitter:image" content="{{ . | absURL }}" />
{{- end }}
<meta name="twitter:card" content="summary" />
{{- with .Site.Author.twitter }}
<meta name="twitter:site" content="@{{ . }}" />
<meta name="twitter:creator" content="@{{ . }}" />
{{- end }}
{{- with .Site.Params.fb_app_id }}
<meta property="fb:app_id" content="{{ . }}" />
{{- end }}
<meta property="og:url" content="{{ .URL | absLangURL }}" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="{{ .Site.Title }}" />
<!-- Hugo Version number -->
{{ .Hugo.Generator -}}
<!-- Links and stylesheets -->
<link rel="canonical" href="{{ .URL | absLangURL }}" />
<link rel="alternate" href="{{ "index.xml" | absLangURL }}" type="application/rss+xml" title="{{ .Site.Title }}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css" integrity="sha384-wITovz90syo1dJWVh32uuETPVEtGigN07tkttEqPv+uR2SE/mbQcG7ATL28aI9H0" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="{{ "css/main.css" | absURL }}" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" />
<link rel="stylesheet" href="{{ "css/pygment_highlights.css" | absURL }}" />
<link rel="stylesheet" href="{{ "css/highlight.min.css" | absURL }}" />
{{- partial "head_custom.html" . }}
{{- partial "load-photoswipe-theme.html" . }}
{{ template "_internal/google_analytics_async.html" . }}
</head>

View file

@ -0,0 +1,4 @@
<!--
If you want to include any custom html just before </head>, put it in /layouts/head_custom.html
Do not put anything in this file - it's only here so that hugo won't throw an error if /layouts/head_custom.html doesn't exist.
-->

View file

@ -0,0 +1,70 @@
{{ if .IsHome }}
{{ $.Scratch.Set "title" .Site.Title }}
{{ if .Site.Params.subtitle }}{{ $.Scratch.Set "subtitle" .Site.Params.subtitle }}{{ end }}
{{ if .Site.Params.bigimg }}{{ $.Scratch.Set "bigimg" .Site.Params.bigimg }}{{ end }}
{{ else }}
{{ $.Scratch.Set "title" .Title }}
{{ if .Params.subtitle }}{{ $.Scratch.Set "subtitle" .Params.subtitle }}{{ end }}
{{ if .Params.bigimg }}{{ $.Scratch.Set "bigimg" .Params.bigimg }}{{ end }}
{{ end }}
{{ $bigimg := $.Scratch.Get "bigimg" }}
{{ if or $bigimg ($.Scratch.Get "title") }}
{{ if $bigimg }}
<div id="header-big-imgs" data-num-img={{len $bigimg}} {{range $i, $img := $bigimg}}data-img-src-{{add $i 1}}="{{$img.src | absURL }}" {{ if $img.desc}}data-img-desc-{{add $i 1}}="{{$img.desc}}"{{end}}{{end}}></div>
{{ end }}
<header class="header-section {{ if $bigimg }}has-img{{ end }}">
{{ if $bigimg }}
<div class="intro-header big-img">
{{ $subtitle := $.Scratch.Get "subtitle" }}
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="{{ .Type }}-heading">
<h1>{{ with $.Scratch.Get "title" }}{{.}}{{ else }}<br/>{{ end }}</h1>
{{ if $subtitle }}
{{ if eq .Type "page" }}
<hr class="small">
<span class="{{ .Type }}-subheading">{{ $subtitle }}</span>
{{ else }}
<h2 class="{{ .Type }}-subheading">{{ $subtitle }}</h2>
{{ end }}
{{ end }}
{{ if eq .Type "post" }}
{{ partial "post_meta.html" . }}
{{ end }}
</div>
</div>
</div>
</div>
<span class="img-desc" style="display: inline;"></span>
</div>
{{end}}
<div class="intro-header no-img">
{{ $subtitle := $.Scratch.Get "subtitle" }}
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="{{ .Type }}-heading">
<h1>{{ with $.Scratch.Get "title" }}{{.}}{{ else }}<br/>{{ end }}</h1>
{{ if $subtitle }}
{{ if eq .Type "page" }}
<hr class="small">
<span class="{{ .Type }}-subheading">{{ $subtitle }}</span>
{{ else }}
<h2 class="{{ .Type }}-subheading">{{ $subtitle }}</h2>
{{ end }}
{{ end }}
{{ if eq .Type "post" }}
{{ partial "post_meta.html" . }}
{{ end }}
</div>
</div>
</div>
</div>
</div>
</header>
{{ else }}
<div class="intro-header"></div>
{{ end }}

View file

@ -0,0 +1,59 @@
<!--
Documentation and licence at https://github.com/liwenyip/hugo-easy-gallery/
-->
<!-- Photoswipe css/js libraries -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.1/photoswipe.min.css" integrity="sha256-sCl5PUOGMLfFYctzDW3MtRib0ctyUvI9Qsmq2wXOeBY=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.1/default-skin/default-skin.min.css" integrity="sha256-BFeI1V+Vh1Rk37wswuOYn5lsTcaU96hGaI7OUVCLjPc=" crossorigin="anonymous" />
<!-- these files are loaded in the theme footer
<script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.1/photoswipe.min.js" integrity="sha256-UplRCs9v4KXVJvVY+p+RSo5Q4ilAUXh7kpjyIP5odyc=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.1/photoswipe-ui-default.min.js" integrity="sha256-PWHOlUzc96pMc8ThwRIXPn8yH4NOLu42RQ0b9SpnpFk=" crossorigin="anonymous"></script>
-->
<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element, as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides.
PhotoSwipe keeps only 3 of them in DOM to save memory.
Don't modify these 3 pswp__item elements, data is added later on. -->
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,96 @@
<nav class="navbar navbar-default navbar-fixed-top navbar-custom">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar">
<span class="sr-only">{{ i18n "toggleNavigation" }}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ "" | absLangURL }}">{{ .Site.Title }}</a>
</div>
<div class="collapse navbar-collapse" id="main-navbar">
<ul class="nav navbar-nav navbar-right">
{{ range .Site.Menus.main.ByWeight }}
{{ if .HasChildren }}
<li class="navlinks-container">
<a class="navlinks-parent" href="javascript:void(0)">{{ .Name }}</a>
<div class="navlinks-children">
{{ range .Children }}
<a href="{{ .URL | relLangURL }}">{{ .Name }}</a>
{{ end }}
</div>
</li>
{{ else }}
<li>
<a title="{{ .Name }}" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
{{ if .Site.IsMultiLingual }}
{{ if ge (len .Site.Languages) 3 }}
<li class="navlinks-container">
<a class="navlinks-parent" href="javascript:void(0)">{{ i18n "languageSwitcherLabel" }}</a>
<div class="navlinks-children">
{{ range .Site.Languages }}
{{ if not (eq .Lang $.Site.Language.Lang) }}
<a href="/{{ .Lang }}" lang="{{ .Lang }}">{{ default .Lang .LanguageName }}</a>
{{ end }}
{{ end }}
</div>
</li>
{{ else }}
<li>
{{ range .Site.Languages }}
{{ if not (eq .Lang $.Site.Language.Lang) }}
<a href="/{{ .Lang }}" lang="{{ .Lang }}">{{ default .Lang .LanguageName }}</a>
{{ end }}
{{ end }}
</li>
{{ end }}
{{ end }}
{{ if isset .Site.Params "gcse" }}
<li>
<a href="#modalSearch" data-toggle="modal" data-target="#modalSearch" style="outline: none;">
<span class="hidden-sm hidden-md hidden-lg">{{ i18n "gcseLabelShort" }}</span> <span id="searchGlyph" class="glyphicon glyphicon-search"></span>
</a>
</li>
{{ end }}
</ul>
</div>
<div class="avatar-container">
<div class="avatar-img-border">
{{ if isset .Site.Params "logo" }}
<a title="{{ .Site.Title }}" href="{{ "" | absLangURL }}">
<img class="avatar-img" src="{{ .Site.Params.logo | absURL }}" alt="{{ .Site.Title }}" />
</a>
{{ end }}
</div>
</div>
</div>
</nav>
<!-- Search Modal -->
{{ if isset .Site.Params "gcse" }}
<div id="modalSearch" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">{{ i18n "gcseLabelLong" . }}</h4>
</div>
<div class="modal-body">
<gcse:search></gcse:search>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ i18n "gcseClose" }}</button>
</div>
</div>
</div>
</div>
{{ end }}

View file

@ -0,0 +1,11 @@
<span class="post-meta">
{{ default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format | i18n "postedOnDate" }}
{{ if .IsTranslated -}}
{{- $sortedTranslations := sort .Translations "Site.Language.Weight" -}}
{{- $links := apply $sortedTranslations "partial" "translation_link.html" "." -}}
{{- $cleanLinks := apply $links "chomp" "." -}}
{{- $linksOutput := delimit $cleanLinks (i18n "translationsSeparator") -}}
&nbsp;&bull;&nbsp; {{ i18n "translationsLabel" }}{{ $linksOutput }}
{{- end }}
</span>

View file

@ -0,0 +1,2 @@
<a href="{{ .Permalink }}" lang="{{ .Lang }}">{{ default .Lang .Site.Language.LanguageName }}</a>

View file

@ -0,0 +1,29 @@
<!--
Put this file in /layouts/shortcodes/figure.html
NB this overrides Hugo's built-in "figure" shortcode but is backwards compatible
Documentation and licence at https://github.com/liwenyip/hugo-easy-gallery/
-->
<!-- count how many times we've called this shortcode; load the css if it's the first time -->
{{- if not ($.Page.Scratch.Get "figurecount") }}<link rel="stylesheet" href="/css/hugo-easy-gallery.css" />{{ end }}
{{- $.Page.Scratch.Add "figurecount" 1 -}}
<!-- use either src or link-thumb for thumbnail image -->
{{- $thumb := .Get "src" | default (printf "%s." (.Get "thumb") | replace (.Get "link") ".") }}
<div class="box{{ with .Get "caption-position" }} fancy-figure caption-position-{{.}}{{end}}{{ with .Get "caption-effect" }} caption-effect-{{.}}{{end}}" {{ with .Get "width" }}style="max-width:{{.}}"{{end}}>
<figure {{ with .Get "class" }}class="{{.}}"{{ end }} itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
<div class="img"{{ if .Parent }} style="background-image: url('{{ $thumb }}');"{{ end }}{{ with .Get "size" }} data-size="{{.}}"{{ end }}>
<img itemprop="thumbnail" src="{{ $thumb }}" {{ with .Get "alt" | default (.Get "caption") }}alt="{{.}}"{{ end }}/><!-- <img> hidden if in .gallery -->
</div>
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
<figcaption>
{{- with .Get "title" }}<h4>{{.}}</h4>{{ end }}
{{- if or (.Get "caption") (.Get "attr")}}
<p>
{{- .Get "caption" -}}
{{- with .Get "attrlink"}}<a href="{{.}}">{{ .Get "attr" }}</a>{{ else }}{{ .Get "attr"}}{{ end -}}
</p>
{{- end }}
</figcaption>
{{- end }}
{{ with .Get "link" | default (.Get "src") }}<a href="{{.}}" itemprop="contentUrl"></a>{{ end }}<!-- put <a> last so it is stacked on top -->
</figure>
</div>

View file

@ -0,0 +1,40 @@
<!--
Put this file in /layouts/shortcodes/gallery.html
Documentation and licence at https://github.com/liwenyip/hugo-easy-gallery/
-->
<!-- count how many times we've called this shortcode; load the css if it's the first time -->
{{- if not ($.Page.Scratch.Get "figurecount") }}<link rel="stylesheet" href="/css/hugo-easy-gallery.css" />{{ end }}
{{- $.Page.Scratch.Add "figurecount" 1 }}
<div class="gallery caption-position-{{ with .Get "caption-position" | default "bottom" }}{{.}}{{end}} caption-effect-{{ with .Get "caption-effect" | default "slide" }}{{.}}{{end}} hover-effect-{{ with .Get "hover-effect" | default "zoom" }}{{.}}{{end}} {{ if ne (.Get "hover-transition") "none" }}hover-transition{{end}}" itemscope itemtype="http://schema.org/ImageGallery">
{{- with (.Get "dir") -}}
<!-- If a directory was specified, generate figures for all of the images in the directory -->
{{- $files := readDir (print "/static/" .) }}
{{- range $files -}}
<!-- skip files that aren't images, or that inlcude the thumb suffix in their name -->
{{- $thumbext := $.Get "thumb" | default "-thumb" }}
{{- $isthumb := .Name | findRE ($thumbext | printf "%s\\.") }}<!-- is the current file a thumbnail image? -->
{{- $isimg := lower .Name | findRE "\\.(gif|jpg|jpeg|tiff|png|bmp)" }}<!-- is the current file an image? -->
{{- if and $isimg (not $isthumb) }}
{{- $caption := .Name | replaceRE "\\..*" "" | humanize }}<!-- humanized filename without extension -->
{{- $linkURL := print ($.Get "dir") "/" .Name | absURL }}<!-- absolute URL to hi-res image -->
{{- $thumb := .Name | replaceRE "(\\.)" ($thumbext | printf "%s.") }}<!-- filename of thumbnail image -->
{{- $thumbexists := where $files "Name" $thumb }}<!-- does a thumbnail image exist? -->
{{- $thumbURL := print ($.Get "dir") "/" $thumb | absURL }}<!-- absolute URL to thumbnail image -->
<div class="box">
<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
<div class="img" style="background-image: url('{{ if $thumbexists }}{{ $thumbURL }}{{ else }}{{ $linkURL }}{{ end }}');" >
<img itemprop="thumbnail" src="{{ if $thumbexists }}{{ $thumbURL }}{{ else }}{{ $linkURL }}{{ end }}" alt="{{ $caption }}" /><!-- <img> hidden if in .gallery -->
</div>
<figcaption>
<p>{{ $caption }}</p>
</figcaption>
<a href="{{ $linkURL }}" itemprop="contentUrl"></a><!-- put <a> last so it is stacked on top -->
</figure>
</div>
{{- end }}
{{- end }}
{{- else -}}
<!-- If no directory was specified, include any figure shortcodes called within the gallery -->
{{ .Inner }}
{{- end }}
</div>

View file

@ -0,0 +1 @@
.hljs{display:block;overflow-x:auto;padding:0.5em;background:#f9f9f9;-webkit-text-size-adjust:none}.hljs,.hljs-subst,.hljs-tag .hljs-title,.nginx .hljs-title{color:black}.hljs-string,.hljs-title,.hljs-constant,.hljs-parent,.hljs-tag .hljs-value,.hljs-rule .hljs-value,.hljs-preprocessor,.hljs-pragma,.hljs-name,.haml .hljs-symbol,.ruby .hljs-symbol,.ruby .hljs-symbol .hljs-string,.hljs-template_tag,.django .hljs-variable,.smalltalk .hljs-class,.hljs-addition,.hljs-flow,.hljs-stream,.bash .hljs-variable,.pf .hljs-variable,.apache .hljs-tag,.apache .hljs-cbracket,.tex .hljs-command,.tex .hljs-special,.erlang_repl .hljs-function_or_atom,.asciidoc .hljs-header,.markdown .hljs-header,.coffeescript .hljs-attribute{color:#800}.smartquote,.hljs-comment,.hljs-annotation,.diff .hljs-header,.hljs-chunk,.asciidoc .hljs-blockquote,.markdown .hljs-blockquote{color:#888}.hljs-number,.hljs-date,.hljs-regexp,.hljs-literal,.hljs-hexcolor,.smalltalk .hljs-symbol,.smalltalk .hljs-char,.go .hljs-constant,.hljs-change,.lasso .hljs-variable,.makefile .hljs-variable,.asciidoc .hljs-bullet,.markdown .hljs-bullet,.asciidoc .hljs-link_url,.markdown .hljs-link_url{color:#080}.hljs-label,.hljs-javadoc,.ruby .hljs-string,.hljs-decorator,.hljs-filter .hljs-argument,.hljs-localvars,.hljs-array,.hljs-attr_selector,.hljs-important,.hljs-pseudo,.hljs-pi,.haml .hljs-bullet,.hljs-doctype,.hljs-deletion,.hljs-envvar,.hljs-shebang,.apache .hljs-sqbracket,.nginx .hljs-built_in,.tex .hljs-formula,.erlang_repl .hljs-reserved,.hljs-prompt,.asciidoc .hljs-link_label,.markdown .hljs-link_label,.vhdl .hljs-attribute,.clojure .hljs-attribute,.asciidoc .hljs-attribute,.lasso .hljs-attribute,.coffeescript .hljs-property,.hljs-phony{color:#88f}.hljs-keyword,.hljs-id,.hljs-title,.hljs-built_in,.css .hljs-tag,.hljs-javadoctag,.hljs-phpdoc,.hljs-dartdoc,.hljs-yardoctag,.smalltalk .hljs-class,.hljs-winutils,.bash .hljs-variable,.pf .hljs-variable,.apache .hljs-tag,.hljs-type,.hljs-typename,.tex .hljs-command,.asciidoc .hljs-strong,.markdown .hljs-strong,.hljs-request,.hljs-status{font-weight:bold}.asciidoc .hljs-emphasis,.markdown .hljs-emphasis{font-style:italic}.nginx .hljs-built_in{font-weight:normal}.coffeescript .javascript,.javascript .xml,.lasso .markup,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:0.5}

View file

@ -0,0 +1,157 @@
/*
Put this file in /static/css/hugo-easy-gallery.css
Documentation and licence at https://github.com/liwenyip/hugo-easy-gallery/
*/
/*
Grid Layout Styles
*/
.gallery {
overflow: hidden;
margin: 10px;
max-width: 768px;
}
.gallery .box {
float: left;
position: relative;
/* Default: 1 tile wide */
width: 100%;
padding-bottom: 100%;
}
@media only screen and (min-width : 365px) {
/* Tablet view: 2 tiles */
.gallery .box {
width: 50%;
padding-bottom: 50%;
}
}
@media only screen and (min-width : 480px) {
/* Small desktop / ipad view: 3 tiles */
.gallery .box {
width: 33.3%;
padding-bottom: 33.3%; /* */
}
}
@media only screen and (min-width : 9999px) {
/* Medium desktop: 4 tiles */
.box {
width: 25%;
padding-bottom: 25%;
}
}
/*
Transition styles
*/
.gallery.hover-transition figure,
.gallery.hover-effect-zoom .img,
.gallery:not(.caption-effect-appear) figcaption,
.fancy-figure:not(.caption-effect-appear) figcaption {
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
/*
figure styles
*/
figure {
position:relative; /* purely to allow absolution positioning of figcaption */
overflow: hidden;
}
.gallery figure {
position: absolute;
left: 5px;
right: 5px;
top: 5px;
bottom: 5px;
}
.gallery.hover-effect-grow figure:hover {
transform: scale(1.05);
}
.gallery.hover-effect-shrink figure:hover {
transform: scale(0.95);
}
.gallery.hover-effect-slidedown figure:hover {
transform: translateY(5px);
}
.gallery.hover-effect-slideup figure:hover {
transform: translateY(-5px);
}
/*
img / a styles
*/
.gallery .img {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-size: cover;
background-position: 50% 50%;
background-repeat: no-repeat;
}
.gallery.hover-effect-zoom figure:hover .img {
transform: scale(1.05);
}
.gallery img {
display: none; /* only show the img if not inside a gallery */
}
figure a {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
/*
figcaption styles
*/
.gallery figcaption,
.fancy-figure figcaption {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: #000;
color: #FFF;
text-align: center;
font-size: 75%; /* change this if you want bigger text */
background: rgba(0, 0, 0, 0.5);
opacity: 1;
}
.gallery.caption-position-none figcaption,
.fancy-figure.caption-position-none figcaption {
display: none;
}
.gallery.caption-position-center figcaption,
.fancy-figure.caption-position-center figcaption {
top: 0;
padding: 40% 5px;
}
.gallery.caption-position-bottom figcaption,
.fancy-figure.caption-position-bottom figcaption {
padding: 5px;
}
.gallery.caption-effect-fade figure:not(:hover) figcaption,
.gallery.caption-effect-appear figure:not(:hover) figcaption,
.fancy-figure.caption-effect-fade figure:not(:hover) figcaption,
.fancy-figure.caption-effect-appear figure:not(:hover) figcaption {
background: rgba(0, 0, 0, 0);
opacity: 0;
}
.gallery.caption-effect-slide.caption-position-bottom figure:not(:hover) figcaption,
.fancy-figure.caption-effect-slide.caption-position-bottom figure:not(:hover) figcaption {
margin-bottom: -100%;
}
.gallery.caption-effect-slide.caption-position-center figure:not(:hover) figcaption,
.fancy-figure.caption-effect-slide.caption-position-center figure:not(:hover) figcaption {
top: 100%;
}
figcaption p {
margin: auto; /* override style in theme */
}

View file

@ -0,0 +1,13 @@
.main-content {
padding-bottom: 50px;
}
footer.footer-min {
position: fixed;
bottom: 0;
width: 100%;
padding: 3px;
background-color: #f5f5f5;
border-top: 1px solid #eeeeee;
text-align: center;
}

View file

@ -0,0 +1,709 @@
/* --- General --- */
body {
font-family: 'Lora', 'Times New Roman', serif;
font-size: 18px;
color: #404040;
position: relative;
background: #FFF;
display: flex;
flex-flow: column;
height: 100vh;
}
.container[role=main] {
margin-bottom:50px;
flex: 1 0 auto;
}
p {
line-height: 1.5;
margin: 30px 0;
}
p a {
/* text-decoration: underline */
color: #008AFF;
}
h1,h2,h3,h4,h5,h6 {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 800;
}
a {
color: #008AFF;
}
a:hover,
a:focus {
color: #0085a1;
}
blockquote {
color: #808080;
font-style: italic;
}
blockquote p:first-child {
margin-top: 0;
}
hr.small {
max-width: 100px;
margin: 15px auto;
border-width: 4px;
border-color: inherit;
border-radius: 3px;
}
.main-content {
padding-top: 80px;
}
@media only screen and (min-width: 768px) {
.main-content {
padding-top: 130px;
}
}
.main-explain-area {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
padding: 15px inherit;
}
.hideme {
display: none;
}
::-moz-selection {
color: white;
text-shadow: none;
background: #0085a1;
}
::selection {
color: white;
text-shadow: none;
background: #0085a1;
}
img::selection {
color: white;
background: transparent;
}
img::-moz-selection {
color: white;
background: transparent;
}
img {
display: block;
margin: auto;
max-width: 100%;
}
.disqus-comments {
margin-top: 30px;
}
@media only screen and (min-width: 768px) {
.disqus-comments {
margin-top: 40px;
}
}
/* --- Navbar --- */
.navbar-custom {
background: #F5F5F5;
border-bottom: 1px solid #EAEAEA;
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.navbar-custom .nav li a {
text-transform: uppercase;
font-size: 12px;
letter-spacing: 1px;
}
.navbar-custom .navbar-brand,
.navbar-custom .nav li a {
font-weight: 800;
color: #404040;
}
.navbar-custom .navbar-brand:hover,
.navbar-custom .navbar-brand:focus ,
.navbar-custom .nav li a:hover,
.navbar-custom .nav li a:focus {
color: #0085a1;
}
.navbar-custom .navbar-brand-logo {
padding-top: 0;
-webkit-transition: padding .5s ease-in-out;
-moz-transition: padding .5s ease-in-out;
transition: padding .5s ease-in-out;
}
.navbar-custom .navbar-brand-logo img {
height: 50px;
-webkit-transition: height .5s ease-in-out;
-moz-transition: height .5s ease-in-out;
transition: height .5s ease-in-out;
}
.navbar-custom.top-nav-short .navbar-brand-logo {
padding-top: 5px;
}
.navbar-custom.top-nav-short .navbar-brand-logo img {
height: 40px;
}
@media only screen and (min-width: 768px) {
.navbar-custom {
padding: 20px 0;
-webkit-transition: background .5s ease-in-out,padding .5s ease-in-out;
-moz-transition: background .5s ease-in-out,padding .5s ease-in-out;
transition: background .5s ease-in-out,padding .5s ease-in-out;
}
.navbar-custom.top-nav-short {
padding: 0;
}
}
.navbar-custom .avatar-container {
opacity: 1;
position: absolute;
-webkit-transition: opacity 0.5s ease-in-out;
-moz-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
left: 50%;
width: 50px;
margin-top: -25px;
}
.navbar-custom .avatar-container .avatar-img-border {
width: 100%;
border-radius: 50%;
margin-left: -50%;
display: inline-block;
box-shadow: 0 0 8px rgba(0, 0, 0, .8);
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .8);
-moz-box-shadow: 0 0 8px rgba(0, 0, 0, .8);
}
.navbar-custom .avatar-container .avatar-img {
width: 100%;
border-radius: 50%;
display: block;
}
.navbar-custom.top-nav-short .avatar-container{
opacity: 0;
}
.navbar-custom.top-nav-expanded .avatar-container {
display: none;
}
@media only screen and (min-width: 768px) {
.navbar-custom .avatar-container {
width: 100px;
margin-top: -50px;
}
.navbar-custom .avatar-container .avatar-img-border {
width: 100%;
box-shadow: 1px 1px 2px rgba(0, 0, 0, .8);
-webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, .8);
-moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, .8);
}
.navbar-custom .avatar-container .avatar-img {
width: 100%;
}
}
/* Multi-level navigation links */
.navbar-custom .nav .navlinks-container {
position: relative;
}
.navbar-custom .nav .navlinks-parent:after {
content: " \25BC";
}
.navbar-custom .nav .navlinks-children {
width: 100%;
display: none;
word-break: break-word;
}
.navbar-custom .nav .navlinks-container .navlinks-children a {
display: block;
padding: 10px;
padding-left: 30px;
background: #f5f5f5;
text-decoration: none !important;
border-width: 0 1px 1px 1px;
font-weight: normal;
}
@media only screen and (max-width: 767px) {
.navbar-custom .nav .navlinks-container.show-children {
background: #eee;
}
.navbar-custom .nav .navlinks-container.show-children .navlinks-children {
display: block;
}
}
@media only screen and (min-width: 768px) {
.navbar-custom .nav .navlinks-container {
text-align: center;
}
.navbar-custom .nav .navlinks-container:hover {
background: #eee;
}
.navbar-custom .nav .navlinks-container:hover .navlinks-children {
display: block;
}
.navbar-custom .nav .navlinks-children {
position: absolute;
}
.navbar-custom .nav .navlinks-container .navlinks-children a {
padding-left: 10px;
border: 1px solid #eaeaea;
border-width: 0 1px 1px;
}
}
/* --- Footer --- */
footer {
padding: 30px 0;
background: #F5F5F5;
border-top: 1px #EAEAEA solid;
margin-top: auto;
font-size: 14px;
}
footer a {
color: #404040;
}
footer .list-inline {
margin: 0;
padding: 0;
}
footer .copyright {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
text-align: center;
margin-bottom: 0;
}
footer .theme-by {
text-align: center;
margin: 10px 0 0;
}
@media only screen and (min-width: 768px) {
footer {
padding: 50px 0;
}
footer .footer-links {
font-size: 18px;
}
footer .copyright {
font-size: 16px;
}
}
/* --- Post preview --- */
.post-preview {
padding: 20px 0;
border-bottom: 1px solid #eee;
}
@media only screen and (min-width: 768px) {
.post-preview {
padding: 35px 0;
}
}
.post-preview:last-child {
border-bottom: 0;
}
.post-preview a {
text-decoration: none;
color: #404040;
}
.post-preview a:focus,
.post-preview a:hover {
text-decoration: none;
color: #0085a1;
}
.post-preview .post-title {
font-size: 30px;
margin-top: 0;
}
.post-preview .post-subtitle {
margin: 0;
font-weight: 300;
margin-bottom: 10px;
}
.post-preview .post-meta,
.post-heading .post-meta {
color: #808080;
font-size: 18px;
font-style: italic;
margin: 0 0 10px;
}
.post-preview .post-meta a,
.post-heading .post-meta a {
color: #404040;
text-decoration: none;
}
.post-preview .post-entry {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.post-entry-container {
display: inline-block;
width: 100%;
}
.post-entry {
width: 100%;
}
.post-image {
float: right;
height: 192px;
width: 192px;
margin-top: -35px;
filter: grayscale(90%);
}
.post-image:hover {
filter: grayscale(0%);
}
.post-image img {
border-radius: 100px;
height: 192px;
width: 192px;
}
.post-preview .post-read-more {
font-weight: 800;
float: right;
}
@media only screen and (min-width: 768px) {
.post-preview .post-title {
font-size: 36px;
}
}
/* --- Tags --- */
.blog-tags {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: #999;
font-size: 15px;
margin-bottom: 30px;
}
.blog-tags a {
color: #008AFF;
text-decoration: none;
padding: 0px 5px;
}
.blog-tags a:hover {
border-radius: 2px;
color: #008AFF;
background-color: #CCC;
}
.post-preview .blog-tags {
margin-top: 5px;
margin-bottom: 0;
}
@media only screen and (min-width: 768px) {
.post-preview .blog-tags {
margin-top: 10px;
}
}
@media only screen and (max-width: 500px) {
.post-image, .post-image img {
height: 100px;
width: 100px;
}
.post-image {
width: 100%;
text-align: center;
margin-top: 0;
float: left;
}
}
/* --- Post and page headers --- */
.intro-header {
margin: 80px 0 20px;
position: relative;
}
.intro-header.big-img {
background: no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
margin-top: 51px; /* The small navbar is 50px tall + 1px border */
margin-bottom: 35px;
}
.intro-header.big-img .big-img-transition {
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
background: no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
-webkit-transition: opacity 1s linear;
-moz-transition: opacity 1s linear;
transition: opacity 1s linear;
}
.intro-header .page-heading {
text-align: center;
}
.intro-header.big-img .page-heading,
.intro-header.big-img .post-heading {
padding: 100px 0;
color: #FFF;
text-shadow: 1px 1px 3px #000;
}
.intro-header .page-heading h1 {
margin-top: 0;
font-size: 50px;
}
.intro-header .post-heading h1 {
margin-top: 0;
font-size: 35px;
}
.intro-header .page-heading .page-subheading,
.intro-header .post-heading .post-subheading {
font-size: 27px;
line-height: 1.1;
display: block;
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 300;
margin: 10px 0 0;
}
.intro-header .post-heading .post-subheading {
margin-bottom: 20px;
}
.intro-header.big-img .page-heading .page-subheading,
.intro-header.big-img .post-heading .post-subheading {
font-weight: 400;
}
.intro-header.big-img .page-heading hr {
box-shadow: 1px 1px 3px #000;
-webkit-box-shadow: 1px 1px 3px #000;
-moz-box-shadow: 1px 1px 3px #000;
}
.intro-header.big-img .post-heading .post-meta {
color: #EEE;
}
.intro-header.big-img .img-desc {
background: rgba(30, 30, 30, 0.6);
position: absolute;
padding: 5px 10px;
font-size: 11px;
color: #EEE;
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
right: 0;
bottom: 0;
display: none;
}
@media only screen and (min-width: 768px) {
.intro-header {
margin-top: 130px;
}
.intro-header.big-img {
margin-top: 91px; /* Full navbar is small navbar + 20px padding on each side when expanded */
}
.intro-header.big-img .page-heading,
.intro-header.big-img .post-heading {
padding: 150px 0;
}
.intro-header .page-heading h1 {
font-size: 80px;
}
.intro-header .post-heading h1 {
font-size: 50px;
}
.intro-header.big-img .img-desc {
font-size: 14px;
}
}
.header-section.has-img .no-img {
margin-top: 0;
background: #FCFCFC;
margin: 0 0 40px;
padding: 20px 0;
box-shadow: 0 0 5px #AAA;
}
/* Many phones are 320 or 360px, so make sure images are a proper aspect ratio in those cases */
.header-section.has-img .intro-header.no-img {
display: none;
}
@media only screen and (max-width: 365px) {
.header-section.has-img .intro-header.no-img {
display: block;
}
.intro-header.big-img {
width: 100%;
height: 220px;
}
.intro-header.big-img .page-heading,
.intro-header.big-img .post-heading {
display: none;
}
.header-section.has-img .big-img {
margin-bottom: 0;
}
}
@media only screen and (max-width: 325px) {
.intro-header.big-img {
height: 200px;
}
}
.caption {
text-align: center;
font-size: 14px;
padding: 10px;
font-style: italic;
margin: 0;
display: block;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
}
/* --- Pager --- */
.pager li a {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
text-transform: uppercase;
font-size: 14px;
font-weight: 800;
letter-spacing: 1px;
padding: 10px 5px;
background: #FFF;
border-radius: 0;
color: #404040;
}
@media only screen and (min-width: 768px) {
.pager li a {
padding: 15px 25px;
}
}
.pager li a:hover,
.pager li a:focus {
color: #FFF;
background: #0085a1;
border: 1px solid #0085a1;
}
.pager {
margin: 10px 0 0;
}
.pager.blog-pager {
margin-top: 0;
}
@media only screen and (min-width: 768px) {
.pager.blog-pager {
margin-top: 10px;
}
}
/* --- Tables --- */
table {
padding: 0;
}
table tr {
border-top: 1px solid #cccccc;
background-color: #ffffff;
margin: 0;
padding: 0;
}
table tr:nth-child(2n) {
background-color: #f8f8f8;
}
table tr th {
font-weight: bold;
border: 1px solid #cccccc;
text-align: left;
margin: 0;
padding: 6px 13px;
}
table tr td {
border: 1px solid #cccccc;
text-align: left;
margin: 0;
padding: 6px 13px;
}
table tr th :first-child,
table tr td :first-child {
margin-top: 0;
}
table tr th :last-child,
table tr td :last-child {
margin-bottom: 0;
}
/* --- Code blocks --- */
pre {
font-size: 16px;
line-height: 1.5em;
}
pre code {
white-space: pre;
}
pre.highlight, .highlight > pre, td.code pre {
background: #FAFAFA;
background-image: linear-gradient(#F9F9F9 50%, #FDFDFD 50%);
background-repeat: repeat;
background-size: 3em 3em;
background-position: 0px 10px;
border-left: 7px solid #444;
}
code table, code table td, code table th, code table tbody, code table tr,
td.gutter pre {
padding: 0;
border: none;
background-color: #fff;
}
.highlight > pre {
padding: 0;
}
td.code pre {
border-width: 0 0 0 2px;
border-style: solid;
border-color: #444;
border-radius: 0;
}
td.gutter {
padding-top: 3px;
}
/* --- Social media sharing section --- */
#social-share-section {
margin-bottom: 30px;
}
/* --- Google Custom Search Engine Popup --- */
#modalSearch table tr, #modalSearch table tr td, #modalSearch table tr th {
border:none;
}
.reset-box-sizing, .reset-box-sizing *, .reset-box-sizing *:before, .reset-box-sizing *:after, .gsc-inline-block {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
input.gsc-input, .gsc-input-box, .gsc-input-box-hover, .gsc-input-box-focus, .gsc-search-button {
box-sizing: content-box;
line-height: normal;
}

View file

@ -0,0 +1,66 @@
/* .highlight { background: #ffffff; } */
/* .highlight pre { background-color: #fff; font-size: 16px } */
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
/* Make line numbers unselectable: excludes line numbers from copy-paste user ops */
.highlight .lineno {color:rgba(0,0,0,0.3);padding: 0 10px;-webkit-user-select: none;-moz-user-select: none; -o-user-select: none;}
.lineno::-moz-selection {background-color: transparent;} /* Mozilla specific */
.lineno::selection {background-color: transparent;} /* Other major browsers */

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,74 @@
/*
Put this file in /static/js/load-photoswipe.js
Documentation and licence at https://github.com/liwenyip/hugo-easy-gallery/
*/
/* TODO: Make the share function work */
$( document ).ready(function() {
/*
Initialise Photoswipe
*/
var items = []; // array of slide objects that will be passed to PhotoSwipe()
// for every figure element on the page:
$('figure').each( function() {
if ($(this).attr('class') == 'no-photoswipe') return true; // ignore any figures where class="no-photoswipe"
// get properties from child a/img/figcaption elements,
var $figure = $(this),
$a = $figure.find('a'),
$img = $figure.find('img'),
$src = $a.attr('href'),
$title = $img.attr('alt'),
$msrc = $img.attr('src');
// if data-size on <a> tag is set, read it and create an item
if ($a.data('size')) {
var $size = $a.data('size').split('x');
var item = {
src : $src,
w : $size[0],
h : $size[1],
title : $title,
msrc : $msrc
};
//console.log("Using pre-defined dimensions for " + $src);
// if not, set temp default size then load the image to check actual size
} else {
var item = {
src : $src,
w : 800, // temp default size
h : 600, // temp default size
title : $title,
msrc : $msrc
};
//console.log("Using default dimensions for " + $src);
// load the image to check its dimensions
// update the item as soon as w and h are known (check every 30ms)
var img = new Image();
img.src = $src;
var wait = setInterval(function() {
var w = img.naturalWidth,
h = img.naturalHeight;
if (w && h) {
clearInterval(wait);
item.w = w;
item.h = h;
//console.log("Got actual dimensions for " + img.src);
}
}, 30);
}
// Save the index of this image then add it to the array
var index = items.length;
items.push(item);
// Event handler for click on a figure
$figure.on('click', function(event) {
event.preventDefault(); // prevent the normal behaviour i.e. load the <a> hyperlink
// Get the PSWP element and initialise it with the desired options
var $pswp = $('.pswp')[0];
var options = {
index: index,
bgOpacity: 0.8,
showHideOpacity: true
}
new PhotoSwipe($pswp, PhotoSwipeUI_Default, items, options).init();
});
});
});

View file

@ -0,0 +1,138 @@
// Dean Attali / Beautiful Jekyll 2016
var main = {
bigImgEl : null,
numImgs : null,
init : function() {
// Shorten the navbar after scrolling a little bit down
$(window).scroll(function() {
if ($(".navbar").offset().top > 50) {
$(".navbar").addClass("top-nav-short");
} else {
$(".navbar").removeClass("top-nav-short");
}
});
// On mobile, hide the avatar when expanding the navbar menu
$('#main-navbar').on('show.bs.collapse', function () {
$(".navbar").addClass("top-nav-expanded");
});
$('#main-navbar').on('hidden.bs.collapse', function () {
$(".navbar").removeClass("top-nav-expanded");
});
// On mobile, when clicking on a multi-level navbar menu, show the child links
$('#main-navbar').on("click", ".navlinks-parent", function(e) {
var target = e.target;
$.each($(".navlinks-parent"), function(key, value) {
if (value == target) {
$(value).parent().toggleClass("show-children");
} else {
$(value).parent().removeClass("show-children");
}
});
});
// Ensure nested navbar menus are not longer than the menu header
var menus = $(".navlinks-container");
if (menus.length > 0) {
var navbar = $("#main-navbar").find("ul");
var fakeMenuHtml = "<li class='fake-menu' style='display:none;'><a></a></li>";
navbar.append(fakeMenuHtml);
var fakeMenu = $(".fake-menu");
$.each(menus, function(i) {
var parent = $(menus[i]).find(".navlinks-parent");
var children = $(menus[i]).find(".navlinks-children a");
var words = [];
$.each(children, function(idx, el) { words = words.concat($(el).text().trim().split(/\s+/)); });
var maxwidth = 0;
$.each(words, function(id, word) {
fakeMenu.html("<a>" + word + "</a>");
var width = fakeMenu.width();
if (width > maxwidth) {
maxwidth = width;
}
});
$(menus[i]).css('min-width', maxwidth + 'px')
});
fakeMenu.remove();
}
// show the big header image
main.initImgs();
},
initImgs : function() {
// If the page was large images to randomly select from, choose an image
if ($("#header-big-imgs").length > 0) {
main.bigImgEl = $("#header-big-imgs");
main.numImgs = main.bigImgEl.attr("data-num-img");
// 2fc73a3a967e97599c9763d05e564189
// set an initial image
var imgInfo = main.getImgInfo();
var src = imgInfo.src;
var desc = imgInfo.desc;
main.setImg(src, desc);
// For better UX, prefetch the next image so that it will already be loaded when we want to show it
var getNextImg = function() {
var imgInfo = main.getImgInfo();
var src = imgInfo.src;
var desc = imgInfo.desc;
var prefetchImg = new Image();
prefetchImg.src = src;
// if I want to do something once the image is ready: `prefetchImg.onload = function(){}`
setTimeout(function(){
var img = $("<div></div>").addClass("big-img-transition").css("background-image", 'url(' + src + ')');
$(".intro-header.big-img").prepend(img);
setTimeout(function(){ img.css("opacity", "1"); }, 50);
// after the animation of fading in the new image is done, prefetch the next one
//img.one("transitioned webkitTransitionEnd oTransitionEnd MSTransitionEnd", function(){
setTimeout(function() {
main.setImg(src, desc);
img.remove();
getNextImg();
}, 1000);
//});
}, 6000);
};
// If there are multiple images, cycle through them
if (main.numImgs > 1) {
getNextImg();
}
}
},
getImgInfo : function() {
var randNum = Math.floor((Math.random() * main.numImgs) + 1);
var src = main.bigImgEl.attr("data-img-src-" + randNum);
var desc = main.bigImgEl.attr("data-img-desc-" + randNum);
return {
src : src,
desc : desc
}
},
setImg : function(src, desc) {
$(".intro-header.big-img").css("background-image", 'url(' + src + ')');
if (typeof desc !== typeof undefined && desc !== false) {
$(".img-desc").text(desc).show();
} else {
$(".img-desc").hide();
}
}
};
// 2fc73a3a967e97599c9763d05e564189
document.addEventListener('DOMContentLoaded', main.init);

View file

@ -0,0 +1,18 @@
name = "Beautiful Hugo"
license = "MIT"
licenselink = "https://github.com/halogenica/Hugo-BeautifulHugo/blob/master/LICENSE"
description = "A port of Beautiful Jekyll theme"
tags = ["blog", "company", "portfolio", "projects", "minimal", "responsive"]
features = ["blog", "themes", "disqus", "minimal", "responsive"]
min_version = 0.17
[author]
name = "halogenica"
homepage = "http://halogenica.net"
# If Porting existing theme
[original]
author = "dattali"
homepage = "http://deanattali.com/beautiful-jekyll/"
repo = "https://github.com/daattali/beautiful-jekyll"