Skip to content

Add some showcase snippets #371

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

Conversation

bitjammer
Copy link
Contributor

No description provided.

@tomerd
Copy link
Contributor

tomerd commented Aug 28, 2023

cc @alexandersandberg

@alexandersandberg
Copy link
Member

Thanks, @bitjammer! Nice to finally have some proper snippets. 🎉

The snippets have to be placed in the _data/featured_snippets.yml file at the moment. I would prefer your way of adding swift files to a folder, but my limited Jekyll knowledge gets in the way here. If anyone else knows how to do this, please feel free to help out!

But for now, I think we have to use the above-mentioned data file. Let me know if you want my help with that.

As the code snippets vary in height quite a bit, we will have to remove the fixed height constraint on the snippets box.

This height constraint was initially added to prevent layout shifts on page reload. Whether that's a real issue we need to fix or not though is up for discussion. This is what it will look like now when reloading:

CleanShot.2023-08-28.at.19.52.15.mp4

A possible solution would be to only use snippets with roughly the same line length. Then we could add a fixed height and center the snippets within that box. But this also limits us in what we can feature here.

I'm open to suggestions. Maybe the layout shifts aren't a big deal after all, but the longer snippets do push the rest of the content down below the fold, which might not be ideal.

@bitjammer bitjammer force-pushed the content-improvements-snippets branch from f25e80e to 738f8cb Compare August 28, 2023 18:07
@alexandersandberg
Copy link
Member

@bitjammer We're planning on merging the content improvements branch very soon. Do you think you will have time to take a look at the feedback above? If not, I can take over. Please let me know! 🙂

@alexandersandberg
Copy link
Member

I will merge this as is and make the required changes in the content improvements branch. Thanks for providing these snippets! 🙂

@alexandersandberg alexandersandberg merged commit ce1ddab into swiftlang:content-improvements Sep 5, 2023
@bitjammer bitjammer deleted the content-improvements-snippets branch September 7, 2023 00:17
@bitjammer
Copy link
Contributor Author

Hi @alexandersandberg, sorry I missed your comments!

I'm not sure what to say about whether the snippet layout container should be variable height from a layout perspective. However, being text, the snippet content should be allowed to variable in size so we don't limit our expressiveness here. I can totally see that there are limits to that, though! We wouldn't want them to be too long and generally speaking snippets are encouraged to be as brief as possible. I admit that's not really a precise answer.

Just looking at your video, I don't know if it's as much of a problem that the layout differs slightly on reload. If things were resizing with a dynamic UI, like with a prev/next button, I'd be a bit more concerned.

kaishin added a commit that referenced this pull request Sep 7, 2023
* Update landing page content (#127)
* First pass at the new Getting Started page (#174)
* Adding Getting Started tutorial for SwiftUI / iOS 16. (#185)
* Add data file with items for "Go Further" section (#184)
* Add cli and library getting started guides (#192)
* Getting started tweaks (#208)
* Rename Markdown files to have an `.md` extension. (#209)
* Fix typo (#214)
* Update getting started page layout (#204)
* Add documentation information to Getting Started (#226)
* Add Vapor Getting Started guide (#229)
* Update content-improvments branch per feedback (#244)
* Tweak SwiftUI tutorial (#240)
* Add TSPL Go Further section and resource thumbnails (#227)
* Improve 'Why Swift?' section on landing page (#252)
* Replace Go Further item for advanced String Under The Hood blog post with item for Structures and Classes chapter in TSPL (#254)
* Update landing page layout (#267)
* Link to developer.apple.com from apple use case (#291)
* Smaller landing page changes on content improvements branch (#294)
* Update Go Further section (#300)
* Update icons and placeholder image (#301)
* Improve description of use cases and getting started guides (#304)
* POC: Feature random code snippet on landing page (#303)
* New “Swift is…” and About page copy (#336)
* Move link to A Swift Tour to the Use Cases section (#329)
* Add consistent download section to start and end of each guide (#351)
* Add a new install page, update the download page, and move release yml files into one file. (#310)
* Update navigation for install page (#355)
* Update cli and library getting started guides (#357)
* Content improvement guide updates (#373)
* Add value and reference types article (#377)
* Add some showcase snippets (#371)
* Resolve issue with Red Hat download links (#379)
* Add Info about Scoop for Windows install page (#382)

---------

Co-authored-by: Alexander Sandberg <[email protected]>
Co-authored-by: Paul Hudson <[email protected]>
Co-authored-by: James Dempsey <[email protected]>
Co-authored-by: tomer doron <[email protected]>
Co-authored-by: Dave Verwer <[email protected]>
Co-authored-by: Tim Condon <[email protected]>
Co-authored-by: Max Desiatov <[email protected]>
Co-authored-by: Mishal Shah <[email protected]>
Co-authored-by: AG <[email protected]>
Co-authored-by: Ted Kremenek <[email protected]>
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.

3 participants