Skip to content

Commit

Permalink
feat: upgrade theme
Browse files Browse the repository at this point in the history
  • Loading branch information
alswl committed Apr 23, 2024
1 parent 0d7680b commit 7d90f08
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 18 deletions.
10 changes: 8 additions & 2 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<!-- https://medium.com/@ardianta/writing-using-typora-on-hugo-based-blog-a1be8500774a -->
{{/* replace
adapter for local / server view images, local using ../../static, and remote use /
https://medium.com/@ardianta/writing-using-typora-on-hugo-based-blog-a1be8500774a

vimdiff layouts/_default/_markup/render-image.html themes/hugo-PaperMod/layouts/_default/_markup/render-image.html

*/}}
{{ if in .Destination "/static/" }}
<!-- 12 is count of ../../static carachers -->
<!-- 12 is count of ../../static characters -->
{{ $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 }} />
Expand Down
19 changes: 14 additions & 5 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<h1>
{{ .Title }}
{{- if and (or (eq .Kind `term`) (eq .Kind `section`)) (.Param "ShowRssButtonInSectionTermList") }}
<a href="index.xml" title="RSS" aria-label="RSS">
{{- 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" />
Expand All @@ -22,6 +23,7 @@ <h1>
</svg>
</a>
{{- end }}
{{- end }}
</h1>
{{- if .Description }}
<div class="post-description">
Expand Down Expand Up @@ -65,12 +67,19 @@ <h1>
{{- end }}

<article class="{{ $class }}">
{{- $isHidden := (site.Params.cover.hidden | default site.Params.cover.hiddenInList) }}
{{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }}
{{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }}
{{- partial "cover.html" (dict "cxt" . "IsSingle" false "isHidden" $isHidden) }}
<header class="entry-header">
<h2>
<h2 class="entry-hint-parent">
{{- .Title }}
{{- if .Draft }}<sup><span class="entry-isdraft">&nbsp;&nbsp;[draft]</span></sup>{{- end }}
{{- 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) }}
Expand Down
15 changes: 11 additions & 4 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
<article class="post-single">
<header class="post-header">
{{ partial "breadcrumbs.html" . }}
<h1 class="post-title">
<h1 class="post-title entry-hint-parent">
{{ .Title }}
{{- if .Draft }}<sup><span class="entry-isdraft">&nbsp;&nbsp;[draft]</span></sup>{{- end }}
{{- 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">
Expand All @@ -24,8 +31,8 @@ <h1 class="post-title">
</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) }}
{{- $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 }}
Expand Down
11 changes: 5 additions & 6 deletions layouts/partials/home_info.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
{{/* vimdiff layouts/partials/home_info.html themes/hugo-PaperMod/layouts/partials/home_info.html */}}
{{/*
no first-entry
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 }}
{{ partial "social_icons.html" (dict "align" site.Params.homeInfoParams.AlignSocialIconsTo) }}
</footer>
</article>
{{- end -}}
2 changes: 1 addition & 1 deletion themes/hugo-PaperMod
Submodule hugo-PaperMod updated 62 files
+1 −1 .github/ISSUE_TEMPLATE/bug_report.md
+1 −1 .github/ISSUE_TEMPLATE/config.yml
+0 −7 .github/ISSUE_TEMPLATE/new-blank-issue.md
+7 −0 .github/ISSUE_TEMPLATE/proposal.md
+0 −17 .github/stale.yml
+7 −10 .github/workflows/gh-pages.yml
+1 −1 LICENSE
+20 −9 README.md
+3 −5 assets/css/common/main.css
+7 −3 assets/css/common/post-entry.css
+22 −18 assets/css/common/post-single.css
+5 −4 assets/css/common/profile-mode.css
+1 −1 assets/css/core/license.css
+2 −0 assets/css/core/reset.css
+2 −2 assets/css/core/theme-vars.css
+6 −0 assets/css/core/zmedia.css
+0 −63 assets/css/hljs/an-old-hope.min.css
+24 −0 assets/css/includes/chroma-mod.css
+86 −0 assets/css/includes/chroma-styles.css
+2 −2 assets/css/includes/scroll-bar.css
+6 −1 assets/js/fastsearch.js
+3 −3 assets/js/fuse.basic.min.js
+0 −44 assets/js/highlight.min.js
+1 −1 assets/js/license.js
+33 −0 i18n/cs.yaml
+33 −0 i18n/el.yaml
+2 −2 i18n/fr.yaml
+9 −3 i18n/it.yaml
+2 −2 i18n/ja.yaml
+33 −0 i18n/no.yaml
+33 −0 i18n/pa.yaml
+2 −2 i18n/pl.yaml
+33 −0 i18n/pnb.yaml
+33 −0 i18n/ro.yaml
+33 −0 i18n/sk.yaml
+33 −0 i18n/sw.yaml
+33 −0 i18n/th.yaml
+9 −1 i18n/vi.yaml
+28 −3 layouts/_default/archives.html
+4 −0 layouts/_default/baseof.html
+14 −5 layouts/_default/list.html
+59 −27 layouts/_default/rss.xml
+1 −1 layouts/_default/search.html
+11 −4 layouts/_default/single.html
+1 −1 layouts/partials/breadcrumbs.html
+9 −6 layouts/partials/cover.html
+1 −1 layouts/partials/edit_post.html
+13 −4 layouts/partials/footer.html
+5 −18 layouts/partials/head.html
+1 −1 layouts/partials/header.html
+1 −1 layouts/partials/home_info.html
+1 −1 layouts/partials/index_profile.html
+3 −1 layouts/partials/post_meta.html
+69 −45 layouts/partials/share_icons.html
+4 −3 layouts/partials/social_icons.html
+181 −5 layouts/partials/svg.html
+47 −0 layouts/partials/templates/_funcs/get-page-images.html
+20 −13 layouts/partials/templates/opengraph.html
+8 −3 layouts/partials/templates/schema_json.html
+24 −19 layouts/partials/templates/twitter_cards.html
+2 −2 layouts/partials/toc.html
+1 −1 theme.toml

0 comments on commit 7d90f08

Please sign in to comment.