Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up footer.html partial #24

Closed
2 of 3 tasks
dencold opened this issue Sep 14, 2016 · 1 comment
Closed
2 of 3 tasks

Clean up footer.html partial #24

dencold opened this issue Sep 14, 2016 · 1 comment

Comments

@dencold
Copy link
Owner

dencold commented Sep 14, 2016

Currently the footer partial looks like this:

<footer class="site-footer clearfix">
  {{if ne .Site.Params.hideCopyright true}}
  <section class="copyright">
    <a href="">{{.Site.Title}}</a> {{.Site.Copyright}}
  </section>
  {{end}}

  {{if ne .Site.Params.hideHUGOSupport true}}
  <section class="poweredby">
    Proudly generated by <a class="icon-hugo" href="http://gohugo.io">HUGO</a>, with <a class="icon-theme" href="https://github.com/dencold/hasper">Hasper</a> theme.
  </section>
  {{end}}
</footer>

</div>

<script type="text/javascript" src="{{.Site.BaseURL}}js/jquery.js"></script>
<script type="text/javascript" src="{{.Site.BaseURL}}js/jquery.fitvids.js"></script>
<script type="text/javascript" src="{{.Site.BaseURL}}js/index.js"></script>

{{if .Site.Params.customFooterPartial}}
{{partial .Site.Params.customFooterPartial .}}
{{end}}

</body>
</html>

When this partial is used in templates, it ends up looking something like this:

<!DOCTYPE html>
<html lang="{{.Site.LanguageCode}}">
<head>
  {{partial "head/includes.html" .}}
</head>
<body class="nav-closed">

  {{partial "navigation.html" .}}

 <div class="site-wrapper">

{{$baseurl := .Site.BaseURL}}
{{partial "covers/paging.html" .}}

<main class="content" role="main">
  {{$paginator := .Paginator}}

    {{range $index, $page := $paginator.Pages}}
       {{partial "li.html" .}}
    {{end}}

    {{partial "pagination.html" $paginator}}
</main>

{{partial "footer.html" .}}

Which I am really not a fan of. I like seeing the overall structure of a template and having proper matched closing tags on things like <html> and <body>. What's worse is the <div class="site-wrapper"> depends on a closing </div> tag that is in the footer.html. When you look at that partial, you have no idea what the closing div corresponds to.

Todos:

  • Pull out the "hanging" closing tags and move them up into the actual templates.
  • look into replacing the jquery script calls etc. that are at the bottom of the footer
  • see how the custom script section works from a theme user's perspective.
dencold added a commit that referenced this issue Jan 13, 2017
dencold added a commit that referenced this issue Jan 13, 2017
dencold added a commit that referenced this issue Jan 13, 2017
- this is non-standard and not in the official hugo site params
- addresses #24
@dencold
Copy link
Owner Author

dencold commented Jan 13, 2017

Closing this issue. We now have #29 to track script calls that was mentioned here.

@dencold dencold closed this as completed Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant