-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 039b99d.
- Loading branch information
Hanze Dong
committed
May 2, 2024
1 parent
0979403
commit a229b21
Showing
2 changed files
with
202 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{{- define "main" }} | ||
|
||
{{- if (and site.Params.profileMode.enabled .IsHome) }} | ||
{{- partial "index_profile.html" . }} | ||
{{- else }} {{/* if not profileMode */}} | ||
|
||
{{- if not .IsHome | and .Title }} | ||
<header class="page-header"> | ||
{{- partial "breadcrumbs.html" . }} | ||
<h1> | ||
{{ .Title }} | ||
{{- if and (or (eq .Kind `term`) (eq .Kind `section`)) (.Param "ShowRssButtonInSectionTermList") }} | ||
{{- with .OutputFormats.Get "rss" }} | ||
<a href="{{ .RelPermalink }}" title="RSS" aria-label="RSS"> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" | ||
stroke-linecap="round" stroke-linejoin="round" height="23"> | ||
<path d="M4 11a9 9 0 0 1 9 9" /> | ||
<path d="M4 4a16 16 0 0 1 16 16" /> | ||
<circle cx="5" cy="19" r="1" /> | ||
</svg> | ||
</a> | ||
{{- end }} | ||
{{- end }} | ||
</h1> | ||
{{- if .Description }} | ||
<div class="post-description"> | ||
{{ .Description | markdownify }} | ||
</div> | ||
{{- end }} | ||
</header> | ||
{{- end }} | ||
|
||
{{- if .Content }} | ||
<div class="post-content"> | ||
{{- if not (.Param "disableAnchoredHeadings") }} | ||
{{- partial "anchored_headings.html" .Content -}} | ||
{{- else }}{{ .Content }}{{ end }} | ||
</div> | ||
{{- end }} | ||
|
||
{{- $pages := union .RegularPages .Sections }} | ||
|
||
{{- if .IsHome }} | ||
{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} | ||
{{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true" }} | ||
{{- end }} | ||
|
||
{{- $paginator := .Paginate $pages }} | ||
|
||
{{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }} | ||
{{- partial "home_info.html" . }} | ||
<h1 class="latest-posts-heading">Latest Posts</h1> | ||
{{- end }} | ||
|
||
|
||
{{- $term := .Data.Term }} | ||
{{- range $index, $page := $paginator.Pages }} | ||
|
||
{{- $class := "post-entry" }} | ||
|
||
{{- $user_preferred := or site.Params.disableSpecial1stPost site.Params.homeInfoParams }} | ||
{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }} | ||
{{- $class = "first-entry" }} | ||
{{- else if $term }} | ||
{{- $class = "post-entry tag-entry" }} | ||
{{- end }} | ||
|
||
<article class="{{ $class }}"> | ||
{{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }} | ||
{{- partial "cover.html" (dict "cxt" . "IsSingle" false "isHidden" $isHidden) }} | ||
<header class="entry-header"> | ||
<h2 class="entry-hint-parent"> | ||
{{- .Title }} | ||
{{- if .Draft }} | ||
<span class="entry-hint" title="Draft"> | ||
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" fill="currentColor"> | ||
<path | ||
d="M160-410v-60h300v60H160Zm0-165v-60h470v60H160Zm0-165v-60h470v60H160Zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22q0 11-4.5 22.5T862.09-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z" /> | ||
</svg> | ||
</span> | ||
{{- end }} | ||
</h2> | ||
</header> | ||
{{- if (ne (.Param "hideSummary") true) }} | ||
<div class="entry-content"> | ||
<p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p> | ||
</div> | ||
{{- end }} | ||
{{- if not (.Param "hideMeta") }} | ||
<footer class="entry-footer"> | ||
{{- partial "post_meta.html" . -}} | ||
</footer> | ||
{{- end }} | ||
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a> | ||
</article> | ||
{{- end }} | ||
|
||
{{- if gt $paginator.TotalPages 1 }} | ||
<footer class="page-footer"> | ||
<nav class="pagination"> | ||
{{- if $paginator.HasPrev }} | ||
<a class="prev" href="{{ $paginator.Prev.URL | absURL }}"> | ||
« {{ i18n "prev_page" }} | ||
{{- if (.Param "ShowPageNums") }} | ||
{{- sub $paginator.PageNumber 1 }}/{{ $paginator.TotalPages }} | ||
{{- end }} | ||
</a> | ||
{{- end }} | ||
{{- if $paginator.HasNext }} | ||
<a class="next" href="{{ $paginator.Next.URL | absURL }}"> | ||
{{- i18n "next_page" }} | ||
{{- if (.Param "ShowPageNums") }} | ||
{{- add 1 $paginator.PageNumber }}/{{ $paginator.TotalPages }} | ||
{{- end }} » | ||
</a> | ||
{{- end }} | ||
</nav> | ||
</footer> | ||
{{- end }} | ||
|
||
{{- end }}{{/* end profileMode */}} | ||
|
||
{{- end }}{{- /* end main */ -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{{- define "main" }} | ||
|
||
<!-- MathJax --> | ||
<script type="text/javascript" async | ||
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"> | ||
</script> | ||
<script type="text/x-mathjax-config"> | ||
MathJax.Hub.Config({ | ||
tex2jax: { | ||
inlineMath: [ ['$','$'], ['\\(','\\)'] ], | ||
processEscapes: true | ||
} | ||
}); | ||
</script> | ||
|
||
|
||
<article class="post-single"> | ||
<header class="post-header"> | ||
{{ partial "breadcrumbs.html" . }} | ||
<h1 class="post-title entry-hint-parent"> | ||
{{ .Title }} | ||
{{- if .Draft }} | ||
<span class="entry-hint" title="Draft"> | ||
<svg xmlns="http://www.w3.org/2000/svg" height="35" viewBox="0 -960 960 960" fill="currentColor"> | ||
<path | ||
d="M160-410v-60h300v60H160Zm0-165v-60h470v60H160Zm0-165v-60h470v60H160Zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22q0 11-4.5 22.5T862.09-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z" /> | ||
</svg> | ||
</span> | ||
{{- end }} | ||
</h1> | ||
{{- if .Description }} | ||
<div class="post-description"> | ||
{{ .Description }} | ||
</div> | ||
{{- end }} | ||
{{- if not (.Param "hideMeta") }} | ||
<div class="post-meta"> | ||
{{- partial "post_meta.html" . -}} | ||
{{- partial "translation_list.html" . -}} | ||
{{- partial "edit_post.html" . -}} | ||
{{- partial "post_canonical.html" . -}} | ||
</div> | ||
{{- end }} | ||
</header> | ||
{{- $isHidden := (.Param "cover.hiddenInSingle") | default (.Param "cover.hidden") | default false }} | ||
{{- partial "cover.html" (dict "cxt" . "IsSingle" true "isHidden" $isHidden) }} | ||
{{- if (.Param "ShowToc") }} | ||
{{- partial "toc.html" . }} | ||
{{- end }} | ||
|
||
{{- if .Content }} | ||
<div class="post-content"> | ||
{{- if not (.Param "disableAnchoredHeadings") }} | ||
{{- partial "anchored_headings.html" .Content -}} | ||
{{- else }}{{ .Content }}{{ end }} | ||
</div> | ||
{{- end }} | ||
|
||
<footer class="post-footer"> | ||
{{- $tags := .Language.Params.Taxonomies.tag | default "tags" }} | ||
<ul class="post-tags"> | ||
{{- range ($.GetTerms $tags) }} | ||
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li> | ||
{{- end }} | ||
</ul> | ||
{{- if (.Param "ShowPostNavLinks") }} | ||
{{- partial "post_nav_links.html" . }} | ||
{{- end }} | ||
{{- if (and site.Params.ShowShareButtons (ne .Params.disableShare true)) }} | ||
{{- partial "share_icons.html" . -}} | ||
{{- end }} | ||
</footer> | ||
|
||
{{- if not (.Param "noComments") }} | ||
{{- partial "comments.html" . }} | ||
{{- end }} | ||
</article> | ||
|
||
{{- end }}{{/* end main */}} |