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

Refactor templates and partials to use baseof template #1115

Merged
merged 12 commits into from Jun 1, 2019

Conversation

Projects
None yet
3 participants
@rhewett
Copy link
Contributor

commented May 31, 2019

Purpose

This PR updates the layout templates and partials to use the Hugo baseof template and the block pattern.

Motivation

I am doing a ton of local customization on the site I am building and updating 14-16 separate templates (and one pseudo-template, the widget_page partial) to modify header and navbar behavior was going to introduce bugs. At the same time, it would make it difficult for me to keep my theme version up to date with any upstream modifications.

I quickly realized that it was better to centralize most of the layout template boilerplate first, using baseof, but to avoid the previously mentioned fragmentation issue, I figured I would submit these changes back to the project first.

Comments

  • I scanned the documentation and did not find anything that needed updating. If I missed something, I am happy to update it.
  • The docs templates and docs_layout partial threw a bit of a wrench in the gears on this because of the way the copyright footer is handled in that. As such, docs do not use the baseof template.
  • I did my best to preserve all behavior. As far as I can tell, there should be no changes to any rendering.
  • I deliberately renamed and removed some of the partials to make any issues more obvious. The site_* partials contain the site boilerplate (meta data, JS, etc). I introduced custom_* partials to make it cleaner to locally introduce new components without having to override (and copy) the entire parent partial.
@StefanoCecere

This comment has been minimized.

Copy link
Contributor

commented May 31, 2019

sounds very good, to me! thank you!

@gcushen gcushen merged commit 19c8371 into gcushen:master Jun 1, 2019

2 of 5 checks passed

Header rules No header rules processed
Details
Pages changed 68 new files uploaded
Details
Redirect rules No redirect rules processed
Details
Mixed content No mixed content detected
Details
deploy/netlify Deploy preview ready!
Details

gcushen added a commit that referenced this pull request Jun 1, 2019

refactor: pages as blocks of a base template
Refactor pages as blocks of a base template rather than not using a base template and directly including all necessary elements on each page.

May make Academic more modular and maintainable whilst making it easier for users to apply advanced customizations.

See https://gohugo.io/templates/base/#define-the-base-template

Close #634
Close #1115
@gcushen

This comment has been minimized.

Copy link
Owner

commented Jun 1, 2019

@rhewett thanks for your contribution :)

@rhewett

This comment has been minimized.

Copy link
Contributor Author

commented Jun 1, 2019

@gcushen, no problem. I missed the open issue on it, my bad!

This may constitute a breaking change from 4.3, for anyone that has local layouts, so the upgrade docs should be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.