Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Rework the default template for a better first experience #243

Merged
merged 11 commits into from
Nov 16, 2021
Merged

Conversation

kjellr
Copy link
Collaborator

@kjellr kjellr commented Nov 16, 2021

Potentially closes #116.

This PR tackles a couple issues that came up during some recent testing:

  • The initial appearance of the theme is underwhelming — it's just a white screen. We don't have a solution to Starter Content yet, and we don't have any leads on how that experience might be improved soon.
  • The theme lacked distinct index and archive templates, which made editing the homepage index template a little awkward: In the editor you'd see an "Archive Title" block by default when you opened the Site editor, but this block was invisible on the front end.

This PR tackles that by changing our single index.html template into three separate templates:

  1. archive.html: This is identical to today's index.html. It has an Archive Title block.
  2. index.html: Same as today's index.html, but with no Archive Title block. This may be a useful fallback for CPTs or media, where you don't necessarily need an "Archive Title" displayed at the top.
  3. home.html: A new template. This uses a new "Small Dark Header" template part that is designed to bring a little bit of the personality of our page-home.html template into the default blog page. When users install a fresh site, this will be what they see first. This is a way to basically give them some nice "starter content" without actually giving them starter content. I think it's good enough to just close out Add starter content #116.

Screenshots:

(All screenshots taken on fresh install)

Before:

Frontend Editor
Screen Shot 2021-11-16 at 15 28 44 Screen Shot 2021-11-16 at 15 28 36

After:

Frontend Editor
Screen Shot 2021-11-16 at 15 26 20 Screen Shot 2021-11-16 at 15 27 41

@kjellr kjellr requested a review from jffng November 16, 2021 20:35
@kjellr kjellr self-assigned this Nov 16, 2021
@kjellr kjellr changed the title Rework the default template, for a better first experience Rework the default template for a better first experience Nov 16, 2021
@@ -140,7 +140,7 @@
"spacing": {
"small": "max(1.25rem, 5vw)",
"medium": "clamp(2rem, 8vw, calc(4 * var(--wp--style--block-gap)))",
"large": "8rem"
"large": "clamp(4rem, 10vw, 8rem)"
Copy link
Collaborator Author

@kjellr kjellr Nov 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to make this responsive in order to provide more reasonable spacing on small screens. All of our other values were responsive already, and it seems to work just fine in other contexts where this variable is used.

Before After
Screen Shot 2021-11-16 at 15 37 07 Screen Shot 2021-11-16 at 15 36 47

@kjellr
Copy link
Collaborator Author

kjellr commented Nov 16, 2021

With 8530d12, the PR also adds a new block pattern to represent the header used on home.html:

Screen Shot 2021-11-16 at 3 43 37 PM

Copy link
Collaborator

@jffng jffng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all works for me, with one disclaimer: with recent changes to the site editor, I do not know how to access the archive or index templates from the site editor.

That said, they are looking fine on the front-end.

@jffng jffng merged commit 3df95da into trunk Nov 16, 2021
@jffng jffng deleted the fix/templates branch November 16, 2021 23:05
@kjellr
Copy link
Collaborator Author

kjellr commented Nov 17, 2021

Thanks!

This all works for me, with one disclaimer: with recent changes to the site editor, I do not know how to access the archive or index templates from the site editor.

Yeah, my understanding is that either: the template browser sidebar will be added back into 5.9, or the there will be a resolution to WordPress/gutenberg#35994 in time. 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add starter content
2 participants