re-themed

This commit is contained in:
Ismael Arenzana 2018-12-19 13:19:32 -05:00
parent 348c017edc
commit 6df9be08c7
No known key found for this signature in database
GPG Key ID: AC1ABBD0A79CCB89
61 changed files with 7443 additions and 0 deletions

View File

@ -0,0 +1,5 @@
## 2017.12.09 Version 1.0
- [x] Support twitter card.
- [x] Remove name in `.Site.Params`. It's duplicate with `.Site.title`.
- [x] Add `author` in `.Site.Params`.

View File

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 201-present [nodejh](http://nodejh.com)
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,119 @@
# Hugo Theme Cactus Plus
[English Document](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/README.md) | [中文文档](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/README_zh-cn.md)
Cactus Plus is a minimalistic theme for bloggers based on the theme named [Cactus](https://github.com/digitalcraftsman/hugo-cactus-theme).
**Features**
+ **More beautiful style**
+ **Tags page**
+ **Archive page**
+ **[Disqus](https://disqus.com/) comment-system**
+ **Both Google Analytics and Baidu Analytics for site analytics.**
+ **Table of Content**
+ **Twitter Card**
Here's the link to online demo: [http://nodejh.com](http://nodejh.com).
<!-- TOC depthFrom:1 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->
- [Hugo Theme Cactus Plus](#hugo-theme-cactus-plus)
- [Screenshot](#screenshot)
- [Installation](#installation)
- [Example Site](#example-site)
- [Posts Summary](#posts-summary)
- [About page](#about-page)
- [Avatar](#avatar)
- [Hide pages](#hide-pages)
- [Disqus](#disqus)
- [Social link icons](#social-link-icons)
- [Nearly finished](#nearly-finished)
- [License](#license)
<!-- /TOC -->
## Screenshot
**home page**
![Screenshot](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/images/screenshot.png)
**tags page**
![Screenshot](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/images/tags.png)
**archive page**
![Screenshot](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/images/archive.png)
## Installation
First clone the theme to your themes directory:
```
$ cd themes
$ git clone https://github.com/nodejh/hugo-theme-cactus-plus.git
```
Take a look inside the [`exampleSite`](https://github.com/nodejh/hugo-theme-cactus-plus/tree/master/exampleSite) folder of this theme. You'll find a file called [`config.toml`](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/exampleSite/config.toml).
To use it, copy the [`config.toml`](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/exampleSite/config.toml) in the root folder of your Hugo site. Feel free to change strings as you like to customize your website.
And you may replace your site `archetypes/default.md` with [`hugo-theme-cactus-plus/archetypes/default.md`](https://github.com/nodejh/hugo-theme-cactus-plus/tree/master/archetypes/default.md)
For more information read the official [setup guide](//gohugo.io/overview/installing/) of Hugo.
## Example Site
There is an example site with config file and markdown files in [`exampleSite`](https://github.com/nodejh/hugo-theme-cactus-plus/tree/master/exampleSite) directory.
## Posts Summary
Summary will show follow the post title title in home page.
And if you want to use description property that in post's fromt matter to instated of post's content summary, set `useDescriptionReplaceSummary = true`.
To use the content summary, you may add the `<!--more-->` summary divider where you want to split the article alternatively. For org content, use # more where you want to split the article. Content that comes before the summary divider will be used as that contents summary.By default, Hugo automatically takes the first 70 words of your content as its summary. See also [https://gohugo.io/content-management/summaries/](https://gohugo.io/content-management/summaries/).
## About page
Use the about page to introduce yourself to your visitors. You can customize the content as you like in the `/content/about/_index.md`.
## Avatar
Furthermore, you should replace the [avatar placeholder](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/static/images/) with a great image of yourself.
## Hide pages
Pages can be hidden and don't appear in the post list on the homepage if you add the variable `hidden = true` to the frontmatter. This allows you to link from elsewhere, i.e. just the menu.
## Disqus
This theme features a comment system powered by Disqus. Just add your Disqus-shortname to the [`config.toml`](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/exampleSite/config.toml) and set `enableDisqus = true`, then let readers respond to your blog posts.
## Social link icons
You can add a social link panel in the footer by adding entries to the `social` block in the [`config.toml`](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/exampleSite/config.toml). You can choose between two icon fonts:
- [Font awesome](https://fortawesome.github.io/Font-Awesome/) or
- [Mono social icons](https://github.com/drinchev/monosocialiconsfont)
Assign either `font-awesome` or `mono-social` to the `iconFont` variable. The Mono social icons offer three styles of icons: -circle, rounded, or default (empty).
## Nearly finished
In order to see your site in action, run Hugo's built-in local server.
```
$ hugo server
```
Now enter [`localhost:1313`](http://localhost:1313) in the address bar of your browser.
## License
This theme is released under the MIT license. For more information read the [license](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/LICENSE.md).

View File

@ -0,0 +1,139 @@
# Hugo Theme Cactus Plus
[English Document](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/README.md) | [中文文档](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/README_zh-cn.md)
Cactus Plus 是在 [Cactus](https://github.com/digitalcraftsman/hugo-cactus-theme) 更改的一个简约主题。
**特点**
+ **更漂亮的样式**
+ **添加了标签页**
+ **添加了归档页**
+ **集成了 [Disqus](https://disqus.com/) 评论系统**
+ **提供了 Google Analytics 和百度统计**
+ **文章目录**
+ **Twitter Card**
示例网站: [http://nodejh.com](http://nodejh.com)。
<!-- TOC depthFrom:1 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->
- [Hugo Theme Cactus Plus](#hugo-theme-cactus-plus)
- [截图](#截图)
- [安装](#安装)
- [示例站点](#示例站点)
- [文章摘要](#文章摘要)
- [关于页面](#关于页面)
- [头像](#头像)
- [隐藏页面](#隐藏页面)
- [Disqus 评论](#disqus-评论)
- [社交链接](#社交链接)
- [部署主题](#部署主题)
- [License](#license)
<!-- /TOC -->
## 截图
**首页**
![Screenshot](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/images/screenshot.png)
**标签页**
![Screenshot](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/images/tags.png)
**归档页**
![Screenshot](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/images/archive.png)
## 安装
首先进入 `hugo` 的站点目录运行下面的命令:
```
$ cd themes
$ git clone https://github.com/nodejh/hugo-theme-cactus-plus.git
```
本主题提供了一个示例配置文件是 [`exampleSite`](https://github.com/nodejh/hugo-theme-cactus-plus/tree/master/exampleSite) 目录里的 [`config.toml`](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/exampleSite/config.toml) 文件。
配置文件中对大部分配置都有详细的注释说明,复制该文件到站点目录下,根据自己的情况修改即可。
然后可能你还需要用 [`hugo-theme-cactus-plus/archetypes/default.md`](https://github.com/nodejh/hugo-theme-cactus-plus/tree/master/archetypes/default.md) 替换你的项目中的 `archetypes/default.md`
更多安装信息查看 Hugo 官方文档 [setup guide](//gohugo.io/overview/installing/)。
## 示例站点
[`exampleSite`](https://github.com/nodejh/hugo-theme-cactus-plus/tree/master/exampleSite) 是本主题的一个示例站点,里面有配置文件、关于页面的一些示例。
## 文章摘要
Summary will show follow the post title title in home page.
摘要会显示在首页的文章标题下面。
如果你想用文章头信息中的 `description` 属性代替文章内容摘要,将 `useDescriptionReplaceSummary` 设置为 `true` 即可。
如果要使用文章内容摘要,你可能需要在文章中添加 `<!--more-->` 分割线来分割文章。分割线前面的字符会作为文章摘要。默认情况下Hugo 会截取内容的前 70 个字作为摘要。查看更多 [https://gohugo.io/content-management/summaries/](https://gohugo.io/content-management/summaries/).
## 关于页面
使用关于页面首先要在你的站点目录的 `content` 目录下创建一个 `about` 目录,然后再创建一个 `_index.md` 文件,编写该文件即可。
你也可以参考本主题示例站点中的关于页:[`exampleSite/content/about/index.md`](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/exampleSite/content/about/index.md)。
## 头像
你需要将 [images](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/static/images/) 目录下的 `avatar.png`、`avatar@2x.png` 和 `favicon.ico` 都替换为你自己的图像。
## 隐藏页面
如果你不想让一个页面出现在文章列表中,只需要在 markdown 文件的 `frontmatter` 中添加 `hidden = true` 即可。
然后你可以在其他任何地方通过链接来引用该页面,如在菜单中放置一个链接。
关于页面就是这么实现的。
## Disqus 评论
本主题提供两种评论系统Disqus 和多说。使用 Disqus 评论需要在 [`config.toml`](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/exampleSite/config.toml) 中进行设置。
设置 `disqusShortname` 为你的 Disqus ID并将 `enableDisqus` 设置为 `true` 即可开启 Disqus 评论。
`enableDisqus` 设置为 `false` 则不启用 Disqus 评论。
## 社交链接
本主题的社交链接是字体图标的样式,并放置在了页面底部。你可以通过在 `config.toml``social` 模块中修改添加你的社交链接。社交链接提供了两种字体图标,选用其中一种即可:
- [Font awesome](https://fortawesome.github.io/Font-Awesome/) 或
- [Mono social icons](https://github.com/drinchev/monosocialiconsfont)
`iconFont` 变量即字体图标库,可以是 `font-awesome``mono-social`
如果使用的是 `Mono social icons``iconFont = "mono-social"`,则图标还有三种可选样式:`-circle`、`rounded`、或默认 `empty`
## 部署主题
配置完成之后,就可以使用下面的命令来启动 hugo 服务编译 markdown 文件生成静态站点:
```
$ hugo server
```
然后在浏览器地址栏输入 [`localhost:1313`](http://localhost:1313) 来访问站点。
## License
[MIT](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/LICENSE.md)

View File

@ -0,0 +1,7 @@
+++
title = "{{ replace .TranslationBaseName "-" " " | title }}"
date = {{ .Date }}
tags = [""]
categories = [""]
draft = false
+++

View File

@ -0,0 +1,79 @@
# Site settings
baseurl = "your_site_url_address"
languageCode = "en"
title = "site title"
theme = "hugo-theme-cactus-plus"
googleAnalytics = "your_google_analytics_id"
# Set the value to true if your site include CJK (Chinese, Japanese, and Korean languages) characters
hasCJKLanguage = false
[params]
author = "site_author"
description = "Site Description"
bio = "author biography"
twitter = "your_twitter_id"
facebook = "your_facebook_id"
enableRSS = true
enableToc = true
enableDisqus = true
disqusShortname = "your_disqus_short_name"
enableSummary = true
# Set the value to true if use description in post front matter replace content summary
useDescriptionReplaceSummary = false
enableGoogleAnalytics = true
enableBaiduAnalytics = false
# Set the value to your baidu analysis code if you want to use baidu analytics
baiduAnalytics = 'your_baidu_analysis_code'
enableTwitterCard = true
# The url for twitter card image, default is avatar.png in static/images directory
twitterCardImage = ""
# Add custom assets with their paths relative to the static folder
customCSS = []
customJS = []
# The variables below are optionally too and can be used to
# translate or customize each string of the theme.
# Navigation links
home = ""
about = ""
archive = ""
subscribe = ""
olderPosts = ""
newerPosts = ""
copyright = ""
# show latest posts in single page
showLatestPosts = false
readMore = ""
# Share
enableShare = true
tweet = ""
share = ""
# 404 page
title404 = ""
subtitle404 = ""
# Choose a font for the social icons in the footer. Either "mono-social" or "font-awesome"
iconFont = "font-awesome"
# The social icons can be styled differently if you use mono as font - circle, rounded, or empty
socialIconStyle = ""
# Add additional social link entries underneath
[social]
facebook-square = "https://www.facebook.com/nodejh"
twitter-square = "https://www.twitter.com/nodejh"
github-square = "https://www.github.com/nodejh"

View File

@ -0,0 +1,15 @@
+++
date = "2015-06-20T14:02:37+02:00"
title = "About"
hidden = true
+++
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa ullam earum dolorum! Sed, perspiciatis.
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
***
### Lorem ipsum dolor.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ea dicta corporis ad inventore itaque impedit dolor atque amet exercitationem! Veniam qui voluptas maiores vel laudantium necessitatibus, velit ducimus! Iste hic facere, accusamus fugiat enim facilis.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,350 @@
+++
title = "(Hu)go Template Primer"
description = "Hugo uses the excellent go library for its template engine. "
tags = [
"go",
"golang",
"templates",
"themes",
"development",
]
date = "2014-04-02"
categories = [
"Development",
"golang",
]
menu = "main"
+++
Hugo uses the excellent [go][] [html/template][gohtmltemplate] library for
its template engine. It is an extremely lightweight engine that provides a very
small amount of logic.
<!--more-->
In our experience that it is just the right amount of
logic to be able to create a good static website. If you have used other
template systems from different languages or frameworks you will find a lot of
similarities in go templates.
This document is a brief primer on using go templates. The [go docs][gohtmltemplate]
provide more details.
## Introduction to Go Templates
Go templates provide an extremely simple template language. It adheres to the
belief that only the most basic of logic belongs in the template or view layer.
One consequence of this simplicity is that go templates parse very quickly.
A unique characteristic of go templates is they are content aware. Variables and
content will be sanitized depending on the context of where they are used. More
details can be found in the [go docs][gohtmltemplate].
## Basic Syntax
Go lang templates are html files with the addition of variables and
functions.
**Go variables and functions are accessible within {{ }}**
Accessing a predefined variable "foo":
{{ foo }}
**Parameters are separated using spaces**
Calling the add function with input of 1, 2:
{{ add 1 2 }}
**Methods and fields are accessed via dot notation**
Accessing the Page Parameter "bar"
{{ .Params.bar }}
**Parentheses can be used to group items together**
{{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }}
## Variables
Each go template has a struct (object) made available to it. In hugo each
template is passed either a page or a node struct depending on which type of
page you are rendering. More details are available on the
[variables](/layout/variables) page.
A variable is accessed by referencing the variable name.
<title>{{ .Title }}</title>
Variables can also be defined and referenced.
{{ $address := "123 Main St."}}
{{ $address }}
## Functions
Go template ship with a few functions which provide basic functionality. The go
template system also provides a mechanism for applications to extend the
available functions with their own. [Hugo template
functions](/layout/functions) provide some additional functionality we believe
are useful for building websites. Functions are called by using their name
followed by the required parameters separated by spaces. Template
functions cannot be added without recompiling hugo.
**Example:**
{{ add 1 2 }}
## Includes
When including another template you will pass to it the data it will be
able to access. To pass along the current context please remember to
include a trailing dot. The templates location will always be starting at
the /layout/ directory within Hugo.
**Example:**
{{ template "chrome/header.html" . }}
## Logic
Go templates provide the most basic iteration and conditional logic.
### Iteration
Just like in go, the go templates make heavy use of range to iterate over
a map, array or slice. The following are different examples of how to use
range.
**Example 1: Using Context**
{{ range array }}
{{ . }}
{{ end }}
**Example 2: Declaring value variable name**
{{range $element := array}}
{{ $element }}
{{ end }}
**Example 2: Declaring key and value variable name**
{{range $index, $element := array}}
{{ $index }}
{{ $element }}
{{ end }}
### Conditionals
If, else, with, or, & and provide the framework for handling conditional
logic in Go Templates. Like range, each statement is closed with `end`.
Go Templates treat the following values as false:
* false
* 0
* any array, slice, map, or string of length zero
**Example 1: If**
{{ if isset .Params "title" }}<h4>{{ index .Params "title" }}</h4>{{ end }}
**Example 2: If -> Else**
{{ if isset .Params "alt" }}
{{ index .Params "alt" }}
{{else}}
{{ index .Params "caption" }}
{{ end }}
**Example 3: And & Or**
{{ if and (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
**Example 4: With**
An alternative way of writing "if" and then referencing the same value
is to use "with" instead. With rebinds the context `.` within its scope,
and skips the block if the variable is absent.
The first example above could be simplified as:
{{ with .Params.title }}<h4>{{ . }}</h4>{{ end }}
**Example 5: If -> Else If**
{{ if isset .Params "alt" }}
{{ index .Params "alt" }}
{{ else if isset .Params "caption" }}
{{ index .Params "caption" }}
{{ end }}
## Pipes
One of the most powerful components of go templates is the ability to
stack actions one after another. This is done by using pipes. Borrowed
from unix pipes, the concept is simple, each pipeline's output becomes the
input of the following pipe.
Because of the very simple syntax of go templates, the pipe is essential
to being able to chain together function calls. One limitation of the
pipes is that they only can work with a single value and that value
becomes the last parameter of the next pipeline.
A few simple examples should help convey how to use the pipe.
**Example 1 :**
{{ if eq 1 1 }} Same {{ end }}
is the same as
{{ eq 1 1 | if }} Same {{ end }}
It does look odd to place the if at the end, but it does provide a good
illustration of how to use the pipes.
**Example 2 :**
{{ index .Params "disqus_url" | html }}
Access the page parameter called "disqus_url" and escape the HTML.
**Example 3 :**
{{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
Stuff Here
{{ end }}
Could be rewritten as
{{ isset .Params "caption" | or isset .Params "title" | or isset .Params "attr" | if }}
Stuff Here
{{ end }}
## Context (aka. the dot)
The most easily overlooked concept to understand about go templates is that {{ . }}
always refers to the current context. In the top level of your template this
will be the data set made available to it. Inside of a iteration it will have
the value of the current item. When inside of a loop the context has changed. .
will no longer refer to the data available to the entire page. If you need to
access this from within the loop you will likely want to set it to a variable
instead of depending on the context.
**Example:**
{{ $title := .Site.Title }}
{{ range .Params.tags }}
<li> <a href="{{ $baseurl }}/tags/{{ . | urlize }}">{{ . }}</a> - {{ $title }} </li>
{{ end }}
Notice how once we have entered the loop the value of {{ . }} has changed. We
have defined a variable outside of the loop so we have access to it from within
the loop.
# Hugo Parameters
Hugo provides the option of passing values to the template language
through the site configuration (for sitewide values), or through the meta
data of each specific piece of content. You can define any values of any
type (supported by your front matter/config format) and use them however
you want to inside of your templates.
## Using Content (page) Parameters
In each piece of content you can provide variables to be used by the
templates. This happens in the [front matter](/content/front-matter).
An example of this is used in this documentation site. Most of the pages
benefit from having the table of contents provided. Sometimes the TOC just
doesn't make a lot of sense. We've defined a variable in our front matter
of some pages to turn off the TOC from being displayed.
Here is the example front matter:
```
---
title: "Permalinks"
date: "2013-11-18"
aliases:
- "/doc/permalinks/"
groups: ["extras"]
groups_weight: 30
notoc: true
---
```
Here is the corresponding code inside of the template:
{{ if not .Params.notoc }}
<div id="toc" class="well col-md-4 col-sm-6">
{{ .TableOfContents }}
</div>
{{ end }}
## Using Site (config) Parameters
In your top-level configuration file (eg, `config.yaml`) you can define site
parameters, which are values which will be available to you in chrome.
For instance, you might declare:
```yaml
params:
CopyrightHTML: "Copyright &#xA9; 2013 John Doe. All Rights Reserved."
TwitterUser: "spf13"
SidebarRecentLimit: 5
```
Within a footer layout, you might then declare a `<footer>` which is only
provided if the `CopyrightHTML` parameter is provided, and if it is given,
you would declare it to be HTML-safe, so that the HTML entity is not escaped
again. This would let you easily update just your top-level config file each
January 1st, instead of hunting through your templates.
```
{{if .Site.Params.CopyrightHTML}}<footer>
<div class="text-center">{{.Site.Params.CopyrightHTML | safeHtml}}</div>
</footer>{{end}}
```
An alternative way of writing the "if" and then referencing the same value
is to use "with" instead. With rebinds the context `.` within its scope,
and skips the block if the variable is absent:
```
{{with .Site.Params.TwitterUser}}<span class="twitter">
<a href="https://twitter.com/{{.}}" rel="author">
<img src="/images/twitter.png" width="48" height="48" title="Twitter: {{.}}"
alt="Twitter"></a>
</span>{{end}}
```
Finally, if you want to pull "magic constants" out of your layouts, you can do
so, such as in this example:
```
<nav class="recent">
<h1>Recent Posts</h1>
<ul>{{range first .Site.Params.SidebarRecentLimit .Site.Recent}}
<li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
{{end}}</ul>
</nav>
```
[go]: <http://golang.org/>
[gohtmltemplate]: <http://golang.org/pkg/html/template/>

View File

@ -0,0 +1,91 @@
+++
title = "Getting Started with Hugo"
description = "Goto hugo releases and download the appropriate version for your os and architecture."
tags = [
"go",
"golang",
"hugo",
"development",
]
date = "2014-04-02"
categories = [
"Development",
"golang",
]
menu = "main"
+++
## Step 1. Install Hugo
Goto [hugo releases](https://github.com/spf13/hugo/releases) and download the
appropriate version for your os and architecture.
<!--more-->
Save it somewhere specific as we will be using it in the next step.
More complete instructions are available at [installing hugo](/overview/installing/)
## Step 2. Build the Docs
Hugo has its own example site which happens to also be the documentation site
you are reading right now.
Follow the following steps:
1. Clone the [hugo repository](http://github.com/spf13/hugo)
2. Go into the repo
3. Run hugo in server mode and build the docs
4. Open your browser to http://localhost:1313
Corresponding pseudo commands:
git clone https://github.com/spf13/hugo
cd hugo
/path/to/where/you/installed/hugo server --source=./docs
> 29 pages created
> 0 tags index created
> in 27 ms
> Web Server is available at http://localhost:1313
> Press ctrl+c to stop
Once you've gotten here, follow along the rest of this page on your local build.
## Step 3. Change the docs site
Stop the Hugo process by hitting ctrl+c.
Now we are going to run hugo again, but this time with hugo in watch mode.
/path/to/hugo/from/step/1/hugo server --source=./docs --watch
> 29 pages created
> 0 tags index created
> in 27 ms
> Web Server is available at http://localhost:1313
> Watching for changes in /Users/spf13/Code/hugo/docs/content
> Press ctrl+c to stop
Open your [favorite editor](http://vim.spf13.com) and change one of the source
content pages. How about changing this very file to *fix the typo*. How about changing this very file to *fix the typo*.
Content files are found in `docs/content/`. Unless otherwise specified, files
are located at the same relative location as the url, in our case
`docs/content/overview/quickstart.md`.
Change and save this file.. Notice what happened in your terminal.
> Change detected, rebuilding site
> 29 pages created
> 0 tags index created
> in 26 ms
Refresh the browser and observe that the typo is now fixed.
Notice how quick that was. Try to refresh the site before it's finished building.. I double dare you.
Having nearly instant feedback enables you to have your creativity flow without waiting for long builds.
## Step 4. Have fun
The best way to learn something is to play with it.

View File

@ -0,0 +1,164 @@
---
date: 2014-03-10
linktitle: Migrating from Jekyll
menu:
main:
parent: tutorials
prev: /tutorials/mathjax
title: Migrate to Hugo from Jekyll
description: Jekyll has a rule that any directory not starting with `_` will be copied as-is to the `_site` output.
weight: 10
---
## Move static content to `static`
Jekyll has a rule that any directory not starting with `_` will be copied as-is to the `_site` output.
<!--more-->
Hugo keeps all static content under `static`. You should therefore move it all there.
With Jekyll, something that looked like
<root>/
▾ images/
logo.png
should become
<root>/
▾ static/
▾ images/
logo.png
Additionally, you'll want any files that should reside at the root (such as `CNAME`) to be moved to `static`.
## Create your Hugo configuration file
Hugo can read your configuration as JSON, YAML or TOML. Hugo supports parameters custom configuration too. Refer to the [Hugo configuration documentation](/overview/configuration/) for details.
## Set your configuration publish folder to `_site`
The default is for Jekyll to publish to `_site` and for Hugo to publish to `public`. If, like me, you have [`_site` mapped to a git submodule on the `gh-pages` branch](http://blog.blindgaenger.net/generate_github_pages_in_a_submodule.html), you'll want to do one of two alternatives:
1. Change your submodule to point to map `gh-pages` to public instead of `_site` (recommended).
git submodule deinit _site
git rm _site
git submodule add -b gh-pages git@github.com:your-username/your-repo.git public
2. Or, change the Hugo configuration to use `_site` instead of `public`.
{
..
"publishdir": "_site",
..
}
## Convert Jekyll templates to Hugo templates
That's the bulk of the work right here. The documentation is your friend. You should refer to [Jekyll's template documentation](http://jekyllrb.com/docs/templates/) if you need to refresh your memory on how you built your blog and [Hugo's template](/layout/templates/) to learn Hugo's way.
As a single reference data point, converting my templates for [heyitsalex.net](http://heyitsalex.net/) took me no more than a few hours.
## Convert Jekyll plugins to Hugo shortcodes
Jekyll has [plugins](http://jekyllrb.com/docs/plugins/); Hugo has [shortcodes](/doc/shortcodes/). It's fairly trivial to do a port.
### Implementation
As an example, I was using a custom [`image_tag`](https://github.com/alexandre-normand/alexandre-normand/blob/74bb12036a71334fdb7dba84e073382fc06908ec/_plugins/image_tag.rb) plugin to generate figures with caption when running Jekyll. As I read about shortcodes, I found Hugo had a nice built-in shortcode that does exactly the same thing.
Jekyll's plugin:
```ruby
module Jekyll
class ImageTag < Liquid::Tag
@url = nil
@caption = nil
@class = nil
@link = nil
// Patterns
IMAGE_URL_WITH_CLASS_AND_CAPTION =
IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK = /(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)"(.*?)"(\s+)->((https?:\/\/|\/)(\S+))(\s*)/i
IMAGE_URL_WITH_CAPTION = /((https?:\/\/|\/)(\S+))(\s+)"(.*?)"/i
IMAGE_URL_WITH_CLASS = /(\w+)(\s+)((https?:\/\/|\/)(\S+))/i
IMAGE_URL = /((https?:\/\/|\/)(\S+))/i
def initialize(tag_name, markup, tokens)
super
if markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK
@class = $1
@url = $3
@caption = $7
@link = $9
elsif markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION
@class = $1
@url = $3
@caption = $7
elsif markup =~ IMAGE_URL_WITH_CAPTION
@url = $1
@caption = $5
elsif markup =~ IMAGE_URL_WITH_CLASS
@class = $1
@url = $3
elsif markup =~ IMAGE_URL
@url = $1
end
end
def render(context)
if @class
source = "<figure class='#{@class}'>"
else
source = "<figure>"
end
if @link
source += "<a href=\"#{@link}\">"
end
source += "<img src=\"#{@url}\">"
if @link
source += "</a>"
end
source += "<figcaption>#{@caption}</figcaption>" if @caption
source += "</figure>"
source
end
end
end
Liquid::Template.register_tag('image', Jekyll::ImageTag)
```
is written as this Hugo shortcode:
<!-- image -->
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
<img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} />
{{ if .Get "link"}}</a>{{ end }}
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
<figcaption>{{ if isset .Params "title" }}
{{ .Get "title" }}{{ end }}
{{ if or (.Get "caption") (.Get "attr")}}<p>
{{ .Get "caption" }}
{{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
{{ .Get "attr" }}
{{ if .Get "attrlink"}}</a> {{ end }}
</p> {{ end }}
</figcaption>
{{ end }}
</figure>
<!-- image -->
### Usage
I simply changed:
{% image full http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg "One of my favorite touristy-type photos. I secretly waited for the good light while we were "having fun" and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." ->http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/ %}
to this (this example uses a slightly extended version named `fig`, different than the built-in `figure`):
{{%/* fig class="full" src="http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg" title="One of my favorite touristy-type photos. I secretly waited for the good light while we were having fun and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." link="http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/" */%}}
As a bonus, the shortcode named parameters are, arguably, more readable.
## Finishing touches
### Fix content
Depending on the amount of customization that was done with each post with Jekyll, this step will require more or less effort. There are no hard and fast rules here except that `hugo server --watch` is your friend. Test your changes and fix errors as needed.
### Clean up
You'll want to remove the Jekyll configuration at this point. If you have anything else that isn't used, delete it.
## A practical example in a diff
[Hey, it's Alex](http://heyitsalex.net/) was migrated in less than a _father-with-kids day_ from Jekyll to Hugo. You can see all the changes (and screw-ups) by looking at this [diff](https://github.com/alexandre-normand/alexandre-normand/compare/869d69435bd2665c3fbf5b5c78d4c22759d7613a...b7f6605b1265e83b4b81495423294208cc74d610).

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

View File

@ -0,0 +1,18 @@
{{ partial "head.html" . }}
<body>
{{ partial "nav.html" . }}
<section id="wrapper" class="home">
<article class="post">
<header>
<h1>{{ with .Site.Params.title404 }}{{ . }}{{ else }}404 - Page not found{{ end }}</h1>
<h3>{{ with .Site.Params.subtitle404 }}{{ . }}{{ else }}The content you're looking for doesn't seem to exist.{{ end }}</h3>
</header>
{{ partial "latest-posts.html" . }}
</article>
{{ partial "footer.html" . }}
</section>
</body>
</html>

View File

@ -0,0 +1,30 @@
{{ partial "head.html" . }}
<body>
{{ partial "nav.html" . }}
{{ partial "profile.html" . }}
<section id="wrapper" class="home">
{{ range .Data.Pages.GroupByDate "2006" }}
<div class="archive">
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<div class="post-item">
<div class="post-time">{{ .Date.Format "Jan 2" }}</div>
<a href="{{ .Permalink }}" class="post-link">
{{ .Title }}
</a>
</div>
{{ end }}
</ul>
</div>
{{ end }}
{{ partial "footer.html" . }}
</section>
<div class="dd">
</div>
{{ partial "js.html" . }}
</body>
</html>

View File

@ -0,0 +1,55 @@
{{ partial "head.html" . }}
<body>
{{ partial "nav.html" . }}
<section id="wrapper" class="post">
<article>
<header>
<h1>
{{ .Title }}
</h1>
<h2 class="headline">
{{ .Date.Format "Jan 2, 2006 15:04" }}
· {{ if lt 1 .WordCount }}{{ .WordCount }} words{{ else }}{{ .WordCount }} word{{ end }}
· {{ .ReadingTime }} minute read
<span class="tags">
{{ with .Params.tags }}
{{ if ge (len .) 1 }}
{{ range . }}
<a href="{{ $.Site.BaseURL }}tags/{{ . | urlize }}">{{ . }}</a>
{{ end }}
{{ end }}
{{ end}}
</span>
</h2>
</header>
{{ if .Site.Params.enableToc }}
{{ if .TableOfContents }}
<div id="toc">
{{ .TableOfContents }}
</div>
{{ end }}
{{ end }}
<section id="post-body">
{{ .Content }}
</section>
</article>
{{ if .Site.Params.enableShare }}
{{ partial "share.html" . }}
{{ end }}
{{ if .Site.Params.enableDisqus }}
{{ partial "disqus.html" . }}
{{ end }}
{{ if .Site.Params.showLatestPosts }}
{{ partial "latest-posts.html" . }}
{{ end }}
{{ partial "footer.html" . }}
</section>
{{ partial "js.html" . }}
</body>
</html>

View File

@ -0,0 +1,28 @@
{{ partial "head.html" . }}
<body>
{{ partial "nav.html" . }}
{{ partial "profile.html" . }}
<section id="wrapper" class="tags">
<div class="page-tags">
<ul>
{{ $data := .Data }}
{{ range $key, $value := .Data.Terms.ByCount }}
{{ if ($value.Name) }}
<li>
<a href="{{ $.Site.BaseURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}">
{{ $value.Name | upper }} <span>({{ $value.Count }})</span>
</a>
</li>
{{ end }}
{{ end }}
</ul>
</div>
{{ partial "footer.html" . }}
</section>
{{ partial "js.html" . }}
</body>
</html>

View File

@ -0,0 +1,15 @@
{{ partial "head.html" . }}
<body>
{{ partial "nav.html" . }}
{{ partial "profile.html" . }}
<section id="wrapper" class="home">
{{ partial "post-list.html" . }}
{{ partial "pagination.html" . }}
{{ partial "footer.html" . }}
</section>
{{ partial "js.html" . }}
</body>
</html>

View File

@ -0,0 +1,13 @@
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = '{{ .Site.Params.disqusShortname }}';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>

View File

@ -0,0 +1,15 @@
<footer id="footer">
{{ if .Site.Social }}
{{ partial "social.html" . }}
{{ end }}
<p class="small">
{{ with .Site.Params.copyright }}
{{ . | markdownify }}
{{ else }}
© Copyright {{ now.Format "2006"}} <i class="fa fa-heart" aria-hidden="true"></i> {{ .Site.Params.Author }}
{{ end }}
</p>
<p class="small">
Powered by <a href="http://www.gohugo.io/">Hugo</a> Theme By <a href="https://github.com/nodejh/hugo-theme-cactus-plus">nodejh</a>
</p>
</footer>

View File

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html {{ with .Site.LanguageCode }}lang="{{ . }}"{{ end }}>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ if .Site.Params.enableTwitterCard }}
{{ partial "twitter-cards.html" . }}
{{ end }}
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
{{ .Hugo.Generator }}
<title>{{ if .IsHome }}{{ .Title }}{{ else }}{{ .Title }} &middot; {{ .Site.Title }}{{ end }}</title>
<link rel="shortcut icon" href="{{ .Site.BaseURL }}images/favicon.ico">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/style.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/highlight.css">
{{ if eq .Site.Params.iconFont "font-awesome" }}
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/font-awesome.min.css">
{{ else }}
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/monosocialiconsfont.css">
{{ end }}
{{ if .Site.Params.enableRSS }}
<link href="{{ .Site.RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}
{{ range .Site.Params.customCSS }}
<link rel="stylesheet" href="{{ $.Site.BaseURL }}{{ . }}">
{{ end }}
</head>

View File

@ -0,0 +1,25 @@
<script src="{{ .Site.BaseURL }}js/jquery-3.3.1.min.js"></script>
<script src="{{ .Site.BaseURL }}js/main.js"></script>
<script src="{{ .Site.BaseURL }}js/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
{{ range .Site.Params.customJS }}
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
{{ end }}
{{ if .Site.Params.enableGoogleAnalytics }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}
{{ if .Site.Params.enableBaiduAnalytics }}
<script>
var baiduAnalytics = '{{ .Site.Params.baiduAnalytics }}';
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?" + baiduAnalytics;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
{{ end }}

View File

@ -0,0 +1,11 @@
<ul id="post-list" class="archive readmore">
<h3>{{ .Site.Params.readMore | default "Read more" }}</h3>
{{ $kind := where .Site.RegularPages "Section" "!=" "" }}
{{ $othr := where $kind "URL" "!=" .URL }}
{{ range first 10 $othr }}
<li>
<a href="{{ .URL }}">{{ .LinkTitle }}<aside class="dates">{{ .Date.Format "Jan 2 2006" }}</aside></a>
</li>
{{ end }}
</ul>

View File

@ -0,0 +1,17 @@
<nav class="main-nav">
{{ $url := replace .Permalink .Site.BaseURL "" }}
{{ if not .IsHome }}
<a href='{{ .Site.BaseURL }}'> <span class="arrow"></span>{{ with .Site.Params.home }}{{ . }}{{ else }}Home{{ end }}</a>
{{ end }}
<a href='{{ .Site.BaseURL }}posts'>{{ with .Site.Params.archive }}{{ . }}{{ else }}Archive{{ end }}</a>
<a href='{{ .Site.BaseURL }}tags'>{{ with .Site.Params.tags }}{{ . }}{{ else }}Tags{{ end }}</a>
<a href='{{ .Site.BaseURL }}about'>{{ with .Site.Params.about }}{{ . }}{{ else }}About{{ end }}</a>
{{ range $key, $val := .Site.Params.Links }}
<a href="{{ $val }}">{{ $key }}</a>
{{ end }}
{{ if .Site.Params.enableRSS }}
<a class="cta" href="{{ .Site.RSSLink }}">{{ with .Site.Params.subscribe }}{{ . }}{{ else }}Subscribe{{ end }}</a>
{{ end }}
</nav>

View File

@ -0,0 +1,18 @@
<nav id="post-nav">
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
{{ if .Paginator.HasPrev }}
<span class="prev">
<a href="{{.Paginator.Prev.URL}}">
<span class="arrow"></span> {{ with .Site.Params.newerPosts }}{{ . }}{{ else }}Newer Posts{{ end }}
</a>
</span>
{{ end }}
{{ if .Paginator.HasNext }}
<span class="next">
<a href="{{.Paginator.Next.URL}}">
{{ with .Site.Params.olderPosts }}{{ . }}{{ else }}Older Posts{{ end }} <span class="arrow"></span>
</a>
</span>
{{ end }}
{{ end }}
</nav>

View File

@ -0,0 +1,20 @@
<ul id="post-list">
{{ range where .Paginator.Pages "Params.hidden" "ne" "true" }}
{{ $url := replace .Permalink .Site.BaseURL "" }}
{{ if ne $url "about/" }}
<li>
<aside class="dates">{{ .Date.Format "Jan 2" }}</aside>
<a href='{{ .Permalink }}'>
{{ .Title }}
{{ if .Site.Params.enableSummary }}
{{ if .Site.Params.useDescriptionReplaceSummary }}
<h2>{{ .Description | plainify }}</h2>
{{ else }}
<h2>{{ .Summary | plainify | htmlUnescape }}</h2>
{{ end }}
{{ end }}
</a>
</li>
{{ end }}
{{ end }}
</ul>

View File

@ -0,0 +1,11 @@
<div class="profile">
<section id="wrapper">
<header id="header">
<a href='{{ with .Site.Params.avatarLink }}{{ . }}{{ else }}{{ .Site.BaseURL }}about{{ end }}'>
<img id="avatar" class="2x" src="{{ .Site.BaseURL }}images/avatar.png"/>
</a>
<h1>{{ .Site.Title }}</h1>
{{ with .Site.Params.bio }}<h2>{{ . | markdownify }}</h2>{{ end }}
</header>
</section>
</div>

View File

@ -0,0 +1,9 @@
<a class="twitter" href="https://twitter.com/intent/tweet?text={{ .Permalink }} - {{ .LinkTitle }} {{ with .Site.Params.twitter }}by @{{ . }}{{ end }}"><span class="icon-twitter"> {{ .Site.Params.tweet | default "tweet" }}</span></a>
<a class="facebook" href="#" onclick="
window.open(
'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(location.href),
'facebook-share-dialog',
'width=626,height=436');
return false;"><span class="icon-facebook-rect"> {{ .Site.Params.share | default "Share" }}</span>
</a>

View File

@ -0,0 +1,20 @@
<div id="social">
{{ if eq .Site.Params.iconFont "font-awesome" }}
{{ range $key, $val := .Site.Social }}
<a class="symbol" href="{{ $val }}">
<i class="fa fa-{{ $key }}"></i>
</a>
{{ end }}
{{ else }}
{{ $iconStyle := .Site.Params.socialIconStyle }}
{{ range $key, $val := .Site.Social }}
<a class="symbol" href="{{ $val }}">
{{ $iconStyle }}{{ if eq $key "twitter" }}twitterbird{{ else }}{{ $key }}{{ end }}
</a>
{{ end }}
{{ end }}
</div>

View File

@ -0,0 +1,46 @@
{{ if .IsPage }}
{{ with .Params.images }}
<!-- Twitter summary card with large image must be at least 280x150px -->
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image:src" content="{{ index . 0 | absURL }}"/>
{{ else }}
<meta name="twitter:card" content="summary"/>
{{ if .Site.Params.twitterCardImage }}
<meta name="twitter:image" content="{{ .Site.Params.twitterCardImage | absURL }}" />
{{ else }}
<meta name="twitter:image" content="{{ .Site.BaseURL }}images/avatar.png" />
{{ end }}
{{ end }}
<!-- Twitter Card data -->
<meta name="twitter:title" content="{{ .Title }}"/>
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"/>
{{ with .Site.Params.twitter }}
<meta name="twitter:site" content="@{{ . }}"/>
{{ end }}
{{ range .Site.Authors }}
{{ with .twitter }}
<meta name="twitter:creator" content="@{{ . }}"/>
{{ end }}
{{ end }}
<!-- no post authors, show site author -->
{{ if eq (len .Site.Authors) 0 }}
<meta name="twitter:creator" content="@{{ .Site.Params.author }}"/>
{{ end }}
{{ else }}
<meta name="twitter:card" content="summary" />
{{ with .Site.Params.twitter }}
<meta name="twitter:site" content="@{{ . }}"/>
{{ end }}
{{ with .Site.Params.author }}
<meta name="twitter:creator" content="@{{ . }}"/>
{{ end }}
<meta name="twitter:title" content="{{ .Site.Title }}"/>
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"/>
{{ if .Site.Params.twitterCardImage }}
<meta name="twitter:image" content="{{ .Site.Params.twitterCardImage | absURL }}" />
{{ else }}
<meta name="twitter:image" content="{{ .Site.BaseURL }}images/avatar.png" />
{{ end }}
{{ end }}

View File

@ -0,0 +1,19 @@
{{ partial "head.html" . }}
<body>
{{ partial "nav.html" . }}
{{ partial "profile.html" . }}
<section id="wrapper" class="home">
{{ .Content }}
{{ if .Site.Params.enableDisqus }}
{{ if ne .Params.disabledisqus "true" }}
{{ partial "disqus.html" . }}
{{ end }}
{{ end }}
{{ partial "footer.html" . }}
</section>
{{ partial "js.html" . }}
</body>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,99 @@
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
code {
background: #fff;
font-size: 11px;
/*font-weight: 100;*/
padding: 4px;
border: none;
box-shadow: inset 0 0 0 1px #E4EBF2;
border-radius: 4px;
overflow: scroll;
font-family: 'Menlo', 'Monaco', Courier, monospace;
}
pre code {
font-size: 11px;
word-wrap: break-word;
-webkit-font-smoothing: subpixel-antialiased;
-moz-osx-font-smoothing: auto;
padding: 16px;
padding-bottom: 14px;
display: block;
color: #808080;
background: #fff;
border: none;
box-shadow: inset 0 0 0 1px #E4EBF2;
border-radius: 4px;
overflow: auto;
}
/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
color: #8e908c;
}
/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
color: #c82829;
}
/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
color: #f5871f;
}
/* Tomorrow Yellow */
.hljs-attribute {
color: #eab700;
}
/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
color: #718c00;
}
/* Tomorrow Blue */
.hljs-title,
.hljs-section {
color: #4271ae;
}
/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
color: #8959a8;
}
code.hljs {
display: block;
white-space: pre;
overflow-x: auto;
word-wrap: normal;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}

View File

@ -0,0 +1,25 @@
@font-face {
font-family: 'Mono Social Icons Font';
src: url('../fonts/MonoSocialIconsFont-1.10.eot');
src: url('../fonts/MonoSocialIconsFont-1.10.eot?#iefix') format('embedded-opentype'),
url('../fonts/MonoSocialIconsFont-1.10.woff') format('woff'),
url('../fonts/MonoSocialIconsFont-1.10.ttf') format('truetype'),
url('../fonts/MonoSocialIconsFont-1.10.svg#MonoSocialIconsFont') format('svg');
src: url('../fonts/MonoSocialIconsFont-1.10.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
.symbol, a.symbol:before {
font-family: 'Mono Social Icons Font';
-webkit-text-rendering: optimizeLegibility;
-moz-text-rendering: optimizeLegibility;
-ms-text-rendering: optimizeLegibility;
-o-text-rendering: optimizeLegibility;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-ms-font-smoothing: antialiased;
-o-font-smoothing: antialiased;
font-smoothing: antialiased;
}

View File

@ -0,0 +1,934 @@
/* Reset */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
margin: 0;
padding: 0
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block
}
body {
line-height: 1
}
blockquote, q {
quotes: none
}
blockquote:before, blockquote:after, q:before, q:after {
content: none
}
table {
border-collapse: collapse;
border-spacing: 0
}
*, *:before, *:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
/* Clearfix */
.clearfix:after {
content: "";
display: table;
clear: both;
}
.hidden {
display: none;
}
/* Icons */
@font-face {
font-family: 'icons';
src: url('../fonts/icons.eot');
src: url('../fonts/icons.eot#iefix') format('embedded-opentype'), url('../fonts/icons.woff') format('woff'), url('../fonts/icons.ttf') format('truetype'), url('../fonts/icons.svg#icons') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "icons";
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
text-align: center;
font-variant: normal;
text-transform: none;
line-height: 1em;
}
.icon-facebook:before {
content: '\e802';
}
.icon-facebook-squared:before {
content: '\e800';
}
.icon-twitter:before {
content: '\e801';
}
.icon-twitter-1:before {
content: '\e804';
}
.icon-facebook-circled:before {
content: '\e805';
}
.icon-twitter-circled:before {
content: '\e806';
}
.icon-facebook-rect:before {
content: '\e803';
}
/* Spacing */
.post h1, h3, h4, h5, p, #post-body ul, #post-list li, #post-body ol, pre {
margin-bottom: 20px;
}
/* Base */
html, body {
height: 100%;
}
body {
font: 16px/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #666;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
h1 {
font-size: 30px;
letter-spacing: -1px;
color: #222;
font-weight: bold;
}
h2 {
font: italic 19px/1.3em Georgia, serif;
color: #bbb;
}
.profile #wrapper {
padding: 60px 40px 0px;
max-width: 600px;
margin: 0 auto;
}
.profile #header {
margin-bottom: 60px;
text-align: center;
position: relative;
}
.profile #avatar {
display: inline-block;
width: 80px;
height: 80px;
border-radius: 50%;
margin-bottom: 20px;
}
.profile h1 {
font-weight: 400;
letter-spacing: 0px;
font-size: 20px;
color: #222;
}
.profile h2 {
font-size: 20px;
font-weight: 300;
color: #aaa;
margin-top: 10px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-style: normal;
}
nav.main-nav {
padding: 20px 20px 0;
background: #fff;
background: rgba(255, 255, 255, .90);
margin: 0 auto;
text-align: right;
z-index: 100;
}
nav.main-nav a {
top: 8px;
right: 6px;
padding: 8px 12px;
color: #5badf0;
font-size: 13px;
line-height: 1.35;
border-radius: 3px;
}
nav.main-nav a.cta {
background: #5badf0;
color: #fff;
margin-left: 12px;
}
@media (max-width: 700px) {
nav.main-nav {
padding: 20px 10px 0 0;
background: #fff;
background: rgba(255, 255, 255, .90);
margin: 0 auto;
text-align: right;
z-index: 100;
}
nav.main-nav a {
top: 8px;
right: 6px;
padding: 8px 8px;
color: #5badf0;
font-size: 13px;
line-height: 1.35;
border-radius: 3px;
}
}
@media (max-width: 324px) {
nav.main-nav a.cta {
display: none;
}
}
#wrapper {
max-width: 600px;
margin: 0 auto;
padding: 60px 20px 100px 20px;
}
#wrapper.home {
max-width: 600px;
margin: 0 auto;
padding: 0px 40px 20px 40px;
}
.home #avatar {
float: right;
width: 40px;
height: 40px;
border-radius: 50%;
}
/* Typography */
/*Accent color*/
a, #title, #post-list a:hover, #title:hover {
text-decoration: none;
color: #5badf0;
color: #5694f1;
}
p a {
color: #5694f1;
}
/*Transitions*/
a, #post-nav a, #post-list a {
-webkit-transition: all 0.15s ease;
-moz-transition: all 0.15s ease;
-ms-transition: all 0.15s ease;
-o-transition: all 0.15s ease;
transition: all 0.15s ease;
}
ul {
margin: 0;
padding: 0;
}
li {
list-style-position: outside;
/* text-indent: -1.5em; */
margin-left: 1.5em;
}
ul>li {
list-style-type: disc;
}
/* Line Height */
#post-body, p {
line-height: 1.7;
}
#post-body p > a {
word-break: break-word;
white-space: pre-wrap;
}
b, strong {
font-weight: 500;
color: #1E2025;
}
em, i {
font-style: italic;
}
#title {
display: inline-block;
line-height: 100%;
font-weight: 500;
font-size: 19px;
margin: 0;
padding-bottom: 20px;
}
.description {
float: right;
font: italic 14px/1.4em Georgia, serif;
color: #aaa;
}
.home h1 {
font-size: 30px;
letter-spacing: -1px;
color: #222;
font-weight: bold;
}
.home h2 {
font: italic 19px/1.3em Georgia, serif;
color: #bbb;
}
.post header {
text-align: center;
}
.post h1 {
margin-top: 40px;
margin-bottom: 20px;
color: #222;
font: 300 32px/1.4em "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.post h2 {
margin-top: 20px;
margin-bottom: 10px;
font: 300 24px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #111;
}
.post h2.headline {
font: normal 13px/1.5em "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: -5px 0 0 0;
color: #b2b9be;
font-size: 13px;
letter-spacing: 1px;
display: inline-block;
}
.post h2.headline .tags {
font: normal 13px/1.5em "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: -5px 0 40px 0;
color: #b2b9be;
font-size: 13px;
text-transform: uppercase;
letter-spacing: 2px;
margin-top: 5px;
display: block;
}
#post-list h2 {
font: normal 17px/1.5em "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #aaa;
margin-top: 2px;
}
h3, h4, h5 {
color: #333;
}
h3 {
font-size: 20px;
font-weight: 400;
}
h4 {
font-size: 16px;
font-weight: bold;
}
h5 {
font-size: 15px;
font-weight: bold;
}
h6 {
font-size: 13px;
font-weight: bold;
color: #666;
margin-bottom: 6px;
}
p.small {
color: #bbb;
font-size: 14px;
line-height: 1.5;
display: block;
text-align: center;
margin-top: 20px;
}
blockquote {
padding-left: 15px;
border-left: 3px solid #eee;
}
hr {
display: block;
border: none;
height: 1px;
margin: 40px auto;
background: #eee;
}
table {
width: 100%;
margin: 40px 0;
border-collapse: collapse;
font-size: 13px;
line-height: 1.5em;
}
th, td {
text-align: left;
padding-right: 20px;
vertical-align: top;
}
table td, td {
border-spacing: none;
border-style: solid;
padding: 10px 15px;
border-width: 1px 0 0 0;
}
tr>td {
border-top: 1px solid #eaeaea;
}
tr:nth-child(odd)>td {
background: #fcfcfc;
}
thead th, th {
text-align: left;
padding: 10px 15px;
height: 20px;
font-size: 13px;
font-weight: bold;
color: #444;
border-bottom: 1px solid #dadadc;
cursor: default;
white-space: nowrap;
}
img {
width: 100%;
max-width: 100%;
border-radius: 3px;
}
/* Made with Cactus Badge */
#badge {
position: absolute;
bottom: 8px;
right: 8px;
height: 48px;
width: 48px;
}
/*=========================================
Post List
=========================================== */
#post-list, #archive-list {
}
#post-list li, #archive-list li {
list-style-type: none;
}
#post-list li:last-child {
margin-bottom: 0;
}
#post-list li+li {
padding-top: 20px;
}
#post-list a {
color: #333;
display: block;
font: bold 19px/1.7 "Helvetica Neue", helvetica, Arial, sans-serif;
}
#post-list .dates {
float: right;
position: relative;
top: 1px;
font: 300 17px/1.8 "Helvetica Neue", helvetica, Arial, sans-serif;
color: #bbb;
}
#post-list-footer {
border-top: 1px solid #eee;
margin-top: 20px;
padding-top: 100px;
}
#archive-link {
display: inline-block;
font-size: 13px;
font-weight: bold;
border-radius: 4px;
padding: 3px 10px 6px;
box-shadow: 0 0 0 1px hsla(207, 83%, 80%, 1);
}
#archive-link:hover {
background: #5694f1;
color: #fff;
box-shadow: 0 0 0 1px #5694f1;
}
#archive-link span {
position: relative;
top: 0;
font-size: 17px;
}
#footer {
margin-top: 100px;
}
/* Post Page */
#header {
}
#wrapper.post {
max-width: 670px;
}
.post {
margin: auto;
}
#post-meta {
font-size: 13px;
font-weight: bold;
line-height: 1.4;
border-top: 1px solid #eee;
padding-top: 40px;
margin-bottom: 40px;
padding-bottom: 40px;
margin-top: 40px;
color: #444;
border-bottom: 1px solid #eee;
}
#post-meta div span {
color: #aaa;
font-weight: 500;
display: block;
}
#post-meta div span.dark {
color: #1E2025;
}
#post-meta div {
margin: 0 25px 0 0;
float: left;
}
#sharing {
float: right;
margin: -2px;
}
#sharing a {
font-size: 20px;
font-size: 23px;
margin-left: 1px;
margin-top: 4px;
color: #d4d4d4;
display: inline-block;
vertical-align: middle;
}
#sharing a:hover {
opacity: 0.8;
}
/* Post Navigation */
#post-nav {
text-align: center;
padding-top: 20px;
font-size: 13px;
font-weight: 500;
margin-top: 40px;
}
#post-nav span {
-webkit-transition: all 0.1s linear;
-moz-transition: all 0.1s linear;
-ms-transition: all 0.1s linear;
-o-transition: all 0.1s linear;
transition: all 0.1s linear;
position: relative;
}
#post-nav span.prev {
float: left;
}
#post-nav span.next {
float: right;
}
#post-nav span .arrow {
position: relative;
padding: 1px;
}
#post-nav span.prev:hover .arrow {
left: -4px;
}
#post-nav span.next:hover .arrow {
right: -4px;
}
#post-nav span.prev:hover {
left: -3px;
}
#post-nav span.next:hover {
right: -3px;
}
/* Archive */
h1.archive {
margin-bottom: 0px;
}
h2.month {
width: 100%;
font: bold 13px/1 "Helvetica Neue", helvetica, Arial, sans-serif;
text-transform: uppercase;
margin-top: 40px;
margin-bottom: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #eee;
}
#archive-list li:last-child {
margin-bottom: 0;
}
#archive-list a {
display: block;
font: bold 17px/1.7 "Helvetica Neue", helvetica, Arial, sans-serif;
color: #333;
}
#archive-list .dates {
float: right;
position: relative;
top: 1px;
font: 300 17px/1.7 "Helvetica Neue", helvetica, Arial, sans-serif;
color: #bbb;
}
#archive-list li a:hover, #archive-list li:hover .dates {
color: #5694f1;
}
#post-meta img.avatar {
height: 36px;
width: 36px;
float: left;
border-radius: 50%;
margin-top: 3px;
margin-right: 20px;
box-shadow: 0 0 0 3px #fff, 0 0 0 4px #eee;
}
#post-list.archive.readmore {
margin-top: 70px;
}
#post-list.archive.readmore li {
margin-bottom: 0px;
}
#post-list.archive.readmore h3 {
font: 400 20px "Helvetica Neue", Helvetica, Arial, sans-serif;
margin-bottom: 30px;
}
#post-list.archive.readmore a {
font: 400 16px/1.6 "Helvetica Neue", helvetica, Arial, sans-serif;
color: #5694f1;
}
#post-list.archive.readmore a:hover {
opacity: 0.8;
}
#post-list.archive.readmore .dates {
font: 300 16px/1.6 "Helvetica Neue", helvetica, Arial, sans-serif;
}
#disqus_thread, #ds-thread {
margin-top: 100px;
}
#sharing a.facebook {
background: #4361b3;
}
#sharing a.twitter {
background: #4fafed;
}
#sharing a {
font-size: 20px;
font-size: 13px;
font-weight: bold;
color: #fff;
padding: 6px 10px;
border-radius: 4px;
margin-left: 2px;
}
/* Media Queries */
@media screen and (max-width: 540px) {
#wrapper {
padding: 20px 20px 20px 20px;
}
#header {
margin-bottom: 60px;
}
.post {
margin: 40px 0;
}
#footer {
margin-top: 60px;
}
#post-list, #archive-list {
margin-top: 0;
}
#post-meta {
margin-top: 60px;
}
#title {
font-size: 17px;
}
#post-list .dates {
display: none;
}
#post-list-footer {
margin-top: 20px;
padding-top: 40px;
}
h1 {
font-size: 26px;
}
.post h2.headline {
font-size: 13px;
}
.post h1 {
font-size: 24px;
}
.post h2 {
font-size: 20px;
}
}
.archive {
margin: 0 0 50px 0;
font-size: 16px;
}
.archive .post-item {
padding: 10px 0px;
overflow-x: hidden;
white-space:nowrap;
}
.archive .post-time {
display: inline-block;
width: 60px;
margin: 0;
color: #8a8a8a;
}
@media screen and (max-width: 768px) {
.archive .post-time {
margin: 5px 0;
width: auto;
font-size: 13px;
display: block;
}
}
.archive .post-link {
color: #8a8a8a;
}
.archive .post-item:hover {
color: #5694f1;
transition: 0.3s ease-out;
}
.archive .post-item:hover .post-link {
color: #5694f1;
}
.fa.fa-heart:hover {
color: #ff3356;
transition: 0.7s ease-out;
cursor: pointer;
}
/* CUSTOM ADDITIONS */
#social {
text-align: center;
}
a.symbol {
color: #cdd4da;
font-size: 2rem;
text-decoration: none;
margin-right: 0.3rem;
}
a.symbol:hover {
color: #BCD4DA;
}
/**
* Table of content
*/
#toc {
line-height: 1em;
font-size: .7em;
word-wrap: break-word;
padding: 8px;
padding-left: 16px;
padding-bottom: 14px;
margin: 0 0 25px 0;
display: block;
color: #808080;
background: #fff;
border: none;
box-shadow: inset 0 0 0 1px #E4EBF2;
border-radius: 4px;
overflow: hidden;
font-family: 'Menlo', 'Monaco', Courier, monospace;
}
#TableOfContents {
margin: 1em 0 0 0;
overflow-x: auto;
word-wrap: normal;
word-break: break-all;
white-space: nowrap;
}
#TableOfContents ul {
list-style-type:none;
margin: 0;
padding: 0 .5em;
}
#TableOfContents ul li {
list-style-type: none;
line-height: 1.7em;
}
#TableOfContents > ul {
padding: 0;
}
#TableOfContents > ul > li > ul {
padding: 0;
}
#TableOfContents a code{
font-family: Menlo, Monaco, Courier;
background-color: #fff;
font-size: 11px;
padding: 2px 3px;
font-weight: 100;
}
/**
* tags page
*/
#wrapper.tags {
max-width: 768px;
padding-top: 0;
}
.page-tags {
text-align: center;
}
.page-tags ul li {
margin: 10px 15px;
display: inline-block;
font-size: 1.2em;
}
.page-tags ul li a {
color: #8a8a8a;
}
.page-tags ul li a span {
font-size: .9em;
}
.page-tags ul li a:hover {
color: #5694f1;
}

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 283 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

View File

@ -0,0 +1,18 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Copyright (C) 2013 by original authors @ fontello.com</metadata>
<defs>
<font id="icons" horiz-adv-x="1000" >
<font-face font-family="icons" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
<missing-glyph horiz-adv-x="1000" />
<glyph glyph-name="facebook" unicode="&#xe802;" d="m285 540h144l-17-159h-127v-460h-190v460h-95v159h95v95q0 102 48 154t158 52h126v-158h-79q-22 0-35-4t-19-13t-7-19t-2-28v-79z" horiz-adv-x="428.6" />
<glyph glyph-name="facebook-squared" unicode="&#xe800;" d="m729 338l13 122h-110v61q0 27 8 38t40 11h62v122h-98q-85 0-122-40t-36-119v-73h-74v-122h74v-355h146v355h97z m128 280v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
<glyph glyph-name="twitter" unicode="&#xe801;" d="m904 622q-37-54-90-93q0-8 0-23q0-73-21-145t-64-139t-103-117t-144-82t-181-30q-151 0-276 81q19-3 43-3q126 0 224 77q-59 2-105 36t-64 89q19-2 34-2q24 0 48 6q-63 13-104 62t-41 115v2q38-21 82-23q-37 25-59 64t-22 86q0 49 25 91q68-83 164-133t208-55q-5 21-5 41q0 75 53 127t127 53q79 0 132-57q61 12 114 44q-20-64-79-100q52 6 104 28z" horiz-adv-x="928.6" />
<glyph glyph-name="twitter-1" unicode="&#xe804;" d="m920 636q-36-54-94-98l0-24q0-130-60-250t-186-203t-290-83q-160 0-290 84q14-2 46-2q132 0 234 80q-62 2-110 38t-66 94q10-4 34-4q26 0 50 6q-66 14-108 66t-42 120l0 2q36-20 84-24q-84 58-84 158q0 48 26 94q154-188 390-196q-6 18-6 42q0 78 55 133t135 55q82 0 136-58q60 12 120 44q-20-66-82-104q56 8 108 30z" horiz-adv-x="920" />
<glyph glyph-name="facebook-circled" unicode="&#xe805;" d="m800 683q138-138 138-333q0-193-138-331t-331-137q-195 0-333 137q-136 136-136 331q0 197 136 333q135 136 333 136q195 0 331-136z m-384-271q0 61 39 104t98 43l72 0l0-105l-72 0q-13 0-22-9t-10-22l0-73l104 0l0-103l-104 0l0-258q117 15 205 104q108 107 108 257q0 153-108 259t-257 106q-153 0-259-106t-106-259q0-150 106-257q89-89 206-104l0 258l-103 0l0 103l103 0l0 62z" horiz-adv-x="938" />
<glyph glyph-name="twitter-circled" unicode="&#xe806;" d="m475 408q0 35 25 60t61 25t62-26q27 6 53 20q-10-30-36-47q30 4 49 14q-16-24-44-45l0-11q0-133-111-205q-56-38-131-38q-72 0-132 39q4-1 22-1q58 0 106 36q-29 1-51 18t-29 42q5-2 15-2q15 0 22 2q-28 6-48 29t-19 56q14-7 39-10q-39 28-39 71q0 20 12 43q69-85 177-89q-3 10-3 19z m-6-527q-195 0-333 138q-136 136-136 331q0 197 136 333q135 136 333 136q195 0 331-136q138-138 138-333q0-193-138-331t-331-137z m0 834q-153 0-259-106t-106-259q0-150 106-257t259-108q150 0 257 108t108 257q0 153-108 259t-257 106z" horiz-adv-x="938" />
<glyph glyph-name="facebook-rect" unicode="&#xe803;" d="m183 850c-102 0-183-81-183-183l0-634c0-102 81-183 183-183l344 0l0 391l-104 0l0 141l104 0l0 120c0 94 61 181 201 181c57 0 100-5 100-5l-4-132s-43 1-90 1c-50 0-58-24-58-62l0-103l152 0l-6-141l-146 0l0-391l141 0c102 0 183 81 183 183l0 634c0 102-81 183-183 183l-634 0z" horiz-adv-x="1000" />
</font>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

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,92 @@
/*!
* jquery.tagcloud.js
* A Simple Tag Cloud Plugin for JQuery
*
* https://github.com/addywaddy/jquery.tagcloud.js
* created by Adam Groves
*/
(function($) {
/*global jQuery*/
"use strict";
var compareWeights = function(a, b)
{
return a - b;
};
// Converts hex to an RGB array
var toRGB = function(code) {
if (code.length === 4) {
code = code.replace(/(\w)(\w)(\w)/gi, "\$1\$1\$2\$2\$3\$3");
}
var hex = /(\w{2})(\w{2})(\w{2})/.exec(code);
return [parseInt(hex[1], 16), parseInt(hex[2], 16), parseInt(hex[3], 16)];
};
// Converts an RGB array to hex
var toHex = function(ary) {
return "#" + jQuery.map(ary, function(i) {
var hex = i.toString(16);
hex = (hex.length === 1) ? "0" + hex : hex;
return hex;
}).join("");
};
var colorIncrement = function(color, range) {
return jQuery.map(toRGB(color.end), function(n, i) {
return (n - toRGB(color.start)[i])/range;
});
};
var tagColor = function(color, increment, weighting) {
var rgb = jQuery.map(toRGB(color.start), function(n, i) {
var ref = Math.round(n + (increment[i] * weighting));
if (ref > 255) {
ref = 255;
} else {
if (ref < 0) {
ref = 0;
}
}
return ref;
});
return toHex(rgb);
};
$.fn.tagcloud = function(options) {
var opts = $.extend({}, $.fn.tagcloud.defaults, options);
var tagWeights = this.map(function(){
return $(this).attr("rel");
});
tagWeights = jQuery.makeArray(tagWeights).sort(compareWeights);
var lowest = tagWeights[0];
var highest = tagWeights.pop();
var range = highest - lowest;
if(range === 0) {range = 1;}
// Sizes
var fontIncr, colorIncr;
if (opts.size) {
fontIncr = (opts.size.end - opts.size.start)/range;
}
// Colors
if (opts.color) {
colorIncr = colorIncrement (opts.color, range);
}
return this.each(function() {
var weighting = $(this).attr("rel") - lowest;
if (opts.size) {
$(this).css({"font-size": opts.size.start + (weighting * fontIncr) + opts.size.unit});
}
if (opts.color) {
$(this).css({"color": tagColor(opts.color, colorIncr, weighting)});
}
});
};
$.fn.tagcloud.defaults = {
size: {start: 14, end: 18, unit: "pt"}
};
})(jQuery);

View File

@ -0,0 +1,36 @@
// To make images retina, add a class "2x" to the img element
// and add a <image-name>@2x.png image. Assumes jquery is loaded.
function isRetina() {
var mediaQuery = "(-webkit-min-device-pixel-ratio: 1.5),\
(min--moz-device-pixel-ratio: 1.5),\
(-o-min-device-pixel-ratio: 3/2),\
(min-resolution: 1.5dppx)";
if (window.devicePixelRatio > 1)
return true;
if (window.matchMedia && window.matchMedia(mediaQuery).matches)
return true;
return false;
};
function retina() {
if (!isRetina())
return;
$("img.2x").map(function(i, image) {
var path = $(image).attr("src");
path = path.replace(".png", "@2x.png");
path = path.replace(".jpg", "@2x.jpg");
$(image).attr("src", path);
});
};
$(document).ready(retina);

View File

@ -0,0 +1,17 @@
name = "Cactus Plus"
license = "MIT"
licenselink = "https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/LICENSE.md"
description = "A minimalistic and responsive theme for bloggers."
homepage = "https://github.com/nodejh/hugo-theme-cactus-plus"
tags = ["blog", "beautiful", "disqus", "rss", "syntax highlighting", "tags"]
features = ["blog", "beautiful", "disqus", "rss", "syntax highlighting", "tags"]
min_version = 0.20
[author]
name = "nodejh"
homepage = "https://github.com/nodejh"
[[original]]
name = "Cactus"
homepage = "https://themes.gohugo.io/cactus/"
repo = "https://github.com/digitalcraftsman/hugo-cactus-theme"