-
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.
feat: using officil blog theme, and enbeded extend to blog git
- Loading branch information
Showing
11 changed files
with
322 additions
and
3 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,38 @@ | ||
.entry-content .thumbnail img { | ||
margin: var(--gap) auto calc(var(--gap)) auto; | ||
border-radius: var(--radius); | ||
pointer-events: none; | ||
height: auto; | ||
} | ||
|
||
|
||
.post-content h1 { | ||
margin: 32px auto 24; | ||
font-size: 32px; | ||
} | ||
|
||
.post-content h2 { | ||
margin: 24px auto 16px; | ||
font-size: 24px; | ||
} | ||
|
||
.post-content h3 { | ||
font-size: 18px; | ||
} | ||
|
||
.post-content h4 { | ||
font-size: 16px; | ||
} | ||
|
||
.post-content h5 { | ||
font-size: 16px; | ||
} | ||
|
||
.post-content h6 { | ||
font-size: 16px; | ||
} | ||
|
||
body { | ||
font-size: 16px; | ||
} | ||
|
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,11 @@ | ||
.entry-content { | ||
margin: 8px 0; | ||
color: var(--secondary); | ||
font-size: 14px; | ||
line-height: 1.6; | ||
overflow: hidden; | ||
/* show full summary in list */ | ||
display: inherit; | ||
-webkit-box-orient: vertical; | ||
-webkit-line-clamp: 2; | ||
} |
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,4 @@ | ||
.post-content code { | ||
padding: inherit; | ||
font-size: inherit; | ||
} |
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,9 @@ | ||
/* assets/css/core/theme-vars.css */ | ||
|
||
:root { | ||
--theme: rgb(245, 245, 245); | ||
} | ||
|
||
.list { | ||
background: var(--theme); | ||
} |
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,12 @@ | ||
<!-- https://medium.com/@ardianta/writing-using-typora-on-hugo-based-blog-a1be8500774a --> | ||
{{ if in .Destination "/static/" }} | ||
<!-- 12 is count of ../../static carachers --> | ||
{{ $new_file_path := substr .Destination 12 }} | ||
<!-- render the image with new path --> | ||
<img loading="lazy" src="{{ $new_file_path | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}" {{ end }} /> | ||
{{ else }} | ||
|
||
<img loading="lazy" src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}" {{ end }} /> | ||
|
||
{{ end }} | ||
|
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,121 @@ | ||
{{/* vimdiff layouts/_default/list.html themes/hugo-PaperMod/layouts/_default/list.html */}} | ||
{{/* feat: using first image as list cover */}} | ||
|
||
{{- 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") }} | ||
<a href="index.xml" 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 }} | ||
</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" . }} | ||
{{- 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 := (site.Params.cover.hidden | default site.Params.cover.hiddenInList) }} | ||
{{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }} | ||
<header class="entry-header"> | ||
<h2> | ||
{{- .Title }} | ||
{{- if .Draft }}<sup><span class="entry-isdraft"> [draft]</span></sup>{{- end }} | ||
</h2> | ||
</header> | ||
{{- if (ne (.Param "hideSummary") true) }} | ||
<div class="entry-content"> | ||
{{- if (.Param "ShowFirstPic") }} | ||
{{ $img := findRE "(?i)<img .*?src\\s*=\\s*\"([^\"]*(png|jpg|jpeg|gif|bmp|svg))\".*?>" .Content 1 }} | ||
{{ range $img }} | ||
<div class="thumbnail"><img src="{{ replaceRE "<img .*?src=\"(.*?)\".*?>" "$1" . }}" alt="Thumbnail" /></div> | ||
{{ end }} | ||
{{ end }} | ||
<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,65 @@ | ||
{{/* vimdiff layouts/_default/single.html themes/hugo-PaperMod/layouts/_default/single.html */}} | ||
{{/* feat: enable post_footer */}} | ||
|
||
{{- define "main" }} | ||
|
||
<article class="post-single"> | ||
<header class="post-header"> | ||
{{ partial "breadcrumbs.html" . }} | ||
<h1 class="post-title"> | ||
{{ .Title }} | ||
{{- if .Draft }}<sup><span class="entry-isdraft"> [draft]</span></sup>{{- 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 := .Params.cover.hidden | default site.Params.cover.hiddenInSingle | default site.Params.cover.hidden }} | ||
{{- partial "cover.html" (dict "cxt" . "IsHome" false "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 }} | ||
|
||
{{- if eq .Section "posts" }} | ||
{{- partial "post_footer.html" . }} | ||
{{ 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 (.Param "comments") }} | ||
{{- partial "comments.html" . }} | ||
{{- end }} | ||
</article> | ||
|
||
{{- 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,40 @@ | ||
{{/* modified from https://gist.github.com/lpar/7ded35d8f52fef7490a5be92e6cd6937 */}} | ||
|
||
{{- $pctx := . -}} | ||
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} | ||
{{- $pages := slice -}} | ||
{{- if or $.IsHome $.IsSection -}} | ||
{{- $pages = $pctx.RegularPages -}} | ||
{{- else -}} | ||
{{- $pages = $pctx.Pages -}} | ||
{{- end -}} | ||
{{- $limit := .Site.Config.Services.RSS.Limit -}} | ||
{{- if ge $limit 1 -}} | ||
{{- $pages = $pages | first $limit -}} | ||
{{- end -}} | ||
<feed xmlns="http://www.w3.org/2005/Atom"> | ||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> | ||
<link href="{{ .Permalink }}index.xml" rel="self"/> | ||
<link href="{{ .Permalink }}"/>{{ if not .Date.IsZero }} | ||
<updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }} | ||
<id>{{ .Permalink }}</id>{{ with .Site.Author.name }} | ||
<author> | ||
<name>{{.}}</name>{{ with $.Site.Author.email }} | ||
<email>{{.}}</email>{{end}} | ||
</author>{{end}} | ||
<generator>Hugo -- gohugo.io</generator>{{ range $pages }} | ||
<entry> | ||
{{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title> | ||
<link href="{{ .Permalink }}"/> | ||
<id>{{ .Permalink }}</id>{{ with $.Site.Author.name }} | ||
<author> | ||
<name>{{.}}</name> | ||
</author>{{end}} | ||
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published> | ||
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated> | ||
{{ if .Content }} | ||
{{ `<content type="html"><![CDATA[` | safeHTML }}{{ .Content }}]]></content> | ||
{{ end }} | ||
</entry>{{ end }} | ||
</feed> | ||
|
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,19 @@ | ||
{{/* vimdiff layouts/partials/home_info.html themes/hugo-PaperMod/layouts/partials/home_info.html */}} | ||
|
||
{{- with site.Params.homeInfoParams }} | ||
<article class="home-info"> | ||
{{ if (gt (len .Title) 0) }} | ||
<header class="entry-header"> | ||
<h1>{{ .Title | markdownify }}</h1> | ||
</header> | ||
{{ end }} | ||
{{ if (gt (len .Content) 0) }} | ||
<div class="entry-content"> | ||
{{ .Content | markdownify }} | ||
</div> | ||
{{ end }} | ||
<footer class="entry-footer"> | ||
{{ partial "social_icons.html" site.Params.socialIcons }} | ||
</footer> | ||
</article> | ||
{{- end -}} |
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
Submodule hugo-PaperMod
updated
from 159e96 to 25e5b4