Week 2 - Astro.js
1/26
2-1 Astro.js + Starlight
Section titled “2-1 Astro.js + Starlight” Homework (before class)
- ✅ Complete DevLog 1-3 and post link on Moodle.
- Start (if you have not already completed) the Git Milestones
- Read 📚 / Watch 🎬 the Astro Starlight article up to “Tutorial”
- Watch 🎬 Heydon Pickering Why is everything binary?
In-class
- Instructor: Introduce Astro Starlight and benefits (e.g. markdown accessibility, and modules and components, which make code D.R.Y.)
- Class: Complete DevLog in-class/at home.
DevLog 2-1
Section titled “DevLog 2-1”Create an Astro Starlight DevLog site
Section titled “Create an Astro Starlight DevLog site”Follow the Astro Starlight tutorial to create a JAMstack website with Astro.js. You will use this site to post DevLog entries to record your work throughout the semester.
- Fork an Astro Starlight site and update project structure.
- Publish Astro Starlight using Github Actions ✏️ LINK_TO_YOUR_REPO
- Add custom CSS to your theme
- Import and use an Astro component
- Continue customizing your site using the Starlight Docs and ✏️ explain what you did.
- Add content into:
devlog-1-3.mdx(the DevLog from the previous week) - Add this file and
devlog-2-1.mdxfor today, and add content. - Watch 🎬 Heydon Pickering Why is everything binary?. Post a reading response in the 2-1 DevLog per information in the Assignments.
- Write a reflection explaining what you did learned in this DevLog. Link to sources.
- Publish it and turn it in by posting the direct link to this DevLog on Moodle
2-2 Astro.js
Section titled “2-2 Astro.js” Homework (before class)
- ✅ Complete DevLog 2-1 and post link on Moodle.
In-class
- Instructor: Introduce Astro.js Build a Blog Tutorial and show examples
- Class: Start DevLog 2-3, continue in-class/at home.
2-3 Astro.js
Section titled “2-3 Astro.js” Homework
- ✅ Complete (at least) steps 1-5 from DevLog 2-3
In-class
- Instructor: Discuss Tailwind and Astro themes
- Class: Complete DevLog in-class/at home.
DevLog 2-3
Section titled “DevLog 2-3”Create an Astro blog site
Section titled “Create an Astro blog site”Follow Astro’s Build a Blog tutorial to create a modular website using component-based design. Compare your finished blog site to the tutorial example as needed. Copy and paste then complete the following objectives in in your DevLog (Instructions).
- Create a new Astro site and publish it on Netlify1. Write the formatted command ✏️ here using
backticksso you remember it. - Create pages (
.astrofiles) and blog posts (.mdfiles) using frontmatter and file-based routing2. - Use Astro components (also
.astrofiles!) to reuse common code across your website3. - Create reusable layout components using
<slot />andAstro.propsto inject child content4. - Create layout components for markdown files. Share anything that was difficult so far ✏️ here.
- Display a dynamically generated list of posts on your Blog page5.
- Use Dynamic page routing with
getStaticPaths()to specify and store static routes during build, and pass each page its own props. - Install Astro Preact integration. Use a
client:directive for hydration on a UI framework component6. 🔥 Challenge: Already have experience with a UI library? Try to integrate that one instead! For example, I used Svelte. - Modify your site design and content as if you were transitioning to Astro.js from an existing Wordpress site/blog. Duplicate the design, content, structure from the other site (not entirely, mind you, since this is just a mockup). Publish your blog site and put the url ✏️ here.
- Copy and paste these instructions into
devlog-2-3.mdxin your own DevLog. Publish it. Then turn it in by posting a direct link to the page on Moodle.