Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
Added Hugo Git Info Variables for Git Data
Browse files Browse the repository at this point in the history
  • Loading branch information
PriyanshuRj committed Oct 7, 2022
1 parent 146e830 commit 8ce9743
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion config/_default/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ canonifyURLs: true
disableAliases: true
disableHugoGeneratorInject: true
enableEmoji: true
enableGitInfo: false
enableGitInfo: true
enableRobotsTXT: true
languageCode: en
paginate: 7
Expand Down
13 changes: 11 additions & 2 deletions hugo_stats.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
{
"htmlElements": {
"tags": [
"?xml",
"a",
"article",
"atom:link",
"atsign",
"blockquote",
"body",
"br",
"button",
"channel",
"circle",
"code",
"copyright",
"created",
"description",
"div",
"em",
"email",
"emoji",
"footer",
"form",
"generator",
"guid",
"h1",
"h2",
"h3",
Expand All @@ -30,6 +37,8 @@
"iframe",
"img",
"input",
"item",
"language",
"li",
"line",
"link",
Expand All @@ -41,7 +50,9 @@
"p",
"path",
"pre",
"pubdate",
"request",
"rss",
"script",
"shared",
"sita",
Expand Down Expand Up @@ -284,8 +295,6 @@
"4-build-at_javaat_client",
"4-create-an-atplatform-app",
"4-notification-log",
"GitLink",
"GithubLink",
"TableOfContents",
"a-account-creation",
"a-assignment-of-static-ip",
Expand Down
2 changes: 2 additions & 0 deletions layouts/docs/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ <h2>{{ .Title }}</h2>
{{ end -}}
{{ partial "main/footer.html"}}
{{ partial "main/docs-navigation.html" . }}
<p>Last updated on {{ .GitInfo.AuthorDate }}</p>
<p> By {{ .GitInfo.AuthorName }} on <a href='https://github.com/atsign-foundation/docs.atsign.com/commit/{{ .GitInfo.AbbreviatedHash }}'>{{ .GitInfo.AbbreviatedHash }}</a></p>
<!--
{{ if not .Site.Params.options.collapsibleSidebar -}}
{{ partial "main/docs-navigation.html" . }}
Expand Down
2 changes: 2 additions & 0 deletions layouts/docs/root.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ <h2>{{ .Title }}</h2>
{{ end -}}
{{ partial "main/footer.html"}}
{{ partial "main/docs-navigation.html" . }}
<p>Last updated on {{ .GitInfo.AuthorDate }}</p>
<p> By {{ .GitInfo.AuthorName }} on <a href='https://github.com/atsign-foundation/docs.atsign.com/commit/{{ .GitInfo.AbbreviatedHash }}'>{{ .GitInfo.AbbreviatedHash }}</a></p>
<!--
{{ if not .Site.Params.options.collapsibleSidebar -}}
{{ partial "main/docs-navigation.html" . }}
Expand Down
3 changes: 3 additions & 0 deletions layouts/docs/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,16 @@ <h2>{{ .Title }}</h2>
</div>
{{ partial "main/footer.html"}}
{{ partial "main/docs-navigation.html" . }}
<p>Last updated on {{ .GitInfo.AuthorDate }}</p>
<p> By {{ .GitInfo.AuthorName }} on <a href='https://github.com/atsign-foundation/docs.atsign.com/commit/{{ .GitInfo.AbbreviatedHash }}'>{{ .GitInfo.AbbreviatedHash }}</a></p>
<!--
{{ if not .Site.Params.options.collapsibleSidebar -}}
{{ partial "main/docs-navigation.html" . }}
{{ else -}}
<div class="my-n3"></div>
{{ end -}}
-->

</main>
</div>
{{ end }}
37 changes: 9 additions & 28 deletions layouts/partials/main/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<div class="footer-logo">
{{ $image := resources.Get "img/branding/dark/atsign-dark.png" }}
{{ with $image }}
<img class="toggle-light" src="{{ .RelPermalink }}" width="124em">
<img class="toggle-light" src="{{ .RelPermalink }}" width="124em">
{{ end }}

{{ $image := resources.Get "img/branding/light/atsign-light.svg" }}
{{ with $image }}
<img class="toggle-dark" src="{{ .RelPermalink }}" width="124em">
<img class="toggle-dark" src="{{ .RelPermalink }}" width="124em">
{{ end }}
</div>
<div class="footer-terms">
Expand All @@ -30,62 +30,43 @@
<p>
For general inquiries, email us: <a href="mailto:info@atsign.com">info@atsign.com</a>
</p>
<p id="GithubLink">
</p>
<p id="GitLink"></p>
</div>
<div class="footer-social">
<a target="_blank" href="https://github.com/atsign-foundation">
{{ $image := resources.Get "img/footer-logos/github.png" }}
{{ with $image }}
<img src="{{ .RelPermalink }}" height="48em">
<img src="{{ .RelPermalink }}" height="48em">
{{ end }}
</a>
<a target="_blank" href="https://wavi.ng/@wavi">
{{ $image := resources.Get "img/footer-logos/wavi.webp" }}
{{ with $image }}
<img src="{{ .RelPermalink }}" height="48em">
<img src="{{ .RelPermalink }}" height="48em">
{{ end }}
</a>
<a target="_blank" href="https://linkedin.com/company/atsigncompany/">
{{ $image := resources.Get "img/footer-logos/linkedin.webp" }}
{{ with $image }}
<img src="{{ .RelPermalink }}" height="48em">
<img src="{{ .RelPermalink }}" height="48em">
{{ end }}
</a>
<a target="_blank" href="https://twitter.com/atsigncompany">
{{ $image := resources.Get "img/footer-logos/twitter.webp" }}
{{ with $image }}
<img src="{{ .RelPermalink }}" height="48em">
<img src="{{ .RelPermalink }}" height="48em">
{{ end }}
</a>
<a target="_blank" href="https://www.youtube.com/c/AtsignCo">
{{ $image := resources.Get "img/footer-logos/youtube.webp" }}
{{ with $image }}
<img src="{{ .RelPermalink }}" height="48em">
<img src="{{ .RelPermalink }}" height="48em">
{{ end }}
</a>
<a target="_blank" href="https://discord.gg/55sHTQFxfz">
{{ $image := resources.Get "img/footer-logos/discord.png" }}
{{ with $image }}
<img src="{{ .RelPermalink }}" height="48em">
<img src="{{ .RelPermalink }}" height="48em">
{{ end }}
</a>
</div>
</div>
<script>
async function fetchCommit() {

fetch('https://api.github.com/repos/atsign-foundation/docs.atsign.com/commits?per_page=1').then(data => {
return data.json();
})
.then(commit => {
var element = document.getElementById("GithubLink");
var element2 = document.getElementById("GitLink");
var date = new Date(commit[0].commit.committer.date);
element2.innerHTML = `By ${commit[0].commit.author.name} in <a href='https://github.com/atsign-foundation/docs.atsign.com/commit/${commit[0].sha}'>${commit[0].sha.slice(0,7)} </a>`
element.innerHTML = "Last Updated on " + date.getFullYear() + "-" +(date.getMonth()+1) + "-" + (date.getDay()+1);
});
}
fetchCommit();
</script>
</div>
2 changes: 2 additions & 0 deletions layouts_docs/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ <h2>{{ .Title }}</h2>
{{ end -}}
{{ partial "main/footer.html"}}
{{ partial "main/docs-navigation.html" . }}
<p>Last updated on {{ .GitInfo.AuthorDate }}</p>
<p> By {{ .GitInfo.AuthorName }} on <a href='https://github.com/atsign-foundation/docs.atsign.com/commit/{{ .GitInfo.AbbreviatedHash }}'>{{ .GitInfo.AbbreviatedHash }}</a></p>
<!--
{{ if not .Site.Params.options.collapsibleSidebar -}}
{{ partial "main/docs-navigation.html" . }}
Expand Down
2 changes: 2 additions & 0 deletions layouts_docs/_default/root.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ <h2>{{ .Title }}</h2>
{{ end -}}
{{ partial "main/footer.html"}}
{{ partial "main/docs-navigation.html" . }}
<p>Last updated on {{ .GitInfo.AuthorDate }}</p>
<p> By {{ .GitInfo.AuthorName }} on <a href='https://github.com/atsign-foundation/docs.atsign.com/commit/{{ .GitInfo.AbbreviatedHash }}'>{{ .GitInfo.AbbreviatedHash }}</a></p>
<!--
{{ if not .Site.Params.options.collapsibleSidebar -}}
{{ partial "main/docs-navigation.html" . }}
Expand Down
2 changes: 2 additions & 0 deletions layouts_docs/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ <h2>{{ .Title }}</h2>
</div>
{{ partial "main/footer.html"}}
{{ partial "main/docs-navigation.html" . }}
<p>Last updated on {{ .GitInfo.AuthorDate }}</p>
<p> By {{ .GitInfo.AuthorName }} on <a href='https://github.com/atsign-foundation/docs.atsign.com/commit/{{ .GitInfo.AbbreviatedHash }}'>{{ .GitInfo.AbbreviatedHash }}</a></p>
<!--
{{ if not .Site.Params.options.collapsibleSidebar -}}
{{ partial "main/docs-navigation.html" . }}
Expand Down

0 comments on commit 8ce9743

Please sign in to comment.