Commit 40a8705a authored by Henk Verlinde's avatar Henk Verlinde
Browse files

feat: add last modified date as an option

parent 9a9f37b3
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -23,13 +23,29 @@ h4:hover a {
  margin-top: 2.25rem;
}

.edit-page {
.page-footer-meta {
  margin-top: 3rem;
}

.edit-page,
.last-modified {
  font-size: $font-size-sm;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

@include media-breakpoint-up(md) {
  .edit-page,
  .last-modified {
    font-size: $font-size-base;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
  }
}

.edit-page svg {
  margin-right: 0.5rem;
.edit-page svg,
.last-modified svg {
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ repoHost = "GitHub"
docsRepo = "https://github.com/h-enk/doks"
docsRepoBranch = "master"
editPage = false
lastMod = false

[options]
  lazySizes = true
+8 −3
Original line number Diff line number Diff line
@@ -32,9 +32,14 @@
			</nav>
			{{ end -}}
			{{ .Content }}
			<div class="page-footer-meta d-flex flex-column flex-md-row justify-content-between">
				{{ if .Site.Params.lastMod -}}
					{{ partial "main/last-modified.html" . }}
				{{ end -}}
				{{ if .Site.Params.editPage -}}
					{{ partial "main/edit-page.html" . }}
				{{ end -}}
			</div>
			{{ partial "main/docs-navigation.html" . }}
			<!--
			{{ if not .Site.Params.options.collapsibleSidebar -}}
+6 −0
Original line number Diff line number Diff line
<!--
  Returns formatted date.
  Usage: partial "docs/date" (dict "Date" .Date "Format" .Site.Params.BookDateFormat)
-->
{{ $format := default "January 2, 2006" .Format -}}
{{ return (.Date.Format $format) -}}
 No newline at end of file
+3 −8
Original line number Diff line number Diff line
@@ -10,18 +10,13 @@
{{ end }}

{{ $contentPath := print .Site.Params.docsRepo $editPath .Site.Params.docsRepoBranch "/content/" }}
{{ $url := print $contentPath .Lang "/" $filePath }}

{{ $url := print $contentPath $filePath }}

{{ if .Site.Params.options.multilingualMode }}
  {{ $url = print $contentPath .Lang "/" $filePath }}
{{ end }}

<p class="edit-page">
<div class="edit-page">
  <a href="{{ $url }}">
    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2">
      <path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path>
    </svg>
    Edit this page on {{ .Site.Params.repoHost }}
  </a>
</p>
</div>
Loading