Fix absURL paths and exampleSite

This commit is contained in:
panr 2019-01-29 10:47:50 +01:00
parent abf763d2cc
commit 6c68bd63ae
7 changed files with 18 additions and 18 deletions

View file

@ -4,7 +4,7 @@ theme = "hugo-theme-terminal"
paginate = 5 paginate = 5
[params] [params]
contentTypeName = "posts" contentTypeName = "post"
themeColor = "orange" themeColor = "orange"
[params.logo] [params.logo]

View file

@ -17,13 +17,13 @@
{{ if .Params.tags }} {{ if .Params.tags }}
<span class="post-tags"> <span class="post-tags">
{{ range .Params.tags }} {{ range .Params.tags }}
#<a href="{{ $.Site.BaseURL }}tags/{{ . | urlize }}">{{ . }}</a>&nbsp; #<a href="{{ (urlize (printf "tags/%s" . )) | absURL }}">{{ . }}</a>&nbsp;
{{ end }} {{ end }}
</span> </span>
{{ end }} {{ end }}
{{ with .Params.Cover }} {{ with .Params.Cover }}
<img src="/img/{{ . }}" class="post-cover" /> <img src="{{ printf "img/%s" . | absURL }}" class="post-cover" />
{{ end }} {{ end }}
<div class="post-content"> <div class="post-content">

View file

@ -11,13 +11,13 @@
{{ if .Params.tags }} {{ if .Params.tags }}
<span class="post-tags"> <span class="post-tags">
{{ range .Params.tags }} {{ range .Params.tags }}
#<a href="{{ $.Site.BaseURL }}tags/{{ . | urlize }}">{{ . }}</a>&nbsp; #<a href="{{ (urlize (printf "tags/%s" .)) | absURL }}">{{ . }}</a>&nbsp;
{{ end }} {{ end }}
</span> </span>
{{ end }} {{ end }}
{{ with .Params.Cover }} {{ with .Params.Cover }}
<img src="/img/{{ . }}" class="post-cover" /> <img src="{{ printf "img/%s" . | absURL }}" class="post-cover" />
{{ end }} {{ end }}
<div class="post-content"> <div class="post-content">

View file

@ -11,5 +11,5 @@
</div> </div>
</footer> </footer>
<script src="/assets/main.js"></script> <script src="{{ "assets/main.js" | absURL }}"></script>
<script src="/assets/prism.js"></script> <script src="{{ "assets/prism.js" | absURL }}"></script>

View file

@ -6,18 +6,18 @@
<link rel="canonical" href="{{ .Permalink }}" /> <link rel="canonical" href="{{ .Permalink }}" />
<!-- Theme CSS --> <!-- Theme CSS -->
<link rel="stylesheet" href="/assets/style.css"> <link rel="stylesheet" href="{{ "assets/style.css" | absURL }}">
{{ if (ne .Site.Params.ThemeColor "orange") }} {{ if (ne $.Site.Params.ThemeColor "orange") }}
<link rel="stylesheet" href="/assets/{{ .Site.Params.ThemeColor }}.css"> <link rel="stylesheet" href="{{ (printf "assets/%s.css" .Site.Params.ThemeColor) | absURL }}">
{{ end }} {{ end }}
<!-- Custom CSS to override theme properties (/static/style.css) --> <!-- Custom CSS to override theme properties (/static/style.css) -->
<link rel="stylesheet" href="/style.css"> <link rel="stylesheet" href="{{ "style.css" | absURL }}">
<!-- Icons --> <!-- Icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/img/apple-touch-icon-144-precomposed.png"> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ "img/apple-touch-icon-144-precomposed.png" | absURL }}">
{{ with .Site.Params.ThemeColor }} {{ with $.Site.Params.ThemeColor }}
<link rel="shortcut icon" href="/img/favicon/{{ . }}.png"> <link rel="shortcut icon" href="{{ printf "img/favicon/%s.png" . | absURL }}">
{{ end }} {{ end }}
<!-- Twitter Card --> <!-- Twitter Card -->
@ -26,7 +26,7 @@
<meta name="twitter:description" content="{{ if .IsHome }}{{ $.Site.Params.tagline }}{{ else }}{{ .Summary | plainify }}{{ end }}" /> <meta name="twitter:description" content="{{ if .IsHome }}{{ $.Site.Params.tagline }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
<meta name="twitter:site" content="{{ .Site.BaseURL }}" /> <meta name="twitter:site" content="{{ .Site.BaseURL }}" />
<meta name="twitter:creator" content="{{ .Params.Author }}" /> <meta name="twitter:creator" content="{{ .Params.Author }}" />
<meta name="twitter:image" content="{{ with .Params.Cover }}{{ $.Site.BaseURL }}img/post/{{ . }}{{ else }}{{ $.Site.BaseURL }}img/default.jpg{{ end }}"> <meta name="twitter:image" content="{{ with .Params.Cover }}{{ printf "img/%s" . | absURL }}{{ end }}">
<!-- OG data --> <!-- OG data -->
<meta property="og:locale" content="{{ $.Site.Language.Lang }}" /> <meta property="og:locale" content="{{ $.Site.Language.Lang }}" />
@ -35,7 +35,7 @@
<meta property="og:description" content="{{ if .IsHome }}{{ $.Site.Params.tagline }}{{ else }}{{ .Summary | plainify }}{{ end }}" /> <meta property="og:description" content="{{ if .IsHome }}{{ $.Site.Params.tagline }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" /> <meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:site_name" content="{{ .Title }}" /> <meta property="og:site_name" content="{{ .Title }}" />
<meta property="og:image" content="{{ with .Params.Cover }}{{ $.Site.BaseURL }}img/post/{{ . }}{{ else }}{{ $.Site.BaseURL }}img/default.jpg{{ end }}"> <meta property="og:image" content="{{ with .Params.Cover }}{{ printf "img/%s" . | absURL }}{{ end }}">
<meta property="og:image:width" content="2048"> <meta property="og:image:width" content="2048">
<meta property="og:image:height" content="1024"> <meta property="og:image:height" content="1024">
{{ range .Params.categories }}<meta property="article:section" content="{{ . }}" />{{ end }} {{ range .Params.categories }}<meta property="article:section" content="{{ . }}" />{{ end }}
@ -48,5 +48,5 @@
<!-- JSON Feed --> <!-- JSON Feed -->
{{ if .OutputFormats.Get "json" }} {{ if .OutputFormats.Get "json" }}
<link href="{{ if .OutputFormats.Get "json" }}{{ .Site.BaseURL }}feed.json{{ end }}" rel="alternate" type="application/json" title="{{ .Site.Title }}" /> <link href="{{ if .OutputFormats.Get "json" }}{{ "feed.json" | absURL }}{{ end }}" rel="alternate" type="application/json" title="{{ .Site.Title }}" />
{{ end }} {{ end }}

View file

@ -1,4 +1,4 @@
<a href="{{ if .Site.Params.Logo.LogoHomeLink }}{{ .Site.Params.Logo.LogoHomeLink }}{{else}}{{ .Site.BaseURL }}{{ end }}" style="text-decoration: none;"> <a href="{{ if .Site.Params.Logo.LogoHomeLink }}{{ .Site.Params.Logo.LogoHomeLink }}{{else}}{{ $.Site.BaseURL }}{{ end }}" style="text-decoration: none;">
<div class="logo"> <div class="logo">
{{ with .Site.Params.Logo.logoText }}{{ . }}{{ else }}Terminal{{ end }} {{ with .Site.Params.Logo.logoText }}{{ . }}{{ else }}Terminal{{ end }}
</div> </div>