Skip to content

Commit

Permalink
Add last modified date to pages (#1362)
Browse files Browse the repository at this point in the history
Co-authored-by: Ronny Birkeli <[email protected]>
  • Loading branch information
RonnyB71 and Ronny Birkeli authored Jan 8, 2024
1 parent 9c1f4e8 commit 4275654
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadataFormat = "yaml"
pluralizeListTitles = false
preservetaxonomynames = true
enableEmoji = true
enableGitInfo = false
enableGitInfo = true
disableKinds = ["RSS"] # page home section taxonomy taxonomyTerm RSS sitemap robotsTXT 404
ignoreErrors = ["error-remote-getjson"]

Expand Down
3 changes: 3 additions & 0 deletions themes/hugo-theme-altinn/i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ other = "Navigation"

[on-this-page]
other = "On this page:"

[Last-Modified]
other = "Last modified: "
4 changes: 4 additions & 0 deletions themes/hugo-theme-altinn/i18n/nb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ other = "Vis innhold"

[on-this-page]
other = "På denne siden:"


[Last-Modified]
other = "Sist endret: "
12 changes: 7 additions & 5 deletions themes/hugo-theme-altinn/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@
{{- partial "jumbotron.html" . -}}
{{- end -}}

<div class="container pt-2 pt-md-3 pt-lg-5">
<div class="container pt-2 pt-md-3 pt-lg-5">
<div class="adocs-scrollcontainer">
<div class="row">
<div class="col-12 last-modified">{{T "Last-Modified"}}{{ .Page.Lastmod | time.Format ":date_medium" }}</div>
</div>
<div class="row">
<div class="col-sm-12">
{{- partialCached "menu.html" . -}}
Expand All @@ -58,7 +61,7 @@
<div id="overlay"></div>
<div class="a-text">
{{- if not .IsHome -}}
<div id="top-bar">
<div id="top-bar">
<div id="breadcrumbs" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
<span id="sidebar-toggle-span" class="adocs-sidebarToggle">
<a href="#" id="sidebar-toggle" data-sidebar-toggle="">
Expand All @@ -72,7 +75,7 @@
{{- end -}}
{{- template "breadcrumb" dict "page" . "value" .LinkTitle -}}
</span>
</div>
</div>
</div>
{{- end -}}
{{- if .Params.tags -}}
Expand All @@ -81,8 +84,7 @@
<a class="label label-default" href="{{$.Site.BaseURL}}tags/{{ $tag | urlize }}">{{ $tag }}</a>
{{- end -}}
</div>
{{- end -}}

{{- end -}}
<div id="body-inner">
{{- if not .IsHome -}}
{{- if eq .Kind "taxonomy" -}}
Expand Down
3 changes: 3 additions & 0 deletions themes/hugo-theme-altinn/static/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,9 @@ td {
#body #breadcrumbs span.adocs-breadcrumb-divider {
padding: 0 6px;
}
.last-modified {
text-align: right;
}
.copy-to-clipboard {
background-image: url(../images/clippy.svg);
background-position: 50% 50%;
Expand Down

0 comments on commit 4275654

Please sign in to comment.