diff options
author | Josh Johnson <jnjosh@jnjosh.com> | 2016-02-20 07:35:42 +0300 |
---|---|---|
committer | Josh Johnson <jnjosh@jnjosh.com> | 2016-02-20 07:35:42 +0300 |
commit | f92932b947ceddd2e198b3cbcf9bcda2f930c739 (patch) | |
tree | f512c39589265ee391dd277d3bfe98cacb7e8b79 /layouts |
initial commit
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/404.html | 11 | ||||
-rw-r--r-- | layouts/_default/list.html | 9 | ||||
-rw-r--r-- | layouts/_default/single.html | 13 | ||||
-rw-r--r-- | layouts/index.html | 9 | ||||
-rw-r--r-- | layouts/microposts/single.html | 9 | ||||
-rw-r--r-- | layouts/partials/bio.html | 2 | ||||
-rw-r--r-- | layouts/partials/custom_image_handler.html | 11 | ||||
-rw-r--r-- | layouts/partials/custom_javascript.html | 1 | ||||
-rw-r--r-- | layouts/partials/custom_stylesheets.html | 1 | ||||
-rw-r--r-- | layouts/partials/not_found.html | 3 | ||||
-rw-r--r-- | layouts/partials/page_footer.html | 22 | ||||
-rw-r--r-- | layouts/partials/page_header.html | 19 | ||||
-rw-r--r-- | layouts/partials/pagination.html | 13 | ||||
-rw-r--r-- | layouts/partials/preview_list.html | 19 | ||||
-rw-r--r-- | layouts/partials/preview_micropost.html | 4 | ||||
-rw-r--r-- | layouts/partials/preview_photo_post.html | 12 | ||||
-rw-r--r-- | layouts/partials/preview_post.html | 32 | ||||
-rw-r--r-- | layouts/partials/site_footer.html | 8 | ||||
-rw-r--r-- | layouts/partials/site_header.html | 22 | ||||
-rw-r--r-- | layouts/photos/single.html | 21 | ||||
-rw-r--r-- | layouts/posts/single.html | 30 | ||||
-rw-r--r-- | layouts/rss.xml | 24 | ||||
-rw-r--r-- | layouts/section/posts.html | 31 |
23 files changed, 326 insertions, 0 deletions
diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..860de96 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,11 @@ +{{ partial "site_header.html" . }} +{{ partial "page_header.html" . }} + +<main class="content"> + <article class="post"> + {{ partial "not_found.html" . }} + </article> +</main> + +{{ partial "page_footer.html" . }} +{{ partial "site_footer.html" . }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..20ca950 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,9 @@ +{{ partial "site_header.html" . }} +{{ partial "page_header.html" . }} + + <main class="content"> + {{ partial "preview_list.html" . }} + </main> + +{{ partial "page_footer.html" . }} +{{ partial "site_footer.html" . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..8ec93f0 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,13 @@ +{{ partial "site_header.html" . }} +{{ partial "page_header.html" . }} + + <main class="content"> + <article class="page"> + <p> + {{ .Content }} + </p> + </article> + </main> + +{{ partial "page_footer.html" . }} +{{ partial "site_footer.html" . }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..20ca950 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,9 @@ +{{ partial "site_header.html" . }} +{{ partial "page_header.html" . }} + + <main class="content"> + {{ partial "preview_list.html" . }} + </main> + +{{ partial "page_footer.html" . }} +{{ partial "site_footer.html" . }} diff --git a/layouts/microposts/single.html b/layouts/microposts/single.html new file mode 100644 index 0000000..a2be260 --- /dev/null +++ b/layouts/microposts/single.html @@ -0,0 +1,9 @@ +{{ partial "site_header.html" . }} +{{ partial "page_header.html" . }} + + <main class="content"> + {{ partial "preview_micropost.html" . }} + </main> + +{{ partial "page_footer.html" . }} +{{ partial "site_footer.html" . }} diff --git a/layouts/partials/bio.html b/layouts/partials/bio.html new file mode 100644 index 0000000..775884c --- /dev/null +++ b/layouts/partials/bio.html @@ -0,0 +1,2 @@ +Here you can place a short bio about yourself. Place a `bio.html` file in your +project directory under `layout/partials`. That will override this message. diff --git a/layouts/partials/custom_image_handler.html b/layouts/partials/custom_image_handler.html new file mode 100644 index 0000000..1271545 --- /dev/null +++ b/layouts/partials/custom_image_handler.html @@ -0,0 +1,11 @@ +<script type="text/javascript"> + + // @summary: jquery implementation + $(function() { + // @summary: Use the author's flickr ID to load images from the public flickr feed + $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id={{ .Site.Author.FlickrID }}&format=json&jsoncallback=?", function(data) { + iweblog.application.displayImages(data, 8); + }); + }); + +</script> diff --git a/layouts/partials/custom_javascript.html b/layouts/partials/custom_javascript.html new file mode 100644 index 0000000..bc70a8e --- /dev/null +++ b/layouts/partials/custom_javascript.html @@ -0,0 +1 @@ +<!-- Create your own layouts/partials/custom_javascript.html to add javascript --> diff --git a/layouts/partials/custom_stylesheets.html b/layouts/partials/custom_stylesheets.html new file mode 100644 index 0000000..20f09a7 --- /dev/null +++ b/layouts/partials/custom_stylesheets.html @@ -0,0 +1 @@ +<!-- Create your own layouts/partials/custom_stylesheets.html to add custom styles --> diff --git a/layouts/partials/not_found.html b/layouts/partials/not_found.html new file mode 100644 index 0000000..5b77c39 --- /dev/null +++ b/layouts/partials/not_found.html @@ -0,0 +1,3 @@ +404. Not Found. Try again. + +If you don't like this, create a partial called `not_found.html`. diff --git a/layouts/partials/page_footer.html b/layouts/partials/page_footer.html new file mode 100644 index 0000000..dc661cf --- /dev/null +++ b/layouts/partials/page_footer.html @@ -0,0 +1,22 @@ +<footer> + <div class="footer_text"> + <div> + <h3>Hi, <a href="{{ .Site.Author.AboutPage }}">I'm {{ .Site.Author.FirstName }}</a></h3> + <p> + {{ partial "bio.html" . }} + </p> + </div> + <div> + <h3><a href="https://www.flickr.com/photos/{{ .Site.Author.FlickrID }}/">Photo Stream</a></h3> + <div id="photos"></div> + </div> + </div> + </div> + + {{ if .Site.Params.ShowCopyright }} + <div class="footer_copyright"> + © {{ .Now.Format "2006" }} <a href="{{ .Site.Author.AboutPage }}">{{ .Site.Author.FirstName }} {{ .Site.Author.LastName }}</a> + {{ with .Site.Author.Location }} - Made in {{ . }}{{ end }} + </div> + {{ end }} +</footer> diff --git a/layouts/partials/page_header.html b/layouts/partials/page_header.html new file mode 100644 index 0000000..d566947 --- /dev/null +++ b/layouts/partials/page_header.html @@ -0,0 +1,19 @@ +<header> + <nav> + <h1><a href="/">@{{ .Site.Author.Handle }}</a>’s {{ .Site.Title }}.</h1> + <div class="menu"> + {{ $.Scratch.Add "sections" .Site.Params.RSSSections }} + <ul> + {{ range .Site.Menus.main }} + <li> + <a href="{{ .URL }}">{{ .Name }}</a> + {{ if in ($.Scratch.Get "sections") .Name }} + <a href="{{ .URL }}index.xml"><img src="/img/rss.svg" class="rss-icon" /></a> + {{ end }} + </li> + {{ end }} + {{ with .Site.Author.AboutPage }}<li><a href="{{ . }}">About</a></li>{{ end }} + </ul> + </div> + </nav> +</header> diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html new file mode 100644 index 0000000..86ca7ba --- /dev/null +++ b/layouts/partials/pagination.html @@ -0,0 +1,13 @@ +<div class="pagination"> + {{ if .Paginator.HasPrev }} + <a href="{{ .Paginator.Prev.URL }}">« Newer</a> + {{ end }} + + {{ if and .Paginator.HasNext .Paginator.HasPrev }} + <span>|</span> + {{ end }} + + {{ if .Paginator.HasNext }} + <a href="{{ .Paginator.Next.URL }}">Older »</a> + {{ end }} +</div> diff --git a/layouts/partials/preview_list.html b/layouts/partials/preview_list.html new file mode 100644 index 0000000..16521f4 --- /dev/null +++ b/layouts/partials/preview_list.html @@ -0,0 +1,19 @@ +{{ $paginator := .Paginate (where .Data.Pages "Type" "!=" "page") }} +{{ range .Paginator.Pages }} + {{ $url := replace .Permalink .Site.BaseURL "" }} + + {{ if or (eq .Type "microposts") (eq .Type "micropost") }} + {{ partial "preview_micropost.html" . }} + {{ end }} + + {{ if or (eq .Type "photos") (eq .Type "photo") }} + {{ partial "preview_photo_post.html" . }} + {{ end }} + + {{ if or (eq .Type "posts") (eq .Type "post") }} + {{ partial "preview_post.html" . }} + {{ end }} + +{{ end }} + +{{ partial "pagination.html" . }} diff --git a/layouts/partials/preview_micropost.html b/layouts/partials/preview_micropost.html new file mode 100644 index 0000000..e622cc1 --- /dev/null +++ b/layouts/partials/preview_micropost.html @@ -0,0 +1,4 @@ +<article class="micropost"> + {{ .Content }} + <a href='{{ .Permalink }}'><aside class="dates">→ {{ .Date.Format "2006/01/02 3:04 PM" }}</aside></a> +</article> diff --git a/layouts/partials/preview_photo_post.html b/layouts/partials/preview_photo_post.html new file mode 100644 index 0000000..91f6b39 --- /dev/null +++ b/layouts/partials/preview_photo_post.html @@ -0,0 +1,12 @@ +<article class="photo"> + + <div class="preview"> + <div class="title"> + <span><a href="{{ .Permalink }}">{{ .Title }}</a></span> + </div> + <div class="content"> + <a href="{{ .Permalink }}">{{ .Summary }}</a> + </div> + </div> + +</article> diff --git a/layouts/partials/preview_post.html b/layouts/partials/preview_post.html new file mode 100644 index 0000000..35401e3 --- /dev/null +++ b/layouts/partials/preview_post.html @@ -0,0 +1,32 @@ +<article class="post"> + {{ if (not (isset .Params "externalurl")) }} + <h2><a rel="full-article" href="{{ .Permalink }}">{{ .Title }}</a></h2> + {{ else }} + <h2><a rel="remote-article" href="{{ .Params.externalurl }}">→ {{ .Title }}</a> <a href="{{ .Permalink }}">∞</a></h2> + {{ end }} + + <div class="postmeta">Posted on <time datetime="{{ .Date }}" pubdate="">{{ .Date.Format "January 2, 2006" }}</time> + {{ if (isset .Params "categories") }} + in + <span class="categories"> + {{ range $i, $v := .Params.categories }} + <a class="category" href="/categories/{{ $v | urlize }}">{{ $v }}</a>{{ if ne (len $.Params.categories) (add $i 1) }}, {{ end }} + {{ end }} + </span> + {{ end }} + </div> + + <p> + {{ if (not (isset .Params "externalurl")) }} + {{ .Summary }} + {{ else }} + {{ .Content }} + {{ end }} + </p> + + {{ if .Truncated }} + {{ if (not (isset .Params "externalurl")) }} + <a class="continue" rel="full-article" href="{{ .Permalink }}">Continue Reading »</a> + {{ end }} + {{ end }} +</article> diff --git a/layouts/partials/site_footer.html b/layouts/partials/site_footer.html new file mode 100644 index 0000000..c489c88 --- /dev/null +++ b/layouts/partials/site_footer.html @@ -0,0 +1,8 @@ + <script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/2.2.0/jquery.min.js"></script> + <script src="/js/lightgallery-all.min.js"></script> + <script src="/js/weblog.js" charset="utf-8"></script> + {{ partial "custom_javascript.html" . }} + {{ partial "custom_image_handler.html" . }} + {{ template "_internal/google_analytics.html" . }} + </body> +</html> diff --git a/layouts/partials/site_header.html b/layouts/partials/site_header.html new file mode 100644 index 0000000..c77a41d --- /dev/null +++ b/layouts/partials/site_header.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ 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.0"> + <meta name="author" content="{{ with .Site.Author.FirstName }}{{ . }}{{ end }}"> + <meta name="description" content="{{ with .Site.Params.Description }}{{ . }}{{ end }}"> + {{ .Hugo.Generator }} + + {{ $.Scratch.Add "title" .Site.Title }} + <title>{{ with .Title }}{{ if ne . ($.Scratch.Get "title") }}{{ . }} · {{ end }}{{ end }}{{ .Site.Title }}</title> + + <link rel="stylesheet" href="{{ .Site.BaseURL }}css/weblog.css" media="screen" charset="utf-8" /> + <link rel="stylesheet" href="{{ .Site.BaseURL }}css/lightgallery.min.css" type="text/css" /> + {{ partial "custom_stylesheets.html" . }} + + {{ if .Site.Params.RSSEnabled }} + <link href="{{ .Site.RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" /> + {{ end }} + </head> + <body class="site"> diff --git a/layouts/photos/single.html b/layouts/photos/single.html new file mode 100644 index 0000000..b4905f9 --- /dev/null +++ b/layouts/photos/single.html @@ -0,0 +1,21 @@ +{{ partial "site_header.html" . }} +{{ partial "page_header.html" . }} + + <main class="content"> + <article class="post"> + <h2><a rel="full-article" href="{{ .Permalink }}">{{ .Title }}</a></h2> + + <div class="postmeta"> + {{ with .Params.location }}Photos taken in {{ . }} on {{ end }} + <time datetime="{{ .Date }}" pubdate="">{{ .Date.Format "January 2, 2006" }}</time> + {{ with .Params.camera }} with {{ . }}{{ end }} + </div> + + <p> + {{ .Content }} + </p> + </article> + </main> + +{{ partial "page_footer.html" . }} +{{ partial "site_footer.html" . }} diff --git a/layouts/posts/single.html b/layouts/posts/single.html new file mode 100644 index 0000000..5ea94c6 --- /dev/null +++ b/layouts/posts/single.html @@ -0,0 +1,30 @@ +{{ partial "site_header.html" . }} +{{ partial "page_header.html" . }} + + <main class="content"> + + <article class="post"> + {{ if (not (isset .Params "externalurl")) }} + <h2><a rel="full-article" href="{{ .Permalink }}">{{ .Title }}</a></h2> + {{ else }} + <h2><a rel="remote-article" href="{{ .Params.externalurl }}">→ {{ .Title }}</a> <a href="{{ .Permalink }}">∞</a></h2> + {{ end }} + + <div class="postmeta">Posted on <time datetime="{{ .Date }}" pubdate="">{{ .Date.Format "January 2, 2006" }}</time> in + <span class="categories"> + {{ range $i, $v := .Params.categories }} + <a class="category" href="/categories/{{ $v | urlize }}">{{ $v }}</a>{{ if ne (len $.Params.categories) (add $i 1) }}, {{ end }} + {{ end }} + </span> + </div> + + <p> + {{ .Content }} + </p> + </article> + + + </main> + +{{ partial "page_footer.html" . }} +{{ partial "site_footer.html" . }} diff --git a/layouts/rss.xml b/layouts/rss.xml new file mode 100644 index 0000000..4696dc6 --- /dev/null +++ b/layouts/rss.xml @@ -0,0 +1,24 @@ +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>{{ .Site.Title }}{{ with .Title }} - {{ .}}{{ end }}</title> + <link>{{ .Permalink }}</link> + <description>All entries {{ with .Title }}in {{.}} {{ end }}on {{ .Site.Title }}</description> + <generator>Hugo -- gohugo.io</generator> + {{ with .Site.LanguageCode }}<language>{{.}}</language>{{end}} + {{ with .Site.Copyright }}<copyright>{{.}}</copyright>{{end}} + {{ if not .Date.IsZero }}<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} + <atom:link href="{{.URL}}" rel="self" type="application/rss+xml" /> + {{ range .Data.Pages }} + {{ if ne .Type "page" }} + <item> + <title>{{ .Title }}</title> + <link>{{ .Permalink }}</link> + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} + <guid>{{ .Permalink }}</guid> + <description>{{ .Content | html }}</description> + </item> + {{ end }} + {{ end }} + </channel> +</rss> diff --git a/layouts/section/posts.html b/layouts/section/posts.html new file mode 100644 index 0000000..aca6cfa --- /dev/null +++ b/layouts/section/posts.html @@ -0,0 +1,31 @@ +{{ partial "site_header.html" . }} +{{ partial "page_header.html" . }} + + <main class="content"> + <article class="post-groups"> + <div class="post-group"> + {{ range .Data.Pages.GroupByDate "2006" }} + <div class="post-group-item"> + <h3>{{ .Key }}</h3> + <ul> + {{ range .Pages }} + <li> + {{ if (not (isset .Params "externalurl")) }} + <a rel="full-article" href="{{ .Permalink }}">{{ .Title }}</a> + on <time datetime="{{ .Date }}" pubdate="">{{ .Date.Format "January 2" }}</time> + {{ else }} + <a rel="remote-article" href="{{ .Params.externalurl }}">{{ .Title }} →</a> + on + <a href="{{ .Permalink }}"><time datetime="{{ .Date }}" pubdate="">{{ .Date.Format "January 2" }}</time></a> + {{ end }} + </li> + {{ end }} + </ul> + </div> + {{ end }} + </div> + </article> + </main> + +{{ partial "page_footer.html" . }} +{{ partial "site_footer.html" . }} |