Initial migration to new theme

This commit is contained in:
Salar Rahmanian 2020-09-06 22:07:03 -07:00
parent 5ce643146c
commit 83e5d66863
27 changed files with 224 additions and 511 deletions

View file

@ -1,32 +1,28 @@
{{ define "content" -}}
<article class="post bg-white">
<!-- post-header -->
<header class="post-header">
<h1 class="post-title">{{ .Title }}</h1>
{{ partial "post/i18nlist.html" . }}
<div class="post-meta">
<!-- <time datetime="{{ .Date.Format "2006-01-02" }}" class="post-time"> -->
<!-- <!-1- {{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }} -1-> -->
<!-- </time> -->
</div>
</header>
<!-- TOC -->
{{ partial "post/toc.html" . }}
<!-- Content -->
<div class="post-content">
{{ .Content }}
</div>
<!-- Copyright -->
{{ partial "post/copyright.html" . }}
<!-- Reward -->
{{ partial "post/reward.html" . }}
</article>
<!-- Comments -->
{{ partial "comments.html" . }}
{{- define "main" }}
{{- $scratch := newScratch }}
{{- if isset .Params "image" }}
{{- $scratch.Set "image" .Params.image }}
{{- else }}
{{ $scratch.Set "image" .Site.Params.fallBackOgImage }}
{{- end }}
{{- $image := $scratch.Get "image" }}
{{- $bg := (path.Join "images" $image | absLangURL) }}
<div class = 'grid-inverse wrap content'>
<article class='post_content'>
<h1 class='post_title'>{{ .Title }}</h1>
{{- partial "post-meta" . }}
{{ partial "share" . }}
{{ with .Params.featureImage }}
<img src = '{{ . }}' class="image_featured">
{{ end }}
{{ if .Params.toc }}
<h2>Overview</h2>
{{ .TableOfContents }}
{{ end }}
{{- .Content }}
</article>
{{- partial "sidebar" . }}
<!-- Comments -->
{{ partial "comments.html" . }}
</div>
{{- end }}

View file

@ -0,0 +1,12 @@
<!-- utteranc -->
{{ if .Site.Params.utteranc.enable }}
<div class="post bg-white">
<script src="https://utteranc.es/client.js"
repo= "{{ .Site.Params.utteranc.repo }}"
issue-term="{{ .Site.Params.utteranc.issueTerm }}"
theme="{{ default "github-light" .Site.Params.utteranc.theme }}"
crossorigin="anonymous"
async>
</script>
</div>
{{ end }}

View file

@ -1,40 +1,10 @@
<div class="icon-links">
{{ partial "social_links.html" . }}
</div>
<div class="copyright">
<span class="power-by">
Powered by <a class="hexo-link" href="https://gohugo.io">Hugo</a>
</span>
<span class="copyright-year">
{{- $current := now.Format "2006" }}
&copy;
{{ if ne .Site.Params.since $current }}
{{ .Site.Params.since }} -
{{ end }}
{{- $current }}
<span class="heart">
{{/* icon heart */}}
<i class="iconfont">
{{ partial "svg/heart.svg" }}
</i>
</span>
{{- if or .Site.Copyright .Site.Author.name -}}
<span class="author">
{{if .Site.Copyright }}{{ .Site.Copyright | safeHTML }}
{{ else }}{{ .Site.Author.name | safeHTML }}
{{ end }}
</span>
<span>
<footer class = 'footer'>
<div class = 'footer_inner wrap pale'>
<img src = '{{ absURL "softinio.jpg" }}' class = 'icon icon_2 transparent'>
<p>Copyright &copy;&nbsp;<span class = 'year'></span>&nbsp;{{ .Site.Title | upper }}. <span>
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a><br />This work by <span xmlns:cc="http://creativecommons.org/ns#" property="cc:attributionName">Salar Rahmanian</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
Please attribute properly and link back. <br/>
</span>
{{- end -}}
</span>
{{ if .Site.Params.customFooter }}
<span>
{{ .Site.Params.customFooter | safeHTML }}
</span>
{{ end }}
</div>
</span></p>
{{- partial "top" .}}
</div>
</footer>

View file

@ -0,0 +1,32 @@
<title>{{ if and .Title (ne (trim (lower .Site.Title) "") (trim (lower .Title) "")) }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>
<meta charset='utf-8'>
{{ hugo.Generator }}
{{- with .Site.Params.ga_verify }}
<meta name="google-site-verification" content="{{ . }}" />
{{- end }}
<meta name = 'viewport' content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no'>
<meta http-equiv = 'X-UA-Compatible' content = 'IE=edge'>
{{- if (ne hugo.Environment "development") }}
{{- partial "analytics.html" . }}
{{- end }}
{{- partial "opengraph.html" . }}
{{- partial "favicon.html" . }}
<link rel='canonical' href='{{ .Permalink }}'>
<!-- author & description & keywords -->
<meta name="author" content="{{ .Site.Params.author | safeHTML }}" />
{{- if .Description -}}
<meta name="description" content="{{ .Description | safeHTML }}" />
{{ else if .IsPage }}
<meta name="description" content="{{ .Summary | plainify }}" />
{{ else if .Site.Params.description }}
<meta name="description" content="{{ .Site.Params.description | safeHTML }}" />
{{- end -}}
{{- if .Keywords -}}
{{ $length := len .Keywords | add -1 -}}
<meta name="keywords" content="{{ range $index, $element := .Keywords }}{{ $element | safeHTML }}{{if ne $index $length }}, {{ end }}{{ end }}" />
{{ else if .Site.Params.keywords }}
{{ $length := len .Site.Params.keywords | add -1 -}}
<meta name="keywords" content="{{ range $index, $element := .Site.Params.keywords }}{{ $element | safeHTML }}{{if ne $index $length }}, {{ end }}{{ end }}" />
{{- end }}