Resolve conflicts with remote-tracking branch 'refs/remotes/halogenica/master'

# Conflicts:
#	exampleSite/config.toml
#	exampleSite/content/page/about.md
#	layouts/_default/list.html
#	layouts/partials/disqus.html
#	layouts/partials/head.html
#	layouts/partials/header.html
#	layouts/partials/page.html
#	layouts/partials/post.html
This commit is contained in:
Li-Wen Yip 2017-03-08 19:03:10 +00:00
commit 027faa06a2
17 changed files with 305 additions and 233 deletions

View File

@ -11,17 +11,10 @@ pygmentCodeFences = true
subtitle = "Build a beautiful and simple website in minutes"
logo = "img/avatar-icon.png"
favicon = "img/favicon.ico"
commit = false
dateFormat = "January 2, 2006"
[[Params.bigimg]]
src = "img/path.jpg"
desc = "Path"
# if you add more than one bigimg they will cycle through every 10 seconds
#[[Params.bigimg]]
# src = "img/path.jpg"
# desc = "Another Path"
commit = false
rss = true
comments = true
[Author]
name = "Some Person"
@ -57,15 +50,23 @@ pygmentCodeFences = true
name = "Samples"
weight = 2
[[menu.main]]
parent = "samples"
name = "Math Sample"
url = "/post/2017-03-05-math-sample"
weight = 1
[[menu.main]]
parent = "samples"
name = "Code Sample"
url = "/post/2016-03-08-code-sample"
weight = 2
[[menu.main]]
parent = "samples"
name = "Test Markdown"
url = "/post/2015-02-20-test-markdown"
weight = 3
[[menu.main]]
name = "Tags"

View File

@ -25,16 +25,7 @@ How about a yummy crepe?
![Crepe](http://s3-media3.fl.yelpcdn.com/bphoto/cQ1Yoa75m2yUFFbY2xwuqw/348s.jpg)
Here's a code chunk:
~~~
var foo = function(x) {
return(x + 5);
}
foo(3)
~~~
And here is the same code with syntax highlighting:
Here's a code chunk with syntax highlighting:
```javascript
var foo = function(x) {
@ -42,12 +33,3 @@ var foo = function(x) {
}
foo(3)
```
And here is the same code yet again but with line numbers:
{{< highlight python linenos >}}
var foo = function(x) {
return(x + 5);
}
foo(3)
{{</ highlight >}}

View File

@ -1,6 +1,6 @@
---
title: Code Sample
subtitle: Using Pygments or Highlight.js
subtitle: Using Hugo or Pygments
date: 2016-03-08
tags: ["example", "code"]
---
@ -9,6 +9,17 @@ 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 >}}
@ -20,12 +31,12 @@ The following is a code sample using the "highlight" shortcode provided in Hugo.
{{</ highlight >}}
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.
And here is the same code with line numbers:
```javascript
{{< 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

@ -8,15 +8,12 @@
{{ partial "nav.html" . }}
<div role="main" class="container main-content">
<div class="text-center">
<h1>Whoops, this page doesn't exist.</h1>
<h1>Move along. (404 error)</h1>
<br/>
<img src="{{ .Site.BaseURL }}/img/404-southpark.jpg" />
</div>
</div>
{{ partial "footer.html" . }}

View File

@ -27,14 +27,12 @@
<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">
Posted on {{ .Date.Format .Site.Params.dateFormat }}
</p>
@ -58,7 +56,6 @@
</article>
{{ end }}
</div>
</div>
{{ partial "footer.html" . }}

View File

@ -6,31 +6,20 @@
<body>
{{ partial "nav.html" . }}
<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">
<h2>{{ .Title }}</h2>
</div>
</div>
</div>
</div>
</div>
</header>
{{ partial "header_wp.html" . }}
<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 }}
<li>
<a href="/tags/{{ $value.Name | urlize }}">
{{ $value.Name }}({{ $value.Count }})</a>
</li>
<a href="/tags/{{ $value.Name | urlize }}" class="list-group-item">
{{ $value.Name }}<span class="badge">{{ $value.Count }}</span></a>
{{ end }}
</div>
</article>
</div>
{{ partial "footer.html" . }}
</body>
</html>

View File

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

View File

@ -163,7 +163,7 @@
</a>
</li>
{{ end }}
{{ if .Site.Params.rss }}
<li>
<a href="{{ .Site.BaseURL}}index.xml" title="RSS">
<span class="fa-stack fa-lg">
@ -172,7 +172,7 @@
</span>
</a>
</li>
{{ end }}
</ul>
<p class="credits copyright text-muted">
{{ .Site.Author.name }}
@ -186,7 +186,7 @@
</p>
<!-- Please don't remove this, keep my open source work credited :) -->
<p class="credits theme-by text-muted">
<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>
<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>
{{ with .Site.Params.commit }}&nbsp;&bull;&nbsp;[<a href="{{.}}{{ getenv "GIT_COMMIT_SHA" }}">{{ getenv "GIT_COMMIT_SHA_SHORT" }}</a>]{{ end }}
</p>
</div>
@ -194,12 +194,13 @@
</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="{{ .Site.BaseURL }}/js/main.js"></script>
<script src="{{ .Site.BaseURL }}/js/highlight.min.js"></script>
<script>
hljs.initHighlightingOnLoad();
</script>
<script> hljs.initHighlightingOnLoad(); </script>
<script> renderMathInElement(document.body); </script>
{{ template "_internal/google_analytics.html" . }}

View File

@ -11,6 +11,7 @@
<link rel="alternate" href="{{ "/index.xml" | absURL }}" 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="{{ .Site.BaseURL }}/css/main.css" />
@ -43,6 +44,7 @@
<meta property="og:type" content="website" />
{{ if .Params.id }}
<<<<<<< HEAD
<meta property="og:url" content="{{ .URL | absURL }}" />
<link rel="canonical" href="{{ .URL | absURL }}" />
{{ else }}
@ -56,6 +58,21 @@
<meta property="og:image" content="{{ .Params.bigimg | absURL }}" />
{{ else if .Site.Params.logo }}
<meta property="og:image" content="{{ .Site.Params.logo | absURL }}" />
=======
<meta property="og:url" content="{{ .URL | absURL }}" />
<link rel="canonical" href="{{ .URL | absURL }}" />
{{ else }}
<meta property="og:url" content="{{ .URL | absURL }}" />
<link rel="canonical" href="{{ .URL | absURL }}" />
{{ end }}
{{ if .Params.share_img }}
<meta property="og:image" content="{{ .Params.share_img | absURL }}" />
{{ else if .Params.bigimg }}
<meta property="og:image" content="{{ .Params.bigimg | absURL }}" />
{{ else if .Site.Params.logo }}
<meta property="og:image" content="{{ .Site.Params.logo | absURL }}" />
>>>>>>> refs/remotes/halogenica/master
{{ end }}
<!-- Twitter summary cards -->
@ -64,6 +81,7 @@
<meta name="twitter:creator" content="@{{ .Site.Author.twitter }}" />
{{ if .Params.meta_title }}
<<<<<<< HEAD
<meta name="twitter:title" content="{{ .Params.meta_title }}" />
{{ else if .Title }}
<meta name="twitter:title" content="{{ .Title }}" />
@ -86,5 +104,29 @@
{{ else if .Site.Params.logo }}
<meta name="twitter:image" content="{{ .Site.Params.logo | absURL }}" />
{{ end }}
=======
<meta name="twitter:title" content="{{ .Params.meta_title }}" />
{{ else if .Title }}
<meta name="twitter:title" content="{{ .Title }}" />
{{ else }}
<meta name="twitter:title" content="{{ .Site.Title }}" />
{{ end }}
{{ if .Params.meta_description }}
<meta name="twitter:description" content="{{ .Params.meta_description }}">
{{ else if .Params.subtitle }}
<meta name="twitter:description" content="{{ .Params.subtitle }}">
{{ else }}
<meta name="twitter:description" content="{{ .Content | plainify | htmlEscape | truncate 200 }}">
{{ end }}
{{ if .Params.share_img }}
<meta name="twitter:image" content="{{ .Params.share_img | absURL }}" />
{{ else if .Params.bigimg }}
<meta name="twitter:image" content="{{ .Params.bigimg | absURL }}" />
{{ else if .Site.Params.logo }}
<meta name="twitter:image" content="{{ .Site.Params.logo | absURL }}" />
{{ end }}
>>>>>>> refs/remotes/halogenica/master
</head>

View File

@ -1,7 +1,4 @@
<!-- TODO this file has become a mess, refactor it -->
{{ if or .Params.bigimg .Title }}
{{ if .Params.bigimg }}
<div id="header-big-imgs" data-num-img=1 data-img-src-1="{{.Params.bigimg}}"></div>
{{ end }}

View File

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

View File

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