-
Notifications
You must be signed in to change notification settings - Fork 19
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
🛫 Add landing page blocks to book theme #531
Conversation
🦋 Changeset detectedLatest commit: a694d61 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
1a8566b
to
53971a1
Compare
ea51487
to
1290c41
Compare
I think this is ready for review. It's not 100% mergeable because I haven't gone through and checked with a fine-toothed comb. But it does work, and seems pretty simple |
2ba0913
to
e966bc8
Compare
05e2bc3
to
0c0bdc9
Compare
I think this is a nice way to design the pages via blocks. Could you add here (or linked in another PR) documentation that shows how you'd control each of the things you're adding here? E.g., at a minimum, example syntax or a page that shows off each type with example code as well. One thought on blocks vs. directives. The main benefit I see for directives is that it gives us a more expressive way to customize blocks if they are more complex. E.g., you could have Note that @stevejpurves 's suggestion to add inline options to blocks might make this less of a big deal if it were implemented. |
There are a couple of reasons for opting for blocks over directives. Firstly, I think landing page blocks should be top level, and that constraint is shared by blocks. Secondly, authoring MyST that may be verbose inside key value options I think will feel error prone (YAML indentation etc.), and awkward. I explicitly also do not want to add new AST types just for landing pages, as that increases the nodes that we have to talk about in our spec. To me, landing pages are a Web-only feature rather than a core part of a MyST document. My hope is that the syntax does become nicer, e.g. |
@choldgraf yes, docs and a demo are next in the todo! |
That's a compelling enough rationale that I think it's safe to try and see what the UX is like once it's in practice. We can try this on the jupyter book docs and we'll also get feedback from deploying this for a few communities. BTW - I linked two related issues from the book theme. This is actually a long-requested feature in jupyter book, it was being tracked in the book theme repo so it didn't get transferred over |
There are some nuances in these features that I'd like to discuss. The Another approach would be to have two button renderers, and switch between them in CSS according to the screen size. We could also use media queries for this, but this usually means that we end up with a FOUC-like transition on page load, which is not great. |
8083e03
to
4ac43bf
Compare
I evaluated using these blocks on a Pythia landing page mockup based upon projectpythia-mystmd/projectpythia-mystmd.github.io#7 I wonder whether we should distinguish between header and content sections. The larger first-paragraph in https://tailwindui.com/components/marketing/sections/content-sections seems quite nice, e.g. I found that the automatic CTA I also observed that the way that I noticed that Pythia have a lot of long hero sections. We should think about how to handle those if they should have multiple buttons? It does feel like an anti-pattern, though. In this PR, I've not tackled how to handle the frontmatter-declared title and subtitle. That needs some thought! |
67e2c9b
to
0cb1975
Compare
4ac43bf
to
aa04e05
Compare
@agoose77 What is your workflow you use for updating the theme (this branch), and then testing it in the cryocloud-landing-demo repo? EDIT: Found this, going to try it. |
Looks like, currently, there are still only these themes:
So, looks like the main changes here are to |
Trying to load that site with |
Then ending up with:
(This is with |
Just confirming that you've also found the theme local workflow docs! |
Yes, thanks! That's what I've been following. |
@stefanv I think you've discovered the workflow:
Something to note: @stefanv let's touch base with a call if you are still stuck! |
efabe58
to
360c04f
Compare
This means we might pull out the "wrong" heading if users incorrectly format their markup
360c04f
to
7f2bcb9
Compare
This is great, thank you @agoose77! I thought the snippet from the PR description was insightful for and helpful to people who want to use this. Is there a place to document all these building blocks? |
@stefanv thanks! The myst docs will soon ship some language on this :) |
Cool, happy to help review that PR. |
Overview
This PR is an implementation of an MVP for landing page blocks to the book theme. It is being driven by the Product and Services team at 2i2c, which is tracking the work under 2i2c-org/infrastructure#5482
The goal here is to allow communities to opt-in to welcoming their audience on the home page. The design requirements for the landing page are therefore different to regular page routes. This PR follows some scoping work to figure out what a potential design might look like. The exploration process can be viewed by following the chain of issues in the 2i2c infrastructure issue above.
An example website with the proper metadata (and patched theme deployment) can be found at https://2i2c.org/cryocloud-landing-demo/.
Block Types
split-image
— a hero heading with anobject-fit
image cover, supporting body, links, and subtitle.centered
— a heading with optional subtitle, links, and body that is centered on the pagejustified
— a heading with optional subtitle, links, and body that is left-justified on the pagelogo-cloud
— a small enhancement upon a CSS grid that centers the text and adds asemibold
font styleDesign Points
Questions for Reviewers
h1
in the split-image card from being swallowed? I know that this is already an active discussion topic.Screenshots
Related