Skip to content

Commit

Permalink
feat: use config.toml to manage footer links & svgs
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-sid committed Mar 13, 2023
1 parent d8fe3f9 commit b9fbdad
Show file tree
Hide file tree
Showing 6 changed files with 724 additions and 18 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ Don't forget to ⭐️ the repo if you liked this theme!

<a href='https://ko-fi.com/sidharth' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>

## Credits

The social icons are made possible thanks to [Aditya Telange](https://github.com/adityatelange)'s [hugo-PaperMod](https://github.com/adityatelange/hugo-PaperMod) theme.

## License

This theme is released under the MIT license. For more information read the [License](https://github.com/hugo-sid/hugo-blog-awesome/LICENSE.md).
18 changes: 16 additions & 2 deletions assets/sass/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@
@include media-query($on-mobile) {
margin-top: 3em;
}

span.footer_item {
opacity: 0.8;
font-weight: $bold-weight;
font-size: $small-font-size;
}

a.footer_item {
opacity: 0.8;
text-decoration: none;
Expand All @@ -109,12 +111,24 @@
}
}

.footer_copyright {
&_copyright {
font-size: $small-font-size - 1;
margin-top: 3px;
display: block;
color: $gray;
opacity: 0.8;
margin-top: .7rem;
padding: .3rem .95rem;
}

&_social-icons {
a {
text-decoration: none;
margin-right: .31rem;
}
svg {
height: 24px;
width: 24px;
}
}
}

Expand Down
14 changes: 13 additions & 1 deletion exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,16 @@ enableEmoji = true
avatar = "img/avatar.jpg"
intro = "Awesome hugo blog"
name = "Sidharth R"
description = "A fast, minimalistic Hugo theme with light and dark mode support, for running a personal site or blog"
description = "A fast, minimalistic Hugo theme with light and dark mode support, for running a personal site or blog"

[[params.socialIcons]]
name = "github"
url = "https://github.com/hugo-sid"

[[params.socialIcons]]
name = "twitter"
url = "https://twitter.com"

[[params.socialIcons]]
name = "Rss"
url = "index.xml"
23 changes: 8 additions & 15 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
<footer class="footer">
<a class="footer_item" href="/link1">Link 1</a>
<a class="footer_item" href="/link2">Link 2</a>
<span class="footer_item"> © {{ now.Format "2006" }} {{ .Site.Params.author.name }}</span>
<span class="footer_item"> </span>
&nbsp;
<a class="rss" href="/feed.xml">
<svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 512 512" fill="currentcolor">
<title>RSS</title>
<path d="M108.56,342.78a60.34,60.34,0,1,0,60.56,60.44A60.63,60.63,0,0,0,108.56,342.78Z"></path>
<path
d="M48,186.67v86.55c52,0,101.94,15.39,138.67,52.11s52,86.56,52,138.67h86.66C325.33,312.44,199.67,186.67,48,186.67Z">
</path>
<path d="M48,48v86.56c185.25,0,329.22,144.08,329.22,329.44H464C464,234.66,277.67,48,48,48Z"></path>
</svg>
</a>

<div class="footer_social-icons">
{{- partial "socialIcons.html" site.Params.socialIcons -}}
</div>
<small class="footer_copyright">
<a href="https://github.com/hugo-sid/hugo-blog-awesome" target="_blank" rel="noreferrer noopener">Hugo blog awesome</a>
© {{ now.Format "2006" }} {{ .Site.Params.author.name }}.
Powered by <a href="https://github.com/hugo-sid/hugo-blog-awesome" target="_blank" rel="noreferrer noopener">Hugo blog awesome</a>
theme on
<a href="https://gohugo.io" target="_blank" rel="noreferrer noopener">Hugo</a>
<a href="https://gohugo.io" target="_blank" rel="noreferrer noopener">Hugo</a>.
</small>
</footer>
5 changes: 5 additions & 0 deletions layouts/partials/socialIcons.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{- range . }}
<a href="{{ trim .url " " }}" target="_blank" rel="noopener noreferrer me" title="{{ (.title | default .name) | title }}">
{{ partial "svgs/svgs.html" . }}
</a>
{{- end }}
Loading

0 comments on commit b9fbdad

Please sign in to comment.