Skip to content

Commit

Permalink
Update to latest hugo version
Browse files Browse the repository at this point in the history
  • Loading branch information
SchumacherFM committed Apr 18, 2015
1 parent 7794f7e commit acc1f61
Show file tree
Hide file tree
Showing 21 changed files with 75 additions and 72 deletions.
12 changes: 6 additions & 6 deletions content/posts/2014/2014-12-21-dynamic-pages-with-gohugo.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The demoJsonGH short code template is:
```
<ul class="pinglist">
{{ $url := .Get "url" }}
{{ range getJson $url }}
{{ range getJSON $url }}
{{ $p := . }}
<li>
{{$p.language}}: <strong>{{ $p.name }}</strong>
Expand Down Expand Up @@ -100,7 +100,7 @@ The YouTube short code template is:
```
<ul class="pinglist">
{{ $url := .Get "url" }}
{{ $j := getJson $url }}
{{ $j := getJSON $url }}
{{ range $j.feed.entry }}
{{ $v := . }}
Expand Down Expand Up @@ -134,7 +134,7 @@ The html of the `demoCsv` short code displays:
<table border="1">
{{ $url := .Get "url" }}
{{ $sep := .Get "sep" }}
{{ range $i, $r := getCsv $sep $url }}
{{ range $i, $r := getCSV $sep $url }}
{{ if eq $i 0 }}
<thead>
Expand Down Expand Up @@ -177,17 +177,17 @@ Update 8. Feb. 2015:
The parameter `--ignoreCache` has been added to ignore the read from the cache but writing to the cache
is still happening.

`getJson` and `getCsv` are now variadic functions. You can submit multiple parts of an URL which
`getJSON` and `getCSV` are now variadic functions. You can submit multiple parts of an URL which
will be joined to the final URL. Example:

```
{{ $id := .Params._id }}
{{ $url_pre := "http://localhost:3000/db/persons/" }}
{{ $url_post := "/limit/10/skip/0" }}
{{ $gistJ := getJson $url_pre $id $url_post }}
{{ $gistJ := getJSON $url_pre $id $url_post }}
```

For `getCsv` the separator argument has been moved to the beginning of the function.
For `getCSV` the separator argument has been moved to the beginning of the function.

### Futures Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ Update 8. Feb. 2015:
The parameter `--ignoreCache` has been added to ignore the read from the cache but writing to the cache
is still happening.

`getJson` and `getCsv` are now variadic functions. You can submit multiple parts of an URL which
`getJSON` and `getCSV` are now variadic functions. You can submit multiple parts of an URL which
will be joined to the final URL. Example:

```
{{ $id := .Params._id }}
{{ $url_pre := "http://localhost:3000/db/persons/" }}
{{ $url_post := "/limit/10/skip/0" }}
{{ $gistJ := getJson $url_pre $id $url_post }}
{{ $gistJ := getJSON $url_pre $id $url_post }}
```

For `getCsv` the separator argument has been moved to the beginning of the function.
For `getCSV` the separator argument has been moved to the beginning of the function.
4 changes: 2 additions & 2 deletions content/posts/2015/2015-02-25-sql-with-gohugo.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ it would look like:
{{ if eq $i 0 }}
<thead>
<tr>
<th>{{ $r.JoinColumns "</th><th>" | safeHtml }}</th>
<th>{{ $r.JoinColumns "</th><th>" | safeHTML }}</th>
</tr>
</thead>
<tbody>
{{ end }}
<tr>
<td>{{ $r.JoinValues "</td><td>" "*" | safeHtml }}</td>
<td>{{ $r.JoinValues "</td><td>" "*" | safeHTML }}</td>
</tr>
{{ end }}
</tbody>
Expand Down
Binary file modified hugo
Binary file not shown.
3 changes: 2 additions & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
<div class="main-inner group">
<section class="content">
<div class="pad group">
{{ $paginate := (.Paginate (where .Data.Pages "Section" "!=" "page")) }}
{{ if eq .Paginator.PageNumber 1 }}
{{ range first 1 .Data.Pages }}
{{ template "featured.html" . }}
{{end}}
{{end}}
<div class="post-list group">
{{ range $index,$data := (.Paginate (where .Data.Pages "Section" "!=" "page")).Pages }}
{{ range $index,$data := $paginate.Pages }}
{{if gt $index 0}}
{{ if mod $index 2 | eq 1 }}
<div class="post-row">
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<!--[if lt IE 9]>
<script src="wp-content/themes/hueman/js/ie/respond.js"></script>
<![endif]-->
<script type="text/javascript">var bU = "{{.Site.BaseUrl}}/wp-content/plugins/wp-youtube-lyte/lyte/";</script>
<script type="text/javascript">var bU = "{{.Site.BaseURL}}/wp-content/plugins/wp-youtube-lyte/lyte/";</script>
<script type="text/javascript" async defer src="wp-content/plugins/wp-youtube-lyte/lyte/lyte.js"></script>
<script type="text/javascript" async defer src="assets/js/myblog.js"></script>

Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!DOCTYPE html>
<html class="no-js" lang="en-US">
<head>
<base href="{{ .Site.BaseUrl }}/">
<base href="{{ .Site.BaseURL }}/">
{{ partial "head.pace.html" . }}
{{ partial "head.meta.html" . }}
<script>document.documentElement.className = document.documentElement.className.replace("no-js", "js");</script>
<link rel="canonical" href="{{ .Permalink}}">
<link rel='shortlink' href="{{ .Permalink}}"/>
<link rel="shortcut icon" href="{{ .Site.BaseUrl }}/wp-content/uploads/schumacher.png"/>
<link rel="shortcut icon" href="{{ .Site.BaseURL }}/wp-content/uploads/schumacher.png"/>
{{ partial "head.includes.html" . }}
</head>
6 changes: 3 additions & 3 deletions layouts/partials/head.meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@

<meta itemprop="name" content="{{ .Site.Title }} - {{ .Title }}">
<meta itemprop="description" content="{{ .Title }}">
<meta itemprop="image" content="{{ .Site.BaseUrl }}/wp-content/uploads/schumacher.png">
<meta itemprop="image" content="{{ .Site.BaseURL }}/wp-content/uploads/schumacher.png">

<meta property="og:title" content="{{ .Title }} - {{ .Site.Title }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ .Permalink}}" />
<meta property="og:image" content="{{ .Site.BaseUrl }}/wp-content/uploads/schumacher.png" />
<meta property="og:image" content="{{ .Site.BaseURL }}/wp-content/uploads/schumacher.png" />
<meta property="og:description" content="{{ .Title }}" />

<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@SchumacherFM">
<meta name="twitter:title" content="{{ .Title }} - {{ .Site.Title }}">
<meta name="twitter:description" content="{{ .Title }}">
<meta name="twitter:creator" content="@SchumacherFM">
<meta name="twitter:image" content="{{ .Site.BaseUrl }}/wp-content/uploads/schumacher.png">
<meta name="twitter:image" content="{{ .Site.BaseURL }}/wp-content/uploads/schumacher.png">
4 changes: 2 additions & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="nav-toggle"><i class="fa fa-bars"></i></div>
<div class="nav-text"><!-- put your mobile menu text here --></div>
<div class="nav-wrap container">
<a href="{{ .Site.BaseUrl }}" class="nav-cs-icon">
<a href="{{ .Site.BaseURL }}" class="nav-cs-icon">
<img width="40" height="40" src="wp-content/uploads/schumacher.png" alt="schumacherfm" title="Home">
</a>
<ul id="menu-default-menu" class="nav container-inner group">
Expand Down Expand Up @@ -46,7 +46,7 @@

<div class="group pad">
<h1 class="site-title">
<a href="{{ .Site.BaseUrl }}" rel="home">
<a href="{{ .Site.BaseURL }}" rel="home">
<img class="home-icon" width="50" height="50" src="wp-content/uploads/schumacher.png" alt="schumacherfm" title="Home">
{{ .Site.Title }}
</a>
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/pagination.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
({{ $pag.TotalNumberOfElements }} Posts)
</span>
{{ if $pag.HasPrev }}
<a class="previouspostslink" rel="prev" href="{{ $pag.Prev.Url }}">&laquo;</a>
<a class="previouspostslink" rel="prev" href="{{ $pag.Prev.URL }}">&laquo;</a>
{{ end }}
{{ range $p := $pag.Pagers }}
{{ if eq $p $pag }}
<span class="current">{{ $p.PageNumber }}</span>
{{ else }}
<a class="page" href="{{ $p.Url }}">{{ $p.PageNumber }}</a>
<a class="page" href="{{ $p.URL }}">{{ $p.PageNumber }}</a>
{{ end }}
{{ end }}
{{ if $pag.HasNext }}
<a class="nextpostslink" rel="next" href="{{ $pag.Next.Url }}">&raquo;</a>
<a class="nextpostslink" rel="next" href="{{ $pag.Next.URL }}">&raquo;</a>
{{ end }}
</div>
</nav>
2 changes: 1 addition & 1 deletion layouts/partials/relatedPosts.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h4 class="heading">
<ul class="related-posts group">
{{ $page_link := .Permalink }}
{{ $tags := .Params.tags }}
{{ range first 5 .Site.Recent }}
{{ range first 5 .Site.Pages }}
{{ $page := . }}
{{ $has_common_tags := intersect $tags .Params.tags | len | lt 0 }}
{{ if and $has_common_tags (ne $page_link $page.Permalink) }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/sidebarLeft.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<div class="widget widget_recent_entries sidebarLeft"><h3>Last Posts</h3>
<ul>
{{range first .Site.Params.SidebarRecentLimit .Site.Recent}}
{{range first .Site.Params.SidebarRecentLimit .Site.Pages}}
<li><a href="{{ lower .Permalink}}">{{.Title}}</a></li>
{{end}}
</ul>
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/sidebarLeftCategories.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<div class="widget widget_recent_entries sidebarLeftCategories"><h3>Last posts</h3>
<ul>
{{range first .Site.Params.SidebarRecentLimit .Site.Recent}}
{{range first .Site.Params.SidebarRecentLimit .Site.Pages}}
<li><a href="{{ lower .Permalink}}">{{.Title}}</a></li>
{{end}}
</ul>
Expand All @@ -29,7 +29,7 @@
<div class="widget widget_recent_entries sidebarLeftCategories"><h3>Last 5 GitHub Gists</h3>
<ul>
{{ $urlPre := "https://api.github.com" }}
{{ $gistJ := getJson $urlPre "/users/schumacherfm/gists" }}
{{ $gistJ := getJSON $urlPre "/users/schumacherfm/gists" }}
{{range first 5 $gistJ }}
{{ if .public }}
<li><a href="{{ .html_url }}" target="_blank">{{.description}}</a></li>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/sidebarRight.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<div class="widget widget_recent_entries sidebarLeftCategories"><h3>Last 5 GitHub Commits for this blog</h3>
<ul>
{{ $gcJ := getJson "https://api.github.com/repos/schumacherfm/blog-cs/commits" }}
{{ $gcJ := getJSON "https://api.github.com/repos/schumacherfm/blog-cs/commits" }}
{{range first 5 $gcJ }}
<li>
<a href="{{ .html_url}}" target="_blank">
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/demoCsv.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<table border="1">
{{ $url := .Get "url" }}
{{ $sep := .Get "sep" }}
{{ range $i, $r := getCsv $sep $url }}
{{ range $i, $r := getCSV $sep $url }}

{{ if eq $i 0 }}
<thead>
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/demoJsonGH.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ul class="pinglist">
{{ $url := .Get "url" }}
{{ range getJson $url }}
{{ range getJSON $url }}
{{ $p := . }}
<li>
{{$p.language}}: <strong>{{ $p.name }}</strong>
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/demoJsonYT.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ul class="pinglist">
{{ $url := .Get "url" }}
{{ $j := getJson $url }}
{{ $j := getJSON $url }}

{{ range $j.feed.entry }}
{{ $v := . }}
Expand Down
78 changes: 40 additions & 38 deletions layouts/shortcodes/demoMySql.html
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
<table border="1">
{{ $.Scratch.Set "totalSum" 0 }}
{{ range $i, $r := getSql "./static/demo_query.sql" }}
<pre>
&lt;table border=&quot;1&quot;&gt;
{.{ $.Scratch.Set &quot;totalSum&quot; 0 }}
{.{ range $i, $r := getSql &quot;./static/demo_query.sql&quot; }}

{{ if eq $i 0 }}
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Sku</th>
<th>Price</th>
<th>Updated</th>
</tr>
</thead>
<tbody>
{{end}}
<tr>
<td>{{ $r.Int "entity_id" | printf "%09d" }}</td>
<td>{{ $r.Column "name" }}</td>
<td>{{ $r.Column "sku" }}</td>
<td>{{ $r.Float "price" | printf "%.2f" }}</td>
{{ $p := $r.Float "price" }}
{{ $.Scratch.Add "totalSum" $p }}
<td>{{ $r.DateTime "updated_at" "2006-01-02 15:04:05.999999" | dateFormat "02/Jan/2006" }}
<br> {{ $r.Column "updated_at" }}
</td>
</tr>
{{ end }}
</tbody>
<tfoot>
<tr>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>Total:</th>
<th>{{ $.Scratch.Get "totalSum" }}</th>
<th>&nbsp;</th>
</tr>
</tfoot>
{.{ if eq $i 0 }}
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Sku&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;th&gt;Updated&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
{.{end}}
&lt;tr&gt;
&lt;td&gt;{.{ $r.Int &quot;entity_id&quot; | printf &quot;%09d&quot; }}&lt;/td&gt;
&lt;td&gt;{.{ $r.Column &quot;name&quot; }}&lt;/td&gt;
&lt;td&gt;{.{ $r.Column &quot;sku&quot; }}&lt;/td&gt;
&lt;td&gt;{.{ $r.Float &quot;price&quot; | printf &quot;%.2f&quot; }}&euro;&lt;/td&gt;
{.{ $p := $r.Float &quot;price&quot; }}
{.{ $.Scratch.Add &quot;totalSum&quot; $p }}
&lt;td&gt;{.{ $r.DateTime &quot;updated_at&quot; &quot;2006-01-02 15:04:05.999999&quot; | dateFormat &quot;02/Jan/2006&quot; }}
&lt;br&gt; {.{ $r.Column &quot;updated_at&quot; }}
&lt;/td&gt;
&lt;/tr&gt;
{.{ end }}
&lt;/tbody&gt;
&lt;tfoot&gt;
&lt;tr&gt;
&lt;th&gt;&amp;nbsp;&lt;/th&gt;
&lt;th&gt;&amp;nbsp;&lt;/th&gt;
&lt;th&gt;Total:&lt;/th&gt;
&lt;th&gt;{.{ $.Scratch.Get &quot;totalSum&quot; }}&euro;&lt;/th&gt;
&lt;th&gt;&amp;nbsp;&lt;/th&gt;
&lt;/tr&gt;
&lt;/tfoot&gt;

</table>
&lt;/table&gt;
</pre>
2 changes: 1 addition & 1 deletion layouts/shortcodes/ghStarred.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ul class="ghStarred">
{{ $url := .Get "url" }}
{{ range getJson $url }}
{{ range getJSON $url }}
{{ $p := . }}
<li>
<a href="{{$p.owner.html_url}}" target="_blank">
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/mage2_code.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<tbody>
{{ $url := .Get "url" }}
{{ $sep := .Get "sep" }}
{{ range $i, $r := getCsv $sep $url }}
{{ range $i, $r := getCSV $sep $url }}
<tr>
<td>
<a href="https://github.com/magento/magento2/tree/0.42.0-beta10/{{ index $r 0 }}#L{{ index $r 1 }}" target="_blank">
Expand Down
2 changes: 1 addition & 1 deletion layouts/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{ range .Data.Pages }}
<url>
<loc>{{ .Permalink }}</loc>
<lastmod>{{ safeHtml ( .Date.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ with .Sitemap.ChangeFreq }}
<lastmod>{{ safeHTML ( .Date.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}
</url>
Expand Down

0 comments on commit acc1f61

Please sign in to comment.