Update layouts and fix JS

This commit is contained in:
George Cushen 2016-05-08 00:07:40 +01:00
commit 5985996691
22 changed files with 195 additions and 96 deletions

View file

@ -5,15 +5,15 @@
<h1>Page not found</h1> <h1>Page not found</h1>
<p>Maybe you were looking for one of these?</p> <p>Maybe you were looking for one of these?</p>
<h2>Recent News</h2> <h2>Recent Posts</h2>
{{ range last 20 (where .Data.Pages "Section" "=" "blog") }} {{ range last 20 (where .Data.Pages "Section" "=" "post") }}
<ul> <ul>
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li> <li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
</ul> </ul>
{{ end }} {{ end }}
<h2>Recent Publications</h2> <h2>Recent Publications</h2>
{{ range last 20 (where .Data.Pages "Section" "=" "publications") }} {{ range last 20 (where .Data.Pages "Section" "=" "publication") }}
<ul> <ul>
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li> <li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
</ul> </ul>

View file

@ -4,12 +4,15 @@
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{ partial "article_metadata" . }} {{ partial "article_metadata" . }}
<div class="post"> <div class="post">
{{ .Content }} {{ .Content }}
</div> </div>
{{ partial "section_item_pager.html" . }} {{ partial "section_item_pager.html" . }}
{{ partial "comments.html" . }}
{{ partial "footer_container.html" . }} {{ partial "footer_container.html" . }}
</div> </div>

View file

@ -1 +0,0 @@
{{ .Content }}

View file

@ -2,84 +2,121 @@
{{ partial "navbar.html" . }} {{ partial "navbar.html" . }}
<div class="container"> <div class="container">
<!-- Biography Section -->
{{ range $index, $page := where .Site.Pages "Section" "=" "home" }} {{ range $index, $page := where .Site.Pages "Section" "=" "home" }}
{{ if eq .Title "about" }} {{ if eq .Title "about" }}
<section id="bio"> <section id="bio" class="home-section-wrapper full_width home alt" style="padding-top: 0;">
{{ .Render "bio" }} {{ partial "home_biography" . }}
</section> </section>
{{ end }} {{ end }}
{{ end }} {{ end }}
<section id="publications"> <!-- Publications Section -->
<h2>Recent Publications</h2> <section id="publications" class="home-section-wrapper full_width home">
<ul class="fa-ul"> <div class="row">
{{ range first 5 (where .Data.Pages.ByDate "Section" "publications").Reverse }} <div class="col-xs-12 col-md-4">
<li> <h2>Recent Publications</h2>
<i class="fa-li fa fa-file-text-o pub-icon" aria-hidden="true"></i> <p><a href="/publication/">More Publications <i class="fa fa-angle-double-right" style="padding-left: 5px;"></i></a></p>
<span style="padding-right: 8px">{{ .Title | markdownify }}</span> </div>
<a class="btn btn-primary btn-outline btn-xs" href="{{ .Permalink }}">Details</a> <div class="col-xs-12 col-md-8">
{{ with .Params.url_pdf }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">PDF</a>{{ end }} <ul class="fa-ul">
{{ with .Params.url_code }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Code</a>{{ end }} {{ range first 5 (where .Data.Pages.ByDate "Section" "publication").Reverse }}
{{ with .Params.url_dataset }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Dataset</a>{{ end }} <li>
{{ with .Params.url_project }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Project</a>{{ end }} <i class="fa-li fa fa-file-text-o pub-icon" aria-hidden="true"></i>
{{ range .Params.url_custom }}<a class="btn btn-primary btn-outline btn-xs" href="{{ .url }}">{{ .name }}</a>{{ end }} <span style="padding-right: 8px">{{ .Title | markdownify }}</span>
</li> <p>{{ partial "publication_list_buttons" . }}</p>
{{ end }} </li>
</ul> {{ end }}
<p class="text-right"><a href="/publications/">More Publications <i class="fa fa-angle-double-right" style="padding-left: 5px;"></i></a></p> </ul>
</section> </div>
<section id="news">
<h2>News</h2>
{{ range last 5 (where .Data.Pages "Section" "=" "blog") }}
<div class="article-list-item">
<h3 class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
{{ partial "article_metadata" . }}
<p>
{{ if .Truncated }}
{{ .Summary }}
<a href="{{ .RelPermalink }}">Read More <i class="fa fa-angle-double-right" style="padding-left: 5px;"></i></a>
{{ else }}
{{ .Content }}
{{ end }}
</p>
</div> </div>
{{ end }}
<p class="text-right"><a href="/blog/">More Posts <i class="fa fa-angle-double-right" style="padding-left: 5px;"></i></a></p>
</section> </section>
<section id="projects"> <!-- Blog Posts Section -->
<h2>Projects</h2> <section id="posts" class="home-section-wrapper full_width home alt">
<ul class="fa-ul"> <div class="row">
{{ range where .Data.Pages "Section" "=" "projects" }} <div class="col-xs-12 col-md-4">
<li> <h2>Posts</h2>
{{ if .Content }}<a href="{{ .Permalink }}">{{ else }}{{ with .Params.external_link }}<a href="{{ . }}">{{ end }}{{ end }} <p><a href="/post/">More Posts <i class="fa fa-angle-double-right" style="padding-left: 5px;"></i></a></p>
<i class="fa-li fa fa-files-o pub-icon" aria-hidden="true"></i> </div>
<span style="padding-right: 8px">{{ .Title | markdownify }}</span> <div class="col-xs-12 col-md-8">
{{ if .Content }}</a >{{ else }}{{ with .Params.external_link }}</a>{{ end }}{{ end }} {{ range last 5 (where .Data.Pages "Section" "=" "post") }}
</li> <div class="article-list-item">
{{ end }} <h3 class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
</ul> {{ partial "article_metadata_compact" . }}
<p>
{{ if .Truncated }}
{{ .Summary }}
{{ else }}
{{ .Content | markdownify }}
{{ end }}
</p>
<p class="read-more">
<a href="{{ .Permalink }}" class="btn btn-primary btn-outline">Read more</a>
</p>
</div>
{{ end }}
</div>
</div>
</section> </section>
<!-- Projects Section -->
<section id="projects" class="home-section-wrapper full_width home">
<div class="row">
<div class="col-xs-12 col-md-4">
<h2>Projects</h2>
</div>
<div class="col-xs-12 col-md-8">
<ul class="fa-ul">
{{ range where .Data.Pages "Section" "=" "project" }}
<li>
{{ if .Content }}<a href="{{ .Permalink }}">{{ else }}{{ with .Params.external_link }}<a href="{{ . }}">{{ end }}{{ end }}
<i class="fa-li fa fa-files-o pub-icon" aria-hidden="true"></i>
<span style="padding-right: 8px">{{ .Title | markdownify }}</span>
{{ if .Content }}</a >{{ else }}{{ with .Params.external_link }}</a>{{ end }}{{ end }}
</li>
{{ end }}
</ul>
</div>
</div>
</section>
<!-- Custom Sections -->
{{ range $index, $page := where .Site.Pages "Section" "=" "home" }} {{ range $index, $page := where .Site.Pages "Section" "=" "home" }}
{{ if eq .Title "teaching" }} {{ if and (isset .Params "section_id") (not (eq .Params.section_id 0)) }}
<section id="teaching"> {{ $title_words := split $page.Title " " }}
{{ .Render "teaching" }} <section id="{{ range $k, $v := $title_words }}{{ if eq $k 0 }}{{ . | urlize | lower }}{{ end }}{{ end }}" class="home-section-wrapper full_width home alt">
<div class="row">
<div class="col-xs-12 col-md-4">
<h2>{{ title $page.Title }}</h2>
</div>
<div class="col-xs-12 col-md-8">
{{ $page.Content }}
</div>
</div>
</section> </section>
{{ end }} {{ end }}
{{ end }} {{ end }}
<section id="contact"> <!-- Contact Section -->
<h2>Contact</h2> <section id="contact" class="home-section-wrapper full_width home">
{{ partial "contact.html" . }} <div class="row">
<div class="col-xs-12 col-md-4">
<h2>Contact</h2>
</div>
<div class="col-xs-12 col-md-8">
{{ partial "home_contact.html" . }}
</div>
</div>
</section> </section>
<!-- Page Footer -->
{{ partial "footer_container.html" . }} {{ partial "footer_container.html" . }}
</div> </div>

View file

@ -1,7 +1,6 @@
<div class="article-metadata"> <div class="article-metadata">
<span class="article-date"> <span class="article-date">
<i class="fa fa-calendar"></i>
<time datetime="{{ .Date }}" itemprop="datePublished">{{ .Date.Format .Site.Params.date_format }}</time> <time datetime="{{ .Date }}" itemprop="datePublished">{{ .Date.Format .Site.Params.date_format }}</time>
</span> </span>
@ -11,11 +10,15 @@
<span class="article-tags"> <span class="article-tags">
<i class="fa fa-tags"></i> <i class="fa fa-tags"></i>
{{ range $k, $v := .Params.tags }} {{ range $k, $v := .Params.tags }}
<a class="article-tag-link" href="{{ $.Site.BaseURL }}tags/{{ . | urlize | lower }}">{{ . }}</a> <a class="article-tag-link" href="{{ $.Site.BaseURL }}tags/{{ . | urlize | lower }}">{{ . }}</a>{{ if lt $k (sub $tagsLen 1) }}, {{ end }}
{{ if lt $k (sub $tagsLen 1) }}, {{ end }}
{{ end }} {{ end }}
</span> </span>
{{ end }} {{ end }}
{{ end }} {{ end }}
<div class="pull-right">
{{ partial "share.html" . }}
</div>
</div> </div>

View file

@ -0,0 +1,19 @@
<div class="article-metadata">
<span class="article-date">
<time datetime="{{ .Date }}" itemprop="datePublished">{{ .Date.Format .Site.Params.date_format }}</time>
</span>
{{ if isset .Params "tags" }}
{{ $tagsLen := len .Params.tags }}
{{ if gt $tagsLen 0 }}
<span class="article-tags">
<i class="fa fa-tags"></i>
{{ range $k, $v := .Params.tags }}
<a class="article-tag-link" href="{{ $.Site.BaseURL }}tags/{{ . | urlize | lower }}">{{ . }}</a>{{ if lt $k (sub $tagsLen 1) }}, {{ end }}
{{ end }}
</span>
{{ end }}
{{ end }}
</div>

View file

@ -0,0 +1,7 @@
{{ if not (isset .Site.Params "disable_comments") }}
<section id="comments">
<div id="disqus_thread">
{{ template "_internal/disqus.html" . }}
</div>
</section>
{{ end }}

View file

@ -1,4 +1,6 @@
<script src="/js/jquery-1.12.3.min.js"></script> <script src="/js/jquery-1.12.3.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/gsap/1.18.4/TweenMax.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/gsap/latest/plugins/ScrollToPlugin.min.js"></script>
<script src="/js/bootstrap.min.js"></script> <script src="/js/bootstrap.min.js"></script>
<script src="/js/hugo-academic.js"></script> <script src="/js/hugo-academic.js"></script>
@ -31,10 +33,12 @@
<script>hljs.initHighlightingOnLoad();</script> <script>hljs.initHighlightingOnLoad();</script>
<!-- LaTeX math rendering --> <!-- LaTeX math rendering -->
{{ if and (isset .Params "math") (eq .Params.math true) }}
<script type="text/x-mathjax-config"> <script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']] } }); MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']] } });
</script> </script>
<script async src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML"></script> <script async src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML"></script>
{{ end }}
</body> </body>
</html> </html>

View file

@ -1,11 +1,12 @@
<footer class="site-footer"> <footer class="site-footer">
<div class="inner"> <div class="inner">
<p> <p class="powered-by">
Powered by the <a href="http://www.cushen.me">Academia</a> theme for the <a href="http://gohugo.io">Hugo</a> {{ with .Site.Copyright }}{{ . | markdownify}} &middot; {{ end }}
engine.
<span class="pull-right"><a href="#top">Back to top</a></span> Powered by the <a href="https://github.com/gcushen/hugo-academic" target="_blank">Academic theme</a> for <a href="http://gohugo.io" target="_blank">Hugo</a>.
<span class="pull-right"><a href="#top" id="back_to_top"><span class="button_icon"><i class="fa fa-chevron-up fa-2x" aria-hidden="true"></i></span></a></span>
</p> </p>
</div> </div>

View file

@ -15,8 +15,9 @@
<link rel="stylesheet" href="/css/font-awesome.min.css" /> <link rel="stylesheet" href="/css/font-awesome.min.css" />
<link rel="stylesheet" href="/css/academicons.min.css" /> <link rel="stylesheet" href="/css/academicons.min.css" />
<link rel="stylesheet" href="/css/hugo-academic.css" /> <link rel="stylesheet" href="/css/hugo-academic.css" />
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
<title>{{ .Site.Title }}</title> <title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>
</head> </head>
<body> <body>

View file

@ -12,8 +12,8 @@
</div> </div>
<ul class="list-inline social-icon"> <ul class="list-inline social-icon">
{{ range .Site.Params.contact.social }}
{{ range .Site.Params.social }}
<li> <li>
<a href="{{ .link }}"> <a href="{{ .link }}">
{{ if eq .icon_pack "ai" }} {{ if eq .icon_pack "ai" }}
@ -32,14 +32,14 @@
<div class="visible-sm visible-xs"></div> <div class="visible-sm visible-xs"></div>
<div class="col-xs-12 col-md-8" id="bio"> <div class="col-xs-12 col-md-8">
{{ .Content }} {{ .Content }}
<div class="row"> <div class="row">
<div class="col-md-5"> <div class="col-md-5">
<h2>Interests</h2> <h3>Interests</h3>
<ul> <ul>
{{ range .Site.Params.interests }} {{ range .Site.Params.interests }}
<li>{{ . }}</li> <li>{{ . }}</li>
@ -48,7 +48,7 @@
</div> </div>
<div class="col-md-7"> <div class="col-md-7">
<h2>Education</h2> <h3>Education</h3>
<ul class="ul-edu fa-ul"> <ul class="ul-edu fa-ul">
{{ range .Site.Params.education }} {{ range .Site.Params.education }}
<li> <li>

View file

@ -3,7 +3,7 @@
{{ with .Site.Params.phone }} {{ with .Site.Params.phone }}
<li> <li>
<i class="fa fa-phone fa-fw" aria-hidden="true"></i> <i class="fa fa-phone fa-fw" aria-hidden="true"></i>
<span>{{ . }}</span> <span><a href="tel:{{ . }}">{{ . }}</a></span>
</li> </li>
{{ end }} {{ end }}

View file

@ -1,3 +1,4 @@
{{ $baseUrl := .Site.BaseURL }}
<nav class="navbar navbar-default navbar-fixed-top" id="navbar-main"> <nav class="navbar navbar-default navbar-fixed-top" id="navbar-main">
<div class="container"> <div class="container">
@ -9,23 +10,19 @@
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
<a class="navbar-brand" href="/#">{{ .Site.Title }}</a> <a class="navbar-brand" href="{{ $baseUrl }}">{{ .Site.Title }}</a>
</div> </div>
<!-- Collect the nav links, forms, and other content for toggling --> <!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="#navbar-collapse-1"> <div class="collapse navbar-collapse" id="#navbar-collapse-1">
<!-- Left Nav Bar --> <!-- Left Nav Bar -->
<ul class="nav navbar-nav"> <ul class="nav navbar-nav navbar-right">
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
<li class="nav-item"><a href="{{ .URL }}">{{ .Name }}</a></li> <li class="nav-item"><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }} {{ end }}
</ul> </ul>
<!-- Right Nav Bar -->
<ul class="nav navbar-nav navbar-right">
</ul>
</div><!-- /.navbar-collapse --> </div><!-- /.navbar-collapse -->
</div><!-- /.container --> </div><!-- /.container -->
</nav> </nav>

View file

@ -0,0 +1,8 @@
<a class="btn btn-primary btn-outline btn-xs" href="{{ .Permalink }}">Details</a>
{{ with .Params.url_pdf }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">PDF</a>{{ end }}
{{ with .Params.url_code }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Code</a>{{ end }}
{{ with .Params.url_dataset }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Dataset</a>{{ end }}
{{ with .Params.url_project }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Project</a>{{ end }}
{{ with .Params.url_slides }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Slides</a>{{ end }}
{{ with .Params.url_video }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Video</a>{{ end }}
{{ range .Params.url_custom }}<a class="btn btn-primary btn-outline btn-xs" href="{{ .url }}">{{ .name }}</a>{{ end }}

View file

@ -0,0 +1,20 @@
{{ if not (isset .Site.Params "disable_sharing") }}
<div class="share">
<a class="facebook" href="https://www.facebook.com/sharer.php?u={{ .Permalink | html }}" target="_blank">
<i class="fa fa-facebook-square"></i>
<span class="hidden">Facebook</span>
</a>
<a class="twitter" href="https://twitter.com/intent/tweet?text={{ .Title | html }}&amp;url={{ .Permalink | html }}" target="_blank">
<i class="fa fa-twitter-square"></i>
<span class="hidden">Twitter</span>
</a>
<a class="email" href="mailto:?subject={{ .Title | html }}&amp;body={{ .Permalink | html }}">
<i class="fa fa-envelope-square"></i>
<span class="hidden">Email</span>
</a>
</div>
{{ end }}

View file

@ -5,11 +5,14 @@
<div id="pub"> <div id="pub">
<div class="pub-title"> <div class="pub-title">
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
<p class="citation_authors"> <span class="citation_authors">
{{ with .Params.authors }} {{ with .Params.authors }}
{{ delimit . ", " }} {{ delimit . ", " }}
{{ end }} {{ end }}
</p> </span>
<span class="pull-right">
{{ partial "share.html" . }}
</span>
</div> </div>
<h3>Abstract</h3> <h3>Abstract</h3>
@ -39,18 +42,20 @@
</div> </div>
<div class="visible-xs space-below"></div> <div class="visible-xs space-below"></div>
<div class="row"> <div class="row" style="padding-top: 10px">
<div class="col-sm-1"></div> <div class="col-sm-1"></div>
<div class="col-sm-10"> <div class="col-sm-10">
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-3" style="font-weight: bold">Links</div> <div class="col-xs-12 col-sm-3" style="font-weight: bold; line-height:34px;">Links</div>
<div class="col-xs-12 col-sm-9"> <div class="col-xs-12 col-sm-9">
{{ with .Params.url_pdf }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">PDF</a>{{ end }} {{ with .Params.url_pdf }}<a class="btn btn-primary btn-outline" href="{{ . }}">PDF</a>{{ end }}
{{ with .Params.url_code }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Code</a>{{ end }} {{ with .Params.url_code }}<a class="btn btn-primary btn-outline" href="{{ . }}">Code</a>{{ end }}
{{ with .Params.url_dataset }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Dataset</a>{{ end }} {{ with .Params.url_dataset }}<a class="btn btn-primary btn-outline" href="{{ . }}">Dataset</a>{{ end }}
{{ with .Params.url_project }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Project</a>{{ end }} {{ with .Params.url_project }}<a class="btn btn-primary btn-outline" href="{{ . }}">Project</a>{{ end }}
{{ range .Params.url_custom }}<a class="btn btn-primary btn-outline btn-xs" href="{{ .url }}">{{ .name }}</a>{{ end }} {{ with .Params.url_slides }}<a class="btn btn-primary btn-outline" href="{{ . }}">Slides</a>{{ end }}
{{ with .Params.url_video }}<a class="btn btn-primary btn-outline" href="{{ . }}">Video</a>{{ end }}
{{ range .Params.url_custom }}<a class="btn btn-primary btn-outline" href="{{ .url }}">{{ .name }}</a>{{ end }}
</div> </div>
</div> </div>

View file

View file

@ -17,13 +17,8 @@
<ul class="compact fa-ul"> <ul class="compact fa-ul">
{{ range .Pages.ByDate.Reverse }} {{ range .Pages.ByDate.Reverse }}
<li> <li>
<i class="fa-li fa fa-file-text-o" aria-hidden="true" style="color:#03396c;font-size:80%;padding-top:6px;"></i> {{ .Title | safeHTML }} <i class="fa-li fa fa-file-text-o" aria-hidden="true" style="color:#03396c;font-size:80%;padding-top:6px;"></i> {{ .Title | markdownify }}
<a class="btn btn-primary btn-outline btn-xs" href="{{ .Permalink }}">Details</a> <p>{{ partial "publication_list_buttons" . }}</p>
{{ with .Params.url_pdf }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">PDF</a>{{ end }}
{{ with .Params.url_code }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Code</a>{{ end }}
{{ with .Params.url_dataset }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Dataset</a>{{ end }}
{{ with .Params.url_project }}<a class="btn btn-primary btn-outline btn-xs" href="{{ . }}">Project</a>{{ end }}
{{ range .Params.url_custom }}<a class="btn btn-primary btn-outline btn-xs" href="{{ .url }}">{{ .name }}</a>{{ end }}
</li> </li>
{{ end }} {{ end }}
</ul> </ul>

View file

@ -18,7 +18,7 @@
// Prevent default click behavior // Prevent default click behavior
event.preventDefault(); event.preventDefault();
var navbarHeight = $('.navbar-header').innerHeight; var navbarHeight = $('.navbar-header').innerHeight();
// Use jQuery's animate() method for smooth page scrolling. // Use jQuery's animate() method for smooth page scrolling.
// The numerical parameter specifies the time (ms) taken to scroll to the specified hash. // The numerical parameter specifies the time (ms) taken to scroll to the specified hash.