Skip to content

Commit

Permalink
internal changes to show last modified section
Browse files Browse the repository at this point in the history
  • Loading branch information
1bl4z3r committed Jan 13, 2025
1 parent 5cc24ab commit 19bd342
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
5 changes: 2 additions & 3 deletions content/posts/explaining-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ pin: true
scrolltotop : true
toc : true
ShowLastmod : true
Lastmod : 2024-03-12T20:30:30+05:30
Lastmod : 2025-03-12T20:30:30+05:30
---

## Configuation in `hugo.toml`

`hugo.toml` represents Global configuration for Hermit - V2. It is indicative on the changes to make the theme tailored to your personal preferences.
Expand Down Expand Up @@ -69,7 +68,7 @@ Lastmod : 2024-03-12T20:30:30+05:30
- `pinned` : Display the name of 'Pinned Posts'. If none provided, pinned posts section would be hidden
- `pinnedSVGname` : Specify what icon should be displayed before a pinned post. The icon must be present in `svg.html`
- `descriptionInPosts` : Toggle to show/hide posts' description in list view
- `initialPublish` : Show what should be shown in section of Initial Published. Defaults to "Initial Published on : "
- `initialPublish` : Show what should be shown in section of Initial Published. Defaults to "Initially Published on : "
- `human` : Shows a badge 'BrainMade' on Posts and/or Single pages. Configurable by specifying where badge is to be shown. Read more: [brainmade.org](brainmade.org)
- `noIndex` : When set to true, the page has ___noindex, nofollow, noarchive___ (unless specified by `denyRobots` added to robots meta tag. Else, robots tag will have ___index, follow___ (unless specified by `allowRobots`)
- `footerHideThemeName` : When set to true, links to Hugo and Hermit-V2 would be removed from footer section
Expand Down
2 changes: 1 addition & 1 deletion content/posts/typography.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ tags:
- Demo
- Typography
pin: true
ShowLastmod : false
Lastmod : 2023-08-15T15:36:33+05:30
mathjax : true
---
Expand Down Expand Up @@ -283,7 +284,6 @@ Mermaid
N --> O["End of Newspaper Process"]
O -- If All Newspapers Processed --> P["Cron Job Complete"]
```

[^1]: From : [https://www.markdownguide.org/extended-syntax/#footnotes](https://www.markdownguide.org/extended-syntax/#footnotes)
[^2]: To enable emoji support add `enableEmoji = true` in hugo.toml. [Hugo Docs](https://gohugo.io/quick-reference/emojis/)
[^3]: Hugo's default renderer (Goldmark) cannot render HTML tags by default.
Expand Down
20 changes: 10 additions & 10 deletions layouts/partials/posts_single_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
<p>{{- partial "svg.html" (dict "context" . "name" "posts_single_categories") -}}{{- range . -}}<span class="category"><a href="{{ "categories/" | absLangURL }}{{ . | urlize }}">{{.}}</a></span>{{- end }}</p>
{{- end }}
<p>{{- partial "svg.html" (dict "context" . "name" "posts_single_wordcount") }}{{- .WordCount }} {{- if fileExists "i18n" }} {{ i18n "wordCount" . -}} {{- else -}} Words {{- end }} {{ partial "readTime.html" . -}}</p>
<p>{{- partial "svg.html" (dict "context" . "name" "posts_single_date") }}{{ dateFormat .Site.Params.dateformNumTime .Date.Local -}}
{{- if and (not (eq .Page.Params.ShowLastmod nil)) (.Page.Params.ShowLastmod) -}}
{{- if and .GitInfo .Site.Params.gitUrl -}}
[{{- partial "svg.html" (dict "context" . "name" "posts_single_git_commit") -}}<a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash -}}</a> @ {{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local -}}]
{{- else if not (eq .Lastmod .Date ) -}}
&nbsp;[{{.Site.Params.initialPublish | default "Initial Published on : "}} {{ dateFormat .Site.Params.dateformNumTime .Lastmod.Local -}}]
{{- else -}}
{{ errorf "Lastmod is not found in Page Frontmatter or Lastmod is same as Date" }}
{{- end -}}
{{- end -}}
<p>{{- partial "svg.html" (dict "context" . "name" "posts_single_date") }}{{ dateFormat .Site.Params.dateformNumTime .Date.Local }}
{{ if .Page.Params.ShowLastmod -}}
{{- if and .GitInfo .Site.Params.gitUrl -}}
[{{- partial "svg.html" (dict "context" . "name" "posts_single_git_commit") -}}<a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash -}}</a> @ {{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local -}}]
{{- else if not (eq .Lastmod .Date ) -}}
[{{ .Site.Params.initialPublish | default "Initially Published on : " }} {{ dateFormat .Site.Params.dateformNumTime .Lastmod.Local -}}]
{{- else -}}
{{ errorf "Lastmod is not found in Page Frontmatter or Lastmod is same as Date in %s" .Permalink }}
{{- end -}}
{{- end -}}
</p>

0 comments on commit 19bd342

Please sign in to comment.