mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
Post refactor to hold everything its own (#88)
This commit is contained in:
committed by
Luiz F. A. de Prá
parent
f834f18de2
commit
4426c889fd
@@ -3,7 +3,8 @@
|
||||
<ul>
|
||||
{{ range .Paginator.Pages }}
|
||||
<li>
|
||||
<span>{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span><a href="{{ .URL }}">{{ .Title }}</a>
|
||||
<span>{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
|
||||
<a href="{{ .URL }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
<section class="container post">
|
||||
<article>
|
||||
<header>
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
<h2 class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</h2>
|
||||
|
||||
{{ if eq .Params.math "true" }}
|
||||
<script type="text/javascript" async
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full">
|
||||
MathJax.Hub.Config({
|
||||
tex2jax: {
|
||||
inlineMath: [['$','$']],
|
||||
displayMath: [['$$','$$']],
|
||||
processEscapes: true,
|
||||
processEnvironments: true,
|
||||
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
|
||||
TeX: { extensions: ["AMSmath.js", "AMSsymbols.js"] }
|
||||
}
|
||||
});
|
||||
MathJax.Hub.Queue(function() {
|
||||
// Fix <code> tags after MathJax finishes running. This is a
|
||||
// hack to overcome a shortcoming of Markdown. Discussion at
|
||||
// https://github.com/mojombo/jekyll/issues/199
|
||||
var all = MathJax.Hub.getAllJax(), i;
|
||||
for(i = 0; i < all.length; i += 1) {
|
||||
all[i].SourceElement().parentNode.className += ' has-jax';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
</header>
|
||||
|
||||
{{ .Content }}
|
||||
</article>
|
||||
|
||||
<br/>
|
||||
|
||||
{{ if and (not (eq .Site.DisqusShortname "" )) (eq (.Params.disable_comments | default false) false)}}
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
{{ end }}
|
||||
|
||||
</section>
|
||||
3
layouts/partials/posts/disqus.html
Normal file
3
layouts/partials/posts/disqus.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{- if and (not (eq .Site.DisqusShortname "" )) (eq (.Params.disable_comments | default false) false) -}}
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
{{- end -}}
|
||||
24
layouts/partials/posts/math.html
Normal file
24
layouts/partials/posts/math.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{{- if eq .Params.math "true" -}}
|
||||
<script type="text/javascript" async
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full">
|
||||
MathJax.Hub.Config({
|
||||
tex2jax: {
|
||||
inlineMath: [['$','$']],
|
||||
displayMath: [['$$','$$']],
|
||||
processEscapes: true,
|
||||
processEnvironments: true,
|
||||
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
|
||||
TeX: { extensions: ["AMSmath.js", "AMSsymbols.js"] }
|
||||
}
|
||||
});
|
||||
MathJax.Hub.Queue(function() {
|
||||
// Fix <code> tags after MathJax finishes running. This is a
|
||||
// hack to overcome a shortcoming of Markdown. Discussion at
|
||||
// https://github.com/mojombo/jekyll/issues/199
|
||||
var all = MathJax.Hub.getAllJax(), i;
|
||||
for(i = 0; i < all.length; i += 1) {
|
||||
all[i].SourceElement().parentNode.className += ' has-jax';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{{- end -}}
|
||||
4
layouts/posts/li.html
Normal file
4
layouts/posts/li.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<li>
|
||||
<span>{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
|
||||
<a href="{{ .URL }}">{{ .Title }}</a>
|
||||
</li>
|
||||
16
layouts/posts/list.html
Normal file
16
layouts/posts/list.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{{ define "title" }}
|
||||
{{ .Title }} · {{ .Site.Title }}
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
<section class="container list">
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
|
||||
<ul>
|
||||
{{- range .Paginator.Pages -}}
|
||||
{{- .Render "li" -}}
|
||||
{{- end -}}
|
||||
</ul>
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
</section>
|
||||
{{ end }}
|
||||
@@ -2,5 +2,22 @@
|
||||
{{ .Title }} · {{ .Site.Title }}
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
{{ partial "post.html" . }}
|
||||
<section class="container post">
|
||||
<article>
|
||||
<header>
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
<h2 class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</h2>
|
||||
</header>
|
||||
|
||||
<div>
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
{{ partial "posts/disqus" . }}
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
{{ partial "posts/math" . }}
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user