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

Template blocks #8

Merged
merged 3 commits into from
Apr 25, 2016
Merged

Template blocks #8

merged 3 commits into from
Apr 25, 2016

Conversation

MattWindsor91
Copy link
Member

This small PRQ rearranges the template system to use Go 1.6-style inheritable blocks:

  • There is now a new template base.tmpl which is the main template for every page;
  • base.tmpl still includes header.tmpl and footer.tmpl, but these no longer contain the <html> etc. tags;
  • Each view/controller I could see has been rearranged so that it puts its content into the content block instead of including header and footer;
  • Also fixed a typo on a CSS include.

Obviously, the final website will use a richer inheritance hierarchy than this, but this at least means we're not assembling the <html><body> and </body></html> tags around the page, which made me feel a bit twitchy.

This moves all of the <html></html> out of header and footer into a new
base template, which is now the main template loaded on controllers.

Content can be added into the base template using {{block "content" .}}.

Header and footer are still here for now, but have been reduced to their
non-HTMLy content: footer is currently empty.
@MattWindsor91
Copy link
Member Author

It might be nice to have a utility render this template using the usual base templates function.

@LordAro
Copy link
Member

LordAro commented Apr 25, 2016

Maybe you should write one :)
On 25 Apr 2016 7:56 p.m., "Matt Windsor" notifications@github.com wrote:

It might be nice to have a utility render this template using the usual
base templates function.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#8 (comment)

@ChrisTheBaron ChrisTheBaron merged commit 2f9e94b into development Apr 25, 2016
@ChrisTheBaron ChrisTheBaron deleted the mw-template-blocks branch April 26, 2016 14:43
alyxbb pushed a commit that referenced this pull request May 15, 2024
…flict-resolution

I fucked the merge conflict resolution
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

Successfully merging this pull request may close these issues.

None yet

3 participants