Skip to content

Commit

Permalink
Merge pull request #168 from dholbach/add-bottom-links
Browse files Browse the repository at this point in the history
add option to add links to the footer of the page
  • Loading branch information
zjedi authored Feb 21, 2024
2 parents 24f402e + 1a2693c commit 2d94f74
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 1 deletion.
17 changes: 16 additions & 1 deletion assets/css/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ a.fn-item {
color: var(--sticky-menu-text-color);
}

/* Bottom Icons */
/* Footer Icons */
.icons {
ol {
padding-left: 0;
Expand All @@ -284,3 +284,18 @@ a.fn-item {
display: inline-block;
}
}

/* Footer Links */
.site-footer .links {
text-align: center;

ol {
list-style-type: none;
list-style-position: inside;
padding-left: 0;
}

li {
margin-left: unset;
}
}
3 changes: 3 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ title = "Jane Doe - Nutrition Coach & Chef Consultant"
# Show contact icons for email/phone (if specified) in the footer of the page
showContactIcons = false

# Show links indicated with footer_menu and footer_menu_title in the footer of the page
showFooterLinks = false

[params.meta]
keywords = "some, keywords, for, seo, you, know, google, duckduckgo, and, such"

Expand Down
7 changes: 7 additions & 0 deletions exampleSite/content/homepage/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
footer_menu_title: License
footer_menu: true
detailed_page_path: /license/
detailed_page_homepage_content: false
weight: 91
---
24 changes: 24 additions & 0 deletions exampleSite/content/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Hugo Scroll License
---

The MIT License (MIT)

Copyright (c) 2020 Jan Raasch

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17 changes: 17 additions & 0 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
{{ $headless := .Site.GetPage "/homepage" }}
{{ $sections := $headless.Resources.ByType "page" }}
{{ $sections := cond .Site.BuildDrafts $sections (where $sections "Draft" "==" false) }}

<footer class="site-footer">
<div class="inner">
{{ if ne .Site.Params.footer.showFooterLinks false }}
<section class="links">
<ol>
{{ range where $sections ".Params.footer_menu" "eq" true }}
<li>
<a href="{{ .Params.detailed_page_path }}">{{ .Params.footer_menu_title }}</a>
</li>
{{ end }}
</ol>
</section>
<hr />
{{ end }}

{{ if ne .Site.Params.footer.showContactIcons false }}
{{ with .Site.Params.contact }}
<section class="icons">
Expand Down

0 comments on commit 2d94f74

Please sign in to comment.