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

Content-collections-v5 #33

Open
wants to merge 4 commits into
base: content-collections
Choose a base branch
from

Conversation

sarah11918
Copy link
Member

This updates the content-collections branch of the tutorial for v5 (beta).

It will work as expected for v5, and can be updated to stable at any time, but is not important to do so immediately.

Copy link

@ArmandPhilippot ArmandPhilippot left a comment

Choose a reason for hiding this comment

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

You did well to send me the link to this PR! I don't know how, but it seems I skipped a step ("Add client-side interactivity" in "Back on dry land")... I just noticed it when I cloned your branch and checked out the files.

I noticed two Typescript errors in src/components/ThemeIcon.astro, I can't add suggestions since the file is not updated:

  • l44: because of return localStorage.getItem("theme"); the value is either a string or null and we get a Typescript error line 58 (setItem). So either we add an if before l58 or we return a default value in l44 (e.g. ?? "light").
  • l68-69: we get Object is possibly 'null', so we need a ? on l70 (?.addEventListener("click", handleToggleClick);)

Do you want me to create a PR for the tutorial in docs?


Sorry for the mess here, I edited multiple time while I was doing the tutorial again... 👀

  1. So I continued the tutorial where I left off earlier to see if I missed anything else... and it seems I added the types in individual steps but I forgot to add them in some Final code sample/Code check-in snippets...

  2. Okay it's weird, I didn't skipped this step! When I follow the tutorial I don't have Typescript errors on ThemeIcon.astro... So I don't know if what I said before is useful... 😅

  3. Tutorial done! 🎉 So except this weird thing, we're good and the code here seems to match the tutorial!


One last question, should the content-layer branch exist or should we use content-collections in the docs?
At the end of the tutorial we have a broken link: https://5-0-0-beta.docs.astro.build/en/tutorial/6-islands/4/ > "see the Content Collections branch of the tutorial repo" targets https://github.com/withastro/blog-tutorial-demo/tree/content-layer

src/pages/rss.xml.js Outdated Show resolved Hide resolved
@sarah11918
Copy link
Member Author

sarah11918 commented Nov 30, 2024

Thanks for this! Please make a PR to this PR branch and I'll update this with all your changes as necessary! (A little tricky because I can't merge this one until Tuesday)

@ArmandPhilippot
Copy link

Done in #34
It is now slightly different from the doc since I have not updated this part having no Typescript errors while doing the tutorial... which is weird. Should we also update there to be consistent?

@sarah11918
Copy link
Member Author

@ArmandPhilippot Absolutely! Please update the docs! And thank you!

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.

2 participants