diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-02-09 15:33:24 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-02-09 15:33:24 +0100 |
commit | 7e5ac240a1065f7ed0c426903537e12364e0f52f (patch) | |
tree | a13dd7b8dd14e2c38958138a6d21713006d9dfd2 /themes/new_theme/layouts | |
parent | 5ff7d4c3584b1df14e4caf8c01f0e7934042c5bb (diff) | |
download | www-andreasbaumann-cc-7e5ac240a1065f7ed0c426903537e12364e0f52f.tar.gz www-andreasbaumann-cc-7e5ac240a1065f7ed0c426903537e12364e0f52f.tar.bz2 |
updated to a Wordpress Magazine layout
Diffstat (limited to 'themes/new_theme/layouts')
20 files changed, 349 insertions, 0 deletions
diff --git a/themes/new_theme/layouts/404.html b/themes/new_theme/layouts/404.html new file mode 100644 index 0000000..59a1ebf --- /dev/null +++ b/themes/new_theme/layouts/404.html @@ -0,0 +1,15 @@ +{{ partial "header.html" . }} + +<div class="main-content content" role="main" itemprop="mainContentOfPage"> + <article class="post"> + <header class="post__header clearfix"> + <h1 class="post__title">{{ .Title }}</h1> + </header> + <div class="post__content clearfix"> + Page not found.. + </div> + </article> +</div> + +{{ partial "sidebar.html" . }} +{{ partial "footer.html" . }} diff --git a/themes/new_theme/layouts/_default/list.html b/themes/new_theme/layouts/_default/list.html new file mode 100644 index 0000000..68776c6 --- /dev/null +++ b/themes/new_theme/layouts/_default/list.html @@ -0,0 +1,58 @@ +{{ partial "header.html" . }} + +{{ $section := .Section }} + +{{ if ne $section "blog" }} +<div class="main-content content" role="main" itemprop="mainContentOfPage"> + <article class="post"> + <header class="post__header clearfix"> + <h1 class="post__title">{{ .Title }}</h1> + </header> + <div class="post__content clearfix"> + {{ .Content }} + </div> + </article> +</div> +{{ else }} + <div class="main-content loop content" role="main"> + {{- if not .IsHome }} + <header class="page-header"> + <h1 class="page-header__title">{{ .Title }}</h1> + </header> + {{- end }} + {{- range .Pages }} + <article class="loop__item post clearfix"> + {{- if .Params.thumbnail }} + <figure class="loop__thumbnail"> + <a href="{{ .Permalink }}"> + <img src="{{ .Params.thumbnail | absURL }}" alt="{{ .Title }}" /> + </a> + </figure> + {{- end }} + <div class="loop__content clearfix"> + <header class="loop__header"> + <h3 class="loop__title post__title "> + <a href="{{ .Permalink }}" rel="bookmark">{{ .Title }}</a> + </h3> + <div class="loop__meta meta"> + <svg class="icon icon-time" height="14" viewBox="0 0 16 16" width="14" xmlns="http://www.w3.org/2000/svg"><path d="m8-.0000003c-4.4 0-8 3.6-8 8 0 4.4000003 3.6 8.0000003 8 8.0000003 4.4 0 8-3.6 8-8.0000003 0-4.4-3.6-8-8-8zm0 14.4000003c-3.52 0-6.4-2.88-6.4-6.4000003 0-3.52 2.88-6.4 6.4-6.4 3.52 0 6.4 2.88 6.4 6.4 0 3.5200003-2.88 6.4000003-6.4 6.4000003zm.4-10.4000003h-1.2v4.8l4.16 2.5600003.64-1.04-3.6-2.1600003z"/></svg> + <time class="loop__meta-date" datetime="{{ .Date }}">{{.Date.Format "January 02, 2006"}}</time> + </div> + </header> + <div class="loop__excerpt"> + {{ .Summary }} + </div> + <div class="post__content"> + <a href="{{ .URL }}">View full post</a> + </div> + </div> + </article> + {{- end }} + + {{ partial "pagination.html" . }} + </div> + +{{ end }} + +{{ partial "sidebar.html" . }} +{{ partial "footer.html" . }} diff --git a/themes/new_theme/layouts/_default/single.html b/themes/new_theme/layouts/_default/single.html new file mode 100644 index 0000000..a3e40bb --- /dev/null +++ b/themes/new_theme/layouts/_default/single.html @@ -0,0 +1,15 @@ +{{ partial "header.html" . }} + +<div class="main-content content" role="main" itemprop="mainContentOfPage"> + <article class="post"> + <header class="post__header clearfix"> + <h1 class="post__title">{{ .Title }}</h1> + </header> + <div class="post__content clearfix"> + {{ .Content }} + </div> + </article> +</div> + +{{ partial "sidebar.html" . }} +{{ partial "footer.html" . }} diff --git a/themes/new_theme/layouts/partials/authorbox.html b/themes/new_theme/layouts/partials/authorbox.html new file mode 100644 index 0000000..cfd09c5 --- /dev/null +++ b/themes/new_theme/layouts/partials/authorbox.html @@ -0,0 +1,13 @@ +{{- if .Site.Params.authorbox }} +<div class="authorbox clearfix"> + <figure class="authorbox__avatar"> + <img alt="{{ .Site.Author.name }} avatar" src="{{ .Site.Author.avatar | absURL }}" class="avatar" height="90" width="90"> + </figure> + <div class="authorbox__header"> + <span class="authorbox__name">About {{ .Site.Author.name }}</span> + </div> + <div class="authorbox__description"> + {{ .Site.Author.bio }} + </div> +</div> +{{- end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/comments.html b/themes/new_theme/layouts/partials/comments.html new file mode 100644 index 0000000..42dc0c5 --- /dev/null +++ b/themes/new_theme/layouts/partials/comments.html @@ -0,0 +1,5 @@ +{{ if and (not (eq .Site.DisqusShortname "")) (not .Params.disable_comments) }} +<div class="comments"> + {{ template "_internal/disqus.html" . }} +</div> +{{ end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/footer.html b/themes/new_theme/layouts/partials/footer.html new file mode 100644 index 0000000..3513e6c --- /dev/null +++ b/themes/new_theme/layouts/partials/footer.html @@ -0,0 +1,15 @@ + </div> + <footer class="footer" itemscope="itemscope" itemtype="http://schema.org/WPFooter"> + <div class="container container-inner"> + <p class="footer__copyright">© {{ .Site.Params.copyright_years }}, {{ .Site.Params.Location }}, {{ .Site.Params.author }}. Based on <a href="//wordpress.org/themes/mh-magazine-lite/" target="_blank" rel="nofollow noopener noreferrer">MH Magazine lite</a>.</p> + </div> + </footer> + </div><!-- .mh-container-outer --> + +<script> + var navigation = responsiveNav(".menu", { + navClass: "menu--collapse", + }); +</script> +</body> +</html> diff --git a/themes/new_theme/layouts/partials/footer_slide.html b/themes/new_theme/layouts/partials/footer_slide.html new file mode 100644 index 0000000..0c8b4c7 --- /dev/null +++ b/themes/new_theme/layouts/partials/footer_slide.html @@ -0,0 +1,30 @@ + <script src="/slide/lib/js/head.min.js"></script> + <script src="/slide/js/reveal.js"></script> + + <script> + + // Full list of configuration options available at: + // https://github.com/hakimel/reveal.js#configuration + Reveal.initialize({ + controls: true, + progress: true, + history: true, + center: true, + + transition: 'slide', // none/fade/slide/convex/concave/zoom + + // Optional reveal.js plugins + dependencies: [ + { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, + { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, + { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, + { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, + { src: 'plugin/zoom-js/zoom.js', async: true }, + { src: 'plugin/notes/notes.js', async: true } + ] + }); + + </script> + + </body> +</html> diff --git a/themes/new_theme/layouts/partials/header.html b/themes/new_theme/layouts/partials/header.html new file mode 100644 index 0000000..2d6cf31 --- /dev/null +++ b/themes/new_theme/layouts/partials/header.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html lang="{{ .Site.LanguageCode | default "en-us" }}"> +<head> +<meta charset="UTF-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> +<title>{{ .Title }}</title> +{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }} +{{ .Hugo.Generator }} +{{ if .Site.Params.opengraph }}{{ template "_internal/opengraph.html" . }}{{ end }} +<link rel="dns-prefetch" href="//fonts.googleapis.com" /> +{{ if .RSSLink }}<link rel="alternate" type="application/rss+xml" title="{{ .Site.Title }} Feed" href="{{ .RSSLink }}">{{ end }} +<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700" type="text/css" media="all" /> +<link rel="stylesheet" href="{{ .Site.BaseURL }}css/style.css" type="text/css" media="all" /> +<link rel="stylesheet" href="{{ .Site.BaseURL }}css/localstyle.css" type="text/css" media="all" /> +<script type="text/javascript" src="{{ .Site.BaseURL }}js/scripts.js"></script> +</head> +<body class="body {{ if (.Site.Params.leftsidebar) or (.Params.leftsidebar) }}body-left-sidebar{{ else }}body-right-sidebar{{ end }} mobile" itemscope="itemscope" itemtype="http://schema.org/WebPage"> + <div class="container container-outer"> + <header class="header" itemscope="itemscope" itemtype="http://schema.org/WPHeader"> + <div class="container container-inner clearfix"> + <div class="logo" role="banner" itemscope="itemscope" itemtype="http://schema.org/Brand"> + <a class="logo__link" href="{{ .Site.BaseURL }}" title="{{ .Site.Title }}" rel="home"> + <h1 class="logo__title">{{ .Site.Params.toptitle }}</h1> + {{ with .Site.Params.subtitle }}<h2 class="logo__tagline">{{ . }}</h2>{{ end }} + </a> + </div> + </div> + {{ partial "menu.html" . }} + </header> + <div class="wrapper clearfix"> diff --git a/themes/new_theme/layouts/partials/header_slide.html b/themes/new_theme/layouts/partials/header_slide.html new file mode 100644 index 0000000..237da66 --- /dev/null +++ b/themes/new_theme/layouts/partials/header_slide.html @@ -0,0 +1,39 @@ +<!doctype html> +<html lang="en"> + + <head> + <meta charset="utf-8"> + + <title>{{ .Site.Title }}</title> + + <meta name="description" content="Build systems in open source Software focused on C++ development"> + <meta name="author" content="{{ .Site.Params.author }}"> + + <meta name="apple-mobile-web-app-capable" content="yes"> + <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui"> + + <link rel="stylesheet" href="/slide/css/reveal.css"> + <link rel="stylesheet" href="/slide/css/theme/black.css" id="theme"> + + <!-- Code syntax highlighting --> + <link rel="stylesheet" href="/slide/lib/css/zenburn.css"> + + <!-- Printing and PDF exports --> + <script> + var link = document.createElement( 'link' ); + link.rel = 'stylesheet'; + link.type = 'text/css'; + link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css'; + document.getElementsByTagName( 'head' )[0].appendChild( link ); + </script> + + {{ "<!--[if lt IE 9]>" | safeHTML }} + <script src="/slide/lib/js/html5shiv.js"></script> + {{ "<![endif]-->" | safeHTML }} + + {{ .Hugo.Generator }} + </head> + + <body> diff --git a/themes/new_theme/layouts/partials/menu.html b/themes/new_theme/layouts/partials/menu.html new file mode 100644 index 0000000..e322ac4 --- /dev/null +++ b/themes/new_theme/layouts/partials/menu.html @@ -0,0 +1,23 @@ +<nav class="menu" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"> + <ul class="menu__list"> + <li class="menu__item "><a class="menu__link" href="/">HOME</a></li> + <li class="menu__item "><a class="menu__link" href="/software">Software</a></li> + <li class="menu__item "><a class="menu__link" href="/toolbox">Toolbox</a></li> + <li class="menu__item "><a class="menu__link" href="/git">Git</a></li> + <li class="menu__item "><a class="menu__link" href="/slide">Slides</a></li> + <li class="menu__item "><a class="menu__link" href="/blog">Blog</a></li> + <li class="menu__item "><a class="menu__link" href="/contact">Contact</a></li> + </ul> +</nav> + +<!-- +<nav class="menu" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"> + <ul class="menu__list"> + {{- if .Site.Menus.main }} + {{- $currentNode := . }} + {{- range sort .Site.Menus.main }} + <li class="menu__item {{if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .) }}menu__item--active{{end}}"><a class="menu__link" href="{{ .URL }}">{{ .Name | upper }}</a></li> + {{- end }} + {{- end }} + </ul> +</nav>--> diff --git a/themes/new_theme/layouts/partials/pagination.html b/themes/new_theme/layouts/partials/pagination.html new file mode 100644 index 0000000..82ad195 --- /dev/null +++ b/themes/new_theme/layouts/partials/pagination.html @@ -0,0 +1,11 @@ +{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }} +<div class="pagination clearfix"> + {{- if .Paginator.HasPrev }} + <a class="pagination__item pagination__item--prev" href="{{ .Paginator.Prev.URL }}">«</a> + {{- end }} + <span class="pagination__item pagination__item--current">{{ .Paginator.PageNumber }}/{{ .Paginator.TotalPages }}</span> + {{- if .Paginator.HasNext }} + <a class="pagination__item pagination__item--next" href="{{ .Paginator.Next.URL }}">»</a> + {{- end }} +</div> +{{ end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/post_nav.html b/themes/new_theme/layouts/partials/post_nav.html new file mode 100644 index 0000000..891bce6 --- /dev/null +++ b/themes/new_theme/layouts/partials/post_nav.html @@ -0,0 +1,16 @@ +{{- if .Site.Params.post_navigation }} +{{- if or (.Prev) (.Next) }} +<nav class="post-nav row clearfix" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"> + {{- if .Prev }} + <div class="post-nav__item post-nav__item--prev col-1-2"> + <a class="post-nav__link" href="{{.Prev.Permalink}}" rel="prev"><span class="post-nav__caption">«Previous</span><p class="post-nav__post-title">{{.Prev.Title}}</p></a> + </div> + {{- end }} + {{- if .Next }} + <div class="post-nav__item post-nav__item--next col-1-2"> + <a class="post-nav__link" href="{{.Next.Permalink}}" rel="next"><span class="post-nav__caption">Next»</span><p class="post-nav__post-title">{{.Next.Title}}</p></a> + </div> + {{- end }} +</nav> +{{- end }} +{{- end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/post_tags.html b/themes/new_theme/layouts/partials/post_tags.html new file mode 100644 index 0000000..549c76b --- /dev/null +++ b/themes/new_theme/layouts/partials/post_tags.html @@ -0,0 +1,10 @@ +{{- if .Params.tags }} +<div class="post__tags tags clearfix"> + <svg class="icon icon-tag" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m4.73135 3.3795002q0-.5597-.39604-.9557-.39604-.3961-.95577-.3961-.55974 0-.95578.3961-.39604.396-.39604.9557 0 .5598.39604.9558.39604.3961.95578.3961.55973 0 .95577-.3961.39604-.396.39604-.9558zm11.26865 6.0832q0 .5596998-.39076.9504998l-5.18548 5.196q-.41188.3908-.9610504.3908-.55974 0-.9505-.3908l-7.5511496-7.5616998q-.40132-.3907-.68119-1.0666-.27987-.6759-.27987-1.2357v-4.3934q0-.54920004.40132-.95050004.40132-.4013.9505-.4013h4.39339q.55974 0 1.23565.2799.67591.2798 1.07723.6812l7.55115 7.54060004q.39076.4118.39076.961z"/></svg> + <ul class="tags__list"> + {{- range .Params.tags }} + <li class="tags__item"><a class="tags__link" href="/tags/{{ . | urlize }}/" rel="tag">{{ . }}</a></li> + {{- end }} + </ul> +</div> +{{- end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/sidebar.html b/themes/new_theme/layouts/partials/sidebar.html new file mode 100644 index 0000000..7e6bad7 --- /dev/null +++ b/themes/new_theme/layouts/partials/sidebar.html @@ -0,0 +1,6 @@ +<aside class="sidebar" itemscope="itemscope" itemtype="http://schema.org/WPSideBar"> + {{ partial "widgets/search.html" . }} + {{ partial "widgets/recent.html" . }} + {{ partial "widgets/categories.html" . }} + {{ partial "widgets/taglist.html" . }} +</aside>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/widgets/categories.html b/themes/new_theme/layouts/partials/widgets/categories.html new file mode 100644 index 0000000..d4ace88 --- /dev/null +++ b/themes/new_theme/layouts/partials/widgets/categories.html @@ -0,0 +1,16 @@ +{{- if .Site.Params.widgets.categories }} +{{- if isset .Site.Taxonomies "categories" }} +{{- if not (eq (len .Site.Taxonomies.categories) 0) }} +<div class="widget-categories widget"> + <h4 class="widget__title">Categories</h4> + <div class="widget__content"> + <ul class="widget__list"> + {{- range $name, $items := .Site.Taxonomies.categories }} + <li class="widget__item"><a class="widget__link" href="{{ $.Site.BaseURL }}categories/{{ $name | urlize | lower }}">{{ $name | title }}</a></li> + {{- end }} + </ul> + </div> +</div> +{{- end }} +{{- end }} +{{- end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/widgets/recent.html b/themes/new_theme/layouts/partials/widgets/recent.html new file mode 100644 index 0000000..6aaee19 --- /dev/null +++ b/themes/new_theme/layouts/partials/widgets/recent.html @@ -0,0 +1,12 @@ +{{- if .Site.Params.widgets.recent_articles }} +<div class="widget-recent widget"> + <h4 class="widget__title">Recent Posts</h4> + <div class="widget__content"> + <ul class="widget__list"> + {{- range first 10 (where .Site.Pages "Section" "blog") }} + <li class="widget__item"><a class="widget__link" href="{{ .RelPermalink }}">{{ .Title }}</a></li> + {{- end }} + </ul> + </div> +</div> +{{- end }} diff --git a/themes/new_theme/layouts/partials/widgets/search.html b/themes/new_theme/layouts/partials/widgets/search.html new file mode 100644 index 0000000..9d3676f --- /dev/null +++ b/themes/new_theme/layouts/partials/widgets/search.html @@ -0,0 +1,12 @@ +{{- if .Site.Params.widgets.search }} +<div class="widget-search widget"> + <form class="widget-search__form" role="search" method="get" action="//google.com/search"> + <label> + <span class="screen-reader-text">Search for:</span> + <input class="widget-search__field" type="search" placeholder="SEARCH..." value="" name="q"> + </label> + <input class="widget-search__submit" type="submit" value="Search"> + <input type="hidden" name="sitesearch" value="{{ .Site.BaseURL }}" /> + </form> +</div> +{{- end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/widgets/taglist.html b/themes/new_theme/layouts/partials/widgets/taglist.html new file mode 100644 index 0000000..966205a --- /dev/null +++ b/themes/new_theme/layouts/partials/widgets/taglist.html @@ -0,0 +1,14 @@ +{{- if .Site.Params.widgets.tags }} +{{- if isset .Site.Taxonomies "tags" }} +{{- if not (eq (len .Site.Taxonomies.tags) 0) }} +<div class="widget-taglist widget"> + <h4 class="widget__title">Tags</h4> + <div class="widget__content"> + {{- range $name, $items := .Site.Taxonomies.tags }} + <a class="widget__link widget__link--taglist" href="{{ $.Site.BaseURL }}tags/{{ $name | urlize | lower }}" title="{{ $name }}">{{ $name }}</a> + {{- end }} + </div> +</div> +{{- end }} +{{- end }} +{{- end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/robots.txt b/themes/new_theme/layouts/robots.txt new file mode 100644 index 0000000..bb43e33 --- /dev/null +++ b/themes/new_theme/layouts/robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Disallow: /wiki/ +Disallow: /crux/ diff --git a/themes/new_theme/layouts/slide/single.html b/themes/new_theme/layouts/slide/single.html new file mode 100644 index 0000000..cd03267 --- /dev/null +++ b/themes/new_theme/layouts/slide/single.html @@ -0,0 +1,6 @@ +{{ partial "header_slide.html" . }} + +{{ .Content }} + +{{ partial "footer_slide.html" . }} + |