Small changes to layouts

master
Calin Tataru 7 years ago
parent 2662c63c6c
commit a357477aaa
  1. 2
      archetypes/default.md
  2. 15
      exampleSite/config.toml
  3. 11
      exampleSite/content/about/index.md
  4. 2
      exampleSite/content/project/project1.md
  5. 2
      exampleSite/content/project/project2.md
  6. 2
      exampleSite/content/project/project3.md
  7. 2
      exampleSite/content/project/project4.md
  8. 7
      layouts/404.html
  9. 5
      layouts/_default/list.html
  10. 30
      layouts/_default/single.html
  11. 5
      layouts/_default/terms.html
  12. 12
      layouts/index.html
  13. 11
      layouts/page/single.html
  14. 4
      layouts/partials/body-open.html
  15. 6
      layouts/partials/footer.html
  16. 4
      layouts/partials/head-open.html
  17. 14
      layouts/partials/header.html
  18. 8
      layouts/partials/js.html
  19. 10
      layouts/partials/list-item.html
  20. 18
      layouts/partials/paginator.html
  21. 3
      layouts/partials/tags.html
  22. 28
      layouts/post/single.html

@ -1,5 +1,5 @@
---
title: "{{ replace .TranslationBaseName "-" " " | title }}"
date: {{ dateFormat "2006-01-02" .Date }}
description: ""
draft: true
---

@ -22,19 +22,24 @@ googleAnalytics = ""
name = "Home"
weight = 1
[[menu.main]]
url = "/about/"
name = "About"
weight = 2
[[menu.main]]
url = "/post/"
name = "Posts"
weight = 2
weight = 3
[[menu.main]]
url = "/project/"
name = "Projects"
weight = 3
weight = 4
# Social icons to be shown on the right-hand side of the navigation bar
# The "name" field should match the name of the icon to be used
# The list of available icons can be found at http://fontawesome.io/icons/
# Social icons to be shown on the right-hand side of the navigation bar.
# The "name" field should match the name of the icon in Font Awesome.
# The list of available icons can be found at http://fontawesome.io/icons.
[[menu.icon]]
url = "mailto:me@example.com"

@ -0,0 +1,11 @@
---
title: About
description: What is Hugo?
---
Hugo is a fast and modern static site generator written in Go, and designed to make website creation fun again.
Hugo is a general-purpose website framework. Technically speaking, Hugo is a static site generator. Unlike systems that dynamically build a page with each visitor request, Hugo builds pages when you create or update your content. Since websites are viewed far more often than they are edited, Hugo is designed to provide an optimal viewing experience for your website’s end users and an ideal writing experience for website authors.
Websites built with Hugo are extremely fast and secure. Hugo sites can be hosted anywhere, including Netlify, Heroku, GoDaddy, DreamHost, GitHub Pages, GitLab Pages, Surge, Aerobatic, Firebase, Google Cloud Storage, Amazon S3, Rackspace, Azure, and CloudFront and work well with CDNs. Hugo sites run without the need for a database or dependencies on expensive runtimes like Ruby, Python, or PHP.
We think of Hugo as the ideal website creation tool with nearly instant build times, able to rebuild whenever a change is made.

@ -1,7 +1,7 @@
---
title: "Project 1"
description: "Lorem ipsum dolor sit amet"
repo: "#" # delete this line if you want blog-like posts for projects
repo: "#" # delete this line if you want a blog-like page
tags: ["go", "golang", "hugo"]
weight: 1
draft: false

@ -1,7 +1,7 @@
---
title: "Project 2"
description: "Consectetur adipiscing elit"
repo: "#" # delete this line if you want blog-like posts for projects
repo: "#" # delete this line if you want a blog-like page
tags: ["html", "css", "js"]
weight: 2
draft: false

@ -1,7 +1,7 @@
---
title: "Project 3"
description: "Cras felis sapien"
repo: "#" # delete this line if you want blog-like posts for projects
repo: "#" # delete this line if you want a blog-like page
tags: ["bootstrap", "responsive"]
weight: 3
draft: false

@ -1,7 +1,7 @@
---
title: "Project 4"
description: "Pellentesque eu lacinia id"
repo: "#" # delete this line if you want blog-like posts for projects
repo: "#" # delete this line if you want a blog-like page
tags: ["highlight-js", "syntax-highlighting"]
weight: 4
draft: false

@ -1,15 +1,10 @@
{{ partial "header" . }}
<main>
<div class="intro">
<h1>¯\_(ツ)_/¯</h1>
<h2>Page not found</h2>
<h2>Nothing here</h2>
</div>
</main>
{{ partial "footer" . }}

@ -2,12 +2,13 @@
<main>
<h2>{{ .Title }}</h2>
<div class="item">
<h2>{{ .Title }}</h2>
</div>
{{ range (.Paginator 5).Pages }} {{ partial "list-item" . }} {{ end }}
</main>
{{ partial "paginator" . }}
{{ partial "footer" . }}

@ -2,38 +2,14 @@
<main>
{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006") | $.Scratch.Set "subtitle" }}
{{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }}
<div class="item">
<h2>{{ .Title }}</h2>
<h5>{{ $.Scratch.Get "subtitle" }}</h5>
{{ range .Params.tags }}
<a href="{{ $.Site.BaseURL }}tags/{{ . | urlize }}"><kbd class="item-tag">{{ . }}</kbd></a>
{{ end }}
<h5>{{ .Description }}</h5>
{{ partial "tags" . }}
</div>
<br> <div class="text-justify">{{ .Content }}</div>
<!-- related posts with the same tags -->
{{ $related := first 3 (where (where (where .Site.Pages.ByDate.Reverse ".Type" "==" "post") ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
{{ if $related }}
<h4 class="page-header">Related</h4>
{{ range $related }} {{ partial "list-item" . }} {{ end }}
{{ end }}
{{ if and .Site.DisqusShortname (not .Params.disableComments) }}
<h4 class="page-header">Comments</h4>
{{ template "_internal/disqus.html" . }}
{{ end }}
</main>
{{ partial "footer.html" . }}
{{ partial "footer" . }}

@ -2,12 +2,13 @@
<main>
<h2>{{ .Title }}</h2>
<div class="item">
<h2>{{ .Title }}</h2>
</div>
{{ range (.Paginator 5).Pages }} {{ partial "list-item" . }} {{ end }}
</main>
{{ partial "paginator" . }}
{{ partial "footer" . }}

@ -1,22 +1,12 @@
{{ partial "header" . }}
<main>
<div class="intro">
{{ with .Site.Params.profilePic }} <img class="profile" src="{{ . }}"> {{ end }}
<h1>{{ .Site.Title }}</h1>
<h2>{{ markdownify .Site.Params.Description }}</h2>
{{ with .Content }}
<div class="homepage-content text-justify">
{{ . }}
</div>
{{ end }}
{{ with .Content }} <div class="homepage-content text-justify">{{ . }}</div> {{ end }}
</div>
</main>
{{ partial "footer" . }}

@ -1,11 +0,0 @@
{{ partial "header" . }}
<main>
<h2>{{ .Title }}</h2>
<br> <div class="text-justify">{{ .Content }}</div>
</main>
{{ partial "footer.html" . }}

@ -1,2 +1,2 @@
<!-- Intentionally left empty. Override this partial in your website to insert code just after the
opening <body> tag. For example, to install Google Analytics. -->
<!-- Intentionally left empty. Override this partial in your website to insert code
just after the opening <body> tag. For example, to install Google Analytics. -->

@ -1,9 +1,7 @@
<footer>
<p class="copyright text-muted">{{ .Site.Params.copyright | default "&copy; All rights reserved. Powered by [Hugo](https://gohugo.io) and [Minimal](https://github.com/calintat/minimal)" | markdownify }}</p>
<p class="copyright text-muted">{{ .Site.Params.copyright | default "&copy; All rights reserved. Powered by [Hugo](https://gohugo.io) and [Minimal](https://github.com/calintat/minimal)." | markdownify }}</p>
</footer>
</body>
</html>

@ -1,2 +1,2 @@
<!-- Intentionally left empty. Override this partial in your website to insert code just after the
opening <head> tag. For example, to install Google Tag Manager. -->
<!-- Intentionally left empty. Override this partial in your website to insert code
just after the opening <head> tag. For example, to install Google Tag Manager. -->

@ -21,7 +21,6 @@
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments)};
gtag('js', new Date());
gtag('config', '{{ .Site.GoogleAnalytics }}');
</script>
{{ end }}
@ -29,7 +28,7 @@
{{ if .Site.Params.MathJax | default true }}
<!-- adds MathJax support -->
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
{{ end }}
</head>
@ -37,23 +36,16 @@
<body>
{{ partial "body-open" . }}
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand visible-xs" href="#">{{ .Title }}</a>
<button class="navbar-toggle" data-target=".navbar-collapse" data-toggle="collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse">
{{ if .Site.Menus.main }}
<ul class="nav navbar-nav">
{{ range sort .Site.Menus.main }}
@ -61,7 +53,6 @@
{{ end }}
</ul>
{{ end }}
{{ if .Site.Menus.icon }}
<ul class="nav navbar-nav navbar-right">
{{ range sort .Site.Menus.icon }}
@ -69,9 +60,6 @@
{{ end }}
</ul>
{{ end }}
</div>
</div>
</nav>

@ -1,12 +1,10 @@
<!-- highlight.js -->
{{ if .Site.Params.highlight | default false }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
{{ range .Site.Params.highlightLanguages }} <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/{{ . }}.min.js"></script> {{ end }}
{{ range .Site.Params.highlightLanguages }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/{{ . }}.min.js"></script>
{{ end }}
<script>hljs.initHighlightingOnLoad();</script>
{{ end }}
<!-- custom -->

@ -13,13 +13,11 @@
{{ end }}
{{ with .Params.link }} {{ $.Scratch.Set "link" . }} {{ end }}
{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006") | $.Scratch.Set "subtitle" }}
{{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }}
{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006") | $.Scratch.Set "subheader" }}
{{ with .Description }} {{ $.Scratch.Set "subheader" . }} {{ end }}
<h4><a href="{{ .Scratch.Get "link" }}">{{ .Title }}</a></h4>
<h5>{{ $.Scratch.Get "subtitle" }}</h5>
{{ range .Params.tags }}
<a href="{{ $.Site.BaseURL }}tags/{{ . | urlize }}"><kbd class="item-tag">{{ . }}</kbd></a>
{{ end }}
<h5>{{ $.Scratch.Get "subheader" }}</h5>
{{ partial "tags" . }}
</div>

@ -3,15 +3,17 @@
<div class="pages">
{{ if .Paginator.HasPrev }}
<a class="icon pages-icon" href="{{ .Paginator.Prev.URL }}" rel="prev">
<i class="fa fa-arrow-left"></i>
</a>
{{ end }} {{ if .Paginator.HasNext }}
<a class="icon pages-icon" href="{{ .Paginator.Next.URL }}" rel="next">
<i class="fa fa-arrow-right"></i>
</a>
<a class="icon pages-icon" href="{{ .Paginator.Prev.URL }}" rel="prev">
<i class="fa fa-arrow-left"></i>
</a>
{{ end }}
{{ if .Paginator.HasNext }}
<a class="icon pages-icon" href="{{ .Paginator.Next.URL }}" rel="next">
<i class="fa fa-arrow-right"></i>
</a>
{{ end }}
</div>
{{ end }}
{{ end }}

@ -0,0 +1,3 @@
{{ range .Params.tags }}
<a href="{{ $.Site.BaseURL }}tags/{{ . | urlize }}"><kbd class="item-tag">{{ . }}</kbd></a>
{{ end }}

@ -0,0 +1,28 @@
{{ partial "header" . }}
<main>
<div class="item">
<h2>{{ .Title }}</h2>
<h5>{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006") }}</h5>
{{ partial "tags" . }}
</div>
<br> <div class="text-justify">{{ .Content }}</div>
<!-- Related posts -->
{{ $related := first 3 (where (where (where .Site.Pages.ByDate.Reverse ".Type" "==" "post") ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
{{ if $related }}
<h4 class="page-header">Related</h4>
{{ range $related }} {{ partial "list-item" . }} {{ end }}
{{ end }}
<!-- Disquis comments -->
{{ if and .Site.DisqusShortname (not .Params.disableComments) }}
<h4 class="page-header">Comments</h4>
{{ template "_internal/disqus.html" . }}
{{ end }}
</main>
{{ partial "footer" . }}
Loading…
Cancel
Save