{"id":20844445,"url":"https://github.com/CodeStitchOfficial/Beginner-Astro-Starter-Kit","last_synced_at":"2025-05-12T02:31:10.496Z","repository":{"id":239769976,"uuid":"800501168","full_name":"CodeStitchOfficial/Beginner-Astro-v4-Starter-Kit","owner":"CodeStitchOfficial","description":"Astro starter kit featuring CodeStich blocks and heaps of built-in Astro v4 goodies.","archived":false,"fork":false,"pushed_at":"2024-09-14T16:03:25.000Z","size":3427,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-15T01:56:40.017Z","etag":null,"topics":["astro","beginner-friendly","template"],"latest_commit_sha":null,"homepage":"https://beginner-astro-kit.netlify.app/","language":"Astro","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeStitchOfficial.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-14T13:03:26.000Z","updated_at":"2024-09-14T16:03:29.000Z","dependencies_parsed_at":"2024-05-14T14:57:29.185Z","dependency_job_id":"f1383949-b4ec-4db8-ad88-15660ea30457","html_url":"https://github.com/CodeStitchOfficial/Beginner-Astro-v4-Starter-Kit","commit_stats":null,"previous_names":["buckybuck135/astro-kit-less","codestitchofficial/beginner-astro-v4-starter-kit"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeStitchOfficial%2FBeginner-Astro-v4-Starter-Kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeStitchOfficial%2FBeginner-Astro-v4-Starter-Kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeStitchOfficial%2FBeginner-Astro-v4-Starter-Kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeStitchOfficial%2FBeginner-Astro-v4-Starter-Kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeStitchOfficial","download_url":"https://codeload.github.com/CodeStitchOfficial/Beginner-Astro-v4-Starter-Kit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225115193,"owners_count":17423063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astro","beginner-friendly","template"],"created_at":"2024-11-18T02:09:38.328Z","updated_at":"2025-05-12T02:31:10.431Z","avatar_url":"https://github.com/CodeStitchOfficial.png","language":"Astro","funding_links":[],"categories":[],"sub_categories":[],"readme":"  \u003ch3 align=\"center\"\u003eBeginner Astro Starter Kit\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    This beginner kit includes a pre-configured Astro setup, along with five pages filled with CodeStitch components. Everything is ready to go right from the start, offering a fantastic introduction to the advantages of a Static Site Generator, complete with LESS preprocessing. This kit also leverages the power of a few Astro tools such as Astro components, scoped styling and scripting etc.\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://beginner-astro-kit.netlify.app/\" target=\"_blank\"\u003eView Live Result\u003c/a\u003e\n  \u003c/p\u003e\n\n  \u003cp align=\"center\"\u003e\n    Created and maintained by \u003ca href=\"https://github.com/BuckyBuck135\" target=\"_blank\"\u003eBuckyBuck135\u003c/a\u003e\n  \u003c/p\u003e\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Getting Started](#gettingStarted)\n- [Prerequisites](#prerequisites)\n- [Features](#features)\n- [Project Structure](#projectStructure)\n  - [Project Tree](#projectTree)\n  - [Source Files and Folders](#sourceFilesAndFolders)\n- [Expanding the Project](#expandingTheProject)\n  - [Reusing Code](#reusingCode)\n  - [Adding More Pages](#addingMorePages)\n  - [Navigation via Front Matter](#navigationViaFrontMatter)\n  - [Built-in Astro components](#builtinastrocomponents)\n  - [Preloading Images](#preloadingimages)\n  - [CSS](#css)\n  - [Adding View Transitions](#addingViewTransitions)\n  - [Adding Netlify Forms](#netlifyforms)\n\n- [Deployment](#deployment)\n- [Acknowledgments](#acknowledgments)\n- [Conclusion](#conclusion)\n\n\u003ca name=\"overview\"\u003e\u003c/a\u003e\n\n## Overview\n\nThis beginner kit includes a pre-configured \u003ca href=\"https://www.astro.build\"\u003eAstro\u003c/a\u003e environment, which\nallows for repeated components, centralized data and greater room to scale as your clients grow. The kit runs the latest major Astro version, v5.\n\nAn example website has also been provided, with easy substitution of website sections possible through the use of \u003ca href=\"https://codestitch.app/\"\u003eCodeStitch's\nvanilla component library\u003c/a\u003e. This kit aims to get any project off the ground in as little time as possible, with deployment being possible in as little as two\nminutes.\n\n\u003ca name=\"gettingStarted\"\u003e\u003c/a\u003e\n\n## Getting Started\n\n1. At the top right of the \u003ca href=\"https://github.com/ItsEthanH/intermediate-starter-less\"\u003eGitHub Repository\u003c/a\u003e, click the green _Use this template_ button,\n   then click _Create a new repository_.\n2. Follow the instructions to create a new repository, using this repo as a template.\n3. When created, clone the repository to your local machine.\n4. Run `npm install` to install all dependencies.\n5. Run `npm run dev` to start the project and spin up a development server on `localhost:4321`.\n\n\nNext, it is recommended to update `data/client.json` with some new information about this project. Through the power of templating, the\nproject's `\u003chead\u003e` and contact information will automatically be filled out, providing a first peek into some of the benefits of SSGs.\n\nYou can find all of CodeStitches `:root` variables, as well as .cs-topper, .cs-title and .cs-text, within the `root` stylesheet. Feel free to adjust these, or use our Content Flair micro-stitches, to update site-wide styles quickly.\n\n\u003ca name=\"prerequisites\"\u003e\u003c/a\u003e\n\n## Prerequisites\n\nOnly the vanilla web technologies are _required_ before using this kit, with some familiarity with Astro and React-style Components and props also recommended, but not essential. A lot of the leg-work for the non-vanilla technologies has been done for you. If you would like to read up on some of these things, we recommend the following resources:\n\n1. [Astro's Documentation](https://docs.astro.build/en/getting-started/)\n2. [Astro Crash Course in 20 Minutes!](https://www.youtube.com/watch?v=zrPVTf761OI)\n\n\u003ca name=\"features\"\u003e\u003c/a\u003e\n\n## Features\n\n* Runs on Astro v5\n* Leveraging components, props and scoped styles, as demonstrated in `/src/components/Landing.astro` for example\n* Leveraging Astro's built-in components such as `\u003cPicture /\u003e`, as demonstrated in `/src/components/Landing.astro` for example\n* Automatically generates `sitemap-index.xml` and `sitemap-0.xml` thanks to the [Astro Sitemap integration](https://docs.astro.build/en/guides/integrations-guide/sitemap/)\n\n\nThis kit ships the following packages:\n* [LESS](https://www.npmjs.com/package/less) - Less makes a few convenient additions to the CSS language, but you can also simply write standard CSS if you wish.\n* [Astro Sitemap](https://docs.astro.build/en/guides/integrations-guide/sitemap/#_top) - Automatically generates `sitemap-index.xml` and `sitemap-0.xml`. Make sure to replace `https://yourwebsite.com` with your actual site URL in `astro.config.mjs` and `robots.txt`.\n\n* \n\u003ca name=\"projectStructure\"\u003e\u003c/a\u003e\n\n## Project Structure\n\nAstro leverages an opinionated folder layout for your project. Every Astro project root should include the following directories and files:\n* `src/*` - Your project source code (components, pages, styles, scripts etc.)\n* `public/*` - Your non-code, unprocessed assets (fonts, icons, etc.)\n* `package.json` - A project manifest.\n* `astro.config.mjs` - An Astro configuration file. (recommended)\n\n\u003ca name=\"projectTree\"\u003e\u003c/a\u003e\n\n### Project Tree\n```\n.\n├── public/\n|   |—— assets/\n|   |   |—— favicons/\n|   |   |—— fonts/\n|   |   |—— images/\n|   |   └── svgs/\n|   |—— _redirects\n|   |—— robots.txt\n├── src/\n|   ├── assets/\n|   |   └── images/\n|   ├── js/\n|   |   └── nav.js\n|   ├── components/\n│   ├── data/\n│   │   ├── client.json\n│   │   └── navData.json\n│   ├── layouts/\n│   │   └── BaseLayout.astro\n│   ├── pages/\n|   └── styles/\n├── .astro.config.mjs\n└── .postcss.config.cjs\n```\n\n\u003ca name=\"sourceFilesAndFolders\"\u003e\u003c/a\u003e\n\n### Source Files and Folders\n\n#### `public/*`\nThe `public/` directory is for files and assets in your project that do not need to be processed during Astro’s build process. The files in this folder will be copied into the build folder untouched, and then your site will be built.\n\nThis behavior makes `public/` ideal for common assets like images and fonts, or special files such as`_redirects` and `robots.txt`.\n\n- \\_redirects - To configure redirects. Read more on \u003ca href=\"https://docs.netlify.com/routing/redirects/\"\u003eNetlify\u003c/a\u003e\n- content/ - Data to render pages from, such as the blog.\n- robots.txt - Instructions for site crawlers. Make sure to replace `https://yourwebsite.com` with your actual site URL\n\nYou can place CSS and JavaScript in your public/ directory, but be aware that those files will not be bundled or optimized in your final build.\n\n\n#### `src/*`\nThe `src/` folder is where most of your project source code lives. This includes:\n\n* Pages\n* Layouts\n* Astro components\n* UI framework components (React, etc.)\n* Styles (CSS, Sass)\n* Markdown\n\nAstro processes, optimizes, and bundles your src/ files to create the final website that is shipped to the browser. Unlike the static public/ directory, your src/ files are built and handled for you by Astro.\n\n##### `src/assets`\nContains all assets you want optimized by Astro (such as assets used in `\u003cPicture /\u003e` components for example) must be placed in `src`.\n\n`public/assets/images/blog` is where the images uploaded on the CMS will be stored.\n\n##### `src/components`\nComponents are reusable units of code for your HTML pages. These could be Astro components, or UI framework components like React or Vue. It is common to group and organize all of your project components together in this folder.\n\n##### `src/data`\nThis directory contains data files that are accessible within any template throughout the project. \n* `client.js` holds some information you may wish to define for a client. It's important to fill this file out with the correct information for your client, as many HTML meta tags, the sitemap, and robots.txt all use data from this file.\n\n* `navData.json` holds data to create the navigation of your site. See more information in the [navigation via navData.json section](#navigationViaFrontMatter)\n\n\n##### `src/layouts`\nLayouts are Astro components that define the UI structure shared by one or more pages. The `BaseLayout.astro` file acts as a giant wrapper for each individual page, where the content is injected through the `\u003cslot /\u003e `component.\n\n\n##### `src/pages`\nPages are a special kind of component used to create new pages on your site. A page can be an Astro component, or a Markdown file that represents some page of content for your site.\n\n##### `src/styles`\nIt is a common convention to store your CSS, Less or Sass files in a `src/styles` directory.\n\n#### `package.json` and `package-lock.json`\nThe project's manifest. Standard NodeJS package files, containing the dependencies needed for the project to work.\n\n#### `node_modules/*`\nCreated after you run `npm install`. This directory contains the code for all the dependencies that power this kit. It comes as standard with any NodeJS-powered project, much like the `package.json` and `package-lock.json` files. You can safely ignore this directory in your day-to-day work.\n\n\n\u003ca name=\"expandingTheProject\"\u003e\u003c/a\u003e\n\n## Expanding the Project\n\nAimed towards freelancers, this kit was made with scalability and flexibility in mind, suiting a range of websites and client needs. As such, it is your choice\nwhether you'd rather make small tweaks to the existing site, or clear all the page content and build a site all over again. Outlined below are some best\npractices for when it comes to building on top of this kit:\n\n\u003ca name=\"reusingCode\"\u003e\u003c/a\u003e\n\n### Reusing Code\n\nThe main advantage to using an SSG is it brings **components**, popularized by JavaScript-heavy frameworks like React or Vue, to vanilla HTML. As Astro is being used, componentization can be achieved through JSX-like syntax within .astro files.\nComponents are located inside the `src/components` folder.\nFor example, there is a call to action at the bottom of most pages. As the text content or styles don't need to change, `\u003cCTA /\u003e` was\nused. \nTo create a component, create a file in `src/components`. For example `src/components/CTA.astro`. Copy the HTML and CSS over from CodeStitch. Your component is now ready to use.\nImport it in the page where you need it: \n```JSX\n---\nimport BaseLayout from \"../layouts/BaseLayout.astro\";\nimport CTA from \"../components/CTA.astro\";\n---\n```\n\nAnd call it in the JSX markup with `\u003cCTA /\u003e`.\n\nAs the text content or styles don't need to change, a simple component was used. If this wasn't the case, and we wanted the CTA text to change, we'd start to think about passing props to `\u003cCTA /\u003e`.\n\nAn example of passing props to components is `Landing /\u003e`.\n\nIn `about.astro`:\n\n```JS\n---\n// import the component\nimport Landing from \"@components/Landing.astro\";\n---\n\n\u003cBaseLayout\n  // props\n\u003e\n  // Use the \u003cLanding /\u003e component\n  \u003cLanding \n    title=\"About Us\" // pass a `title` prop to the component\n    image={optimizedImage} // pass an 'image' prop to the component\n  /\u003e\n```\n\nIn `Landing.astro`\n```JS\n---\nconst { title } = Astro.props // Destructure the incoming props. Note the `Astrop.props` syntax\n---\n\n\u003ch1 id=\"home-h\"\u003e{title}\u003c/h1\u003e // Consumme the title prop in the JSX markup\n\n```\n\n\u003ca name=\"addingMorePages\"\u003e\u003c/a\u003e\n\n### Adding More Pages\n\nThanks to Astro Navigation, adding new pages is as simple as adding a file to src/pages/ and including it in the `data/navData.json` file:\n\n```\n---\n// optional JavaScript frontmatter\n---\n\n\u003cBaseLayout\n  title=\"Page title for \u003ctitle\u003e and OG tags\"\n  description=\"Description for \u003cmeta\u003e and OG tags\"\n  preloadImg={import(\"/assets/images/imagename.format\")}\n\u003e\n    \u003c!-- Page HTML goes here, without a \u003cmain\u003e wrapper --\u003e\n\u003c/BaseLayout\u003e\n```\n\nStarting from the top, you can see some data enclosed in --- tags. This is known as the page's front matter, which provides additional data to when it comes to\nrendering your pages.\n\n\u003ca name=\"navigationViaFrontMatter\"\u003e\u003c/a\u003e\n\n### Navigation via navData.json\n\nThe header navigation in the project is powered by the `navData.json` file. Each page in the navigation should be included as an item with a `key` property (page title to be displayed) and a `url` property (include a trailing slash). \n\nTo add subpages, include a `children` property. The `children` property should be an array that contains more page objects (i.e., object containing a `key` and `url` property.) If a page has a `children` array property is specified, a dropdown will be created, providing\na Navigation + Dropdown Stitch is being used (see below). Navigations will render in order.\n\n\u003e If you wish to use an alternative Navigation stitch, you are welcome to swap out the .cs-ul-wrapper div in the Stitch for the one in the Starter Kit. This\n\u003e will allow you to continue to reap the benefits of eleventyNavigation. You can find the .cs-ul-wrapper div below\n\n```\n\u003cdiv class=\"cs-ul-wrapper\"\u003e\n  \u003cul id=\"cs-expanded\" class=\"cs-ul\" aria-expanded=\"false\"\u003e\n    {\n      navData.map((entry) =\u003e (\n        \u003cli\n          class:list={[\n            \"cs-li\",\n            { \"cs-dropdown\": entry.children?.length \u003e 0 },\n          ]}\n          tabindex={entry.children?.length \u003e 0 ? \"0\" : \"\"}\n        \u003e\n          \u003ca\n            href={entry.url}\n            class:list={[\n              \"cs-li-link\",\n              { \"cs-active\": Astro.url.pathname === entry.url },\n            ]}\n          \u003e\n            {entry.key}\n          \u003c/a\u003e\n          {entry.children?.length \u003e 0 \u0026\u0026 (\n            \u003cul class=\"cs-drop-ul\"\u003e\n              {entry.children.map((child) =\u003e (\n                \u003cli class=\"cs-drop-li\"\u003e\n                  \u003ca href={child.url} class=\"cs-li-link cs-drop-link\"\u003e\n                    {child.key}\n                  \u003c/a\u003e\n                \u003c/li\u003e\n              ))}\n            \u003c/ul\u003e\n          )}\n        \u003c/li\u003e\n      ))\n    }\n  \u003c/ul\u003e\n\u003c/div\u003e\n```\n\nShould you wish to use your own method of rendering the navigation, you can still take advantage of applying the \"active\" class styles by using a smaller amount of code within the class attribute of the link:\n\n```\n\u003cli class=\"cs-li\"\u003e\n  \u003ca href=\"/about\" class:list={[\"cs-li-link, {\"cs-active\": \"/about/\" === Astro.url.pathname }]}\u003eAbout\u003c/a\u003e\n\u003c/li\u003e\n```\n\nIn this case, if the page slug is \"about\", the .cs-active class will be applied. You're welcome to adjust the page slug value to whatever you require (\"blog\", \"/\", \"services\", etc)\n\nFor dropdowns, you can use a similar philosophy on the parent dropdown's class attribute, checking to see if any of the child pages are active before applying the styles. An example of this is shown below:\n\n```\n\u003cli class=\"nav-link cs-li cs-dropdown\"\u003e\n  \u003cspan class:list={[\"cs-li-link nav-link\",\n    { 'cs-active': '/annapolis-custom-closets/' === Astro.url.pathname },\n    { 'cs-active': '/bowie-custom-closets/' === Astro.url.pathname },\n    { 'cs-active': '/severna-park-custom-closets/' === Astro.url.pathname },\n    { 'cs-active': '/odenton-custom-closets/' === Astro.url.pathname },\n  ]}\u003e\n    Areas Served\n    \u003cimg class=\"cs-drop-icon\" src=\"/assets/images/down.svg\" alt=\"dropdown icon\" width=\"15\" height=\"15\" decoding=\"async\" aria-hidden=\"true\"\u003e\n  \u003c/span\u003e\n  \u003cul class=\"cs-drop-ul\"\u003e\n    \u003cli class=\"cs-drop-li\"\u003e\n      \u003ca href=\"/annapolis-custom-closets\" class=\"cs-drop-link\"\u003eAnnapolis\u003c/a\u003e\n    \u003c/li\u003e\n    \u003cli class=\"cs-drop-li\"\u003e\n      \u003ca href=\"/bowie-custom-closets\" class=\"cs-drop-link\"\u003eBowie\u003c/a\u003e\n    \u003c/li\u003e\n    \u003cli class=\"cs-drop-li\"\u003e\n      \u003ca href=\"/severna-park-custom-closets\" class=\"cs-drop-link\"\u003eSeverna Park\u003c/a\u003e\n    \u003c/li\u003e\n    \u003cli class=\"cs-drop-li\"\u003e\n      \u003ca href=\"/odenton-custom-closets\" class=\"cs-drop-link\"\u003eOdenton\u003c/a\u003e\n    \u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/li\u003e\n```\n\nIn the above example, we're checking to see if the active page slug matches any of the four that are listed (annapolis, bowie, severna or odenton) and applying the .cs-active style to the parent if it does.\n\nBelow the front matter is the page content. Any code that should be sent to a layout should be enclosed in the layout's component:\n\n```\n\u003cBaseLayout\u003e\n  \u003c!-- Your html/jsx code here --\u003e\n\u003c/BaseLayout\u003e\n```\n\nThis code will be inserted into the `\u003cslot /\u003e` component in BaseLayout.astro.\n\n\u003ca name=\"builtinastrocomponents\"\u003e\u003c/a\u003e\n\n### Built-in Astro components: `\u003cImage /\u003e` and `\u003cPicture /\u003e`\nThis kit demonstrates the use of the built-in `\u003cPicture /\u003e` component, [for which you can read the documentation here](https://docs.astro.build/en/guides/images/#picture-). However, not all native HTML `\u003cpicture\u003e` elements from CodeStitch blocks have been replaced with Astro's `\u003cPicture /\u003e` components. CodeStich users will have to decide which one they want to use:\n * CodeStich blocks already have fully-functionning `\u003cpicture\u003e` elements that perform very well. However, the developper will have to do a time-consumming job with resizing and reformatting assets.\n * Astro's `\u003cPicture /\u003e` components must be manually written to replace stitches. On the other hand, they automatically process and optimize assets, which allows the developper to skip the resizing and reformatting preparation work.\n\n\n\u003ca name=\"preloadingimages\"\u003e\u003c/a\u003e\n\n### Preloading images\nTHis kit takes advantage of the [preload attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/preload) to fetch images above the fold with higher priority, resulting in improved performances and reducing flashes of unstyled content. Preloaded images are used on the index page for the hero image as well as on all other pages in the Landing component.\n\nYou will notice this snippet at the top of every `.astro` page:\n\n```jsx\n---\n// Optimize our landing image and pass it as props to the BaseLayout (for preloading) and Landing (for rendering)\nimport {getOptimizedImage} from \"../js/utils\"\nimport landingImage from \"../assets/images/landing.jpg\" // \u003c-- THE PATH TO THE ASSET YOU WANT TO PRELOAD - The asset must live in src\nconst optimizedImage = await getOptimizedImage(landingImage)\n---\n```\n\nYou only need to change the path of the asset you want to preload. The rest is managed behind the scenes.\n\n\u003ca name=\"css\"\u003e\u003c/a\u003e\n\n### CSS\n\nMost CSS will be written within the components it's styling via **scoping**. Scoped styles are compiled behind-the-scenes to only apply to HTML written inside of that same component. The CSS that you write inside of an Astro component is automatically encapsulated inside of that.\n\nAs this kit runs `less`, we can use the `\u003cstyle lang=\"less\"\u003e\u003c/style\u003e` tags to write our nested CSS. If you prefer non-nested, traditional CSS you can use standard `\u003cstyle\u003e\u003c/style\u003e` tags in your `.astro` files.\n\nYou can also use standalone `less` or `.css` stylesheets, located in `src/styles`. Don't forget to import them in your component.\n\n\u003ca name=\"addingViewTransitions\"\u003e\u003c/a\u003e\n\n### Adding View Transitions\nOpt in to using view transitions on individual pages by importing and adding the \u003cViewTransitions /\u003e routing component to \u003chead\u003e in \u003cBaseLayout /\u003e.\n\n```html\n---\nimport { ViewTransitions } from 'astro:transitions';\n---\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eMy Homepage\u003c/title\u003e\n    \u003cViewTransitions /\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003ch1\u003eWelcome to my website!\u003c/h1\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### Using scripts with View Transitions enabled\nWhen you add view transitions to an existing Astro project, some of your scripts may no longer re-run after page navigation like they did with full-page browser refreshes. \n\nThe \u003cViewTransition /\u003e router fires a number of events on the document during navigation. These events provide hooks into the lifecycle of navigation, allowing you to do things like show indicators that a new page is loading, override default behavior, and restore state as navigation is completing.\n\nYou can use the `astro:page-load` event to run code on every page navigation, for example to set up event listeners that would otherwise be lost during navigation.\n\n```js\n\u003cscript\u003e\n  document.addEventListener('astro:page-load', () =\u003e {\n    // This runs on first page load and after every navigation.\n    setupStuff(); // e.g. add event listeners\n  });\n\u003c/script\u003e\n```\n\nFor an in-depth explanation, please refer \u003ca href=\"https://docs.astro.build/en/guides/view-transitions/#script-behavior-with-view-transitions\"\u003eto the documentation.\n\n\u003ca name=\"netlifyforms\"\u003e\u003c/a\u003e\n\n### Adding Netlify Forms\nWe recommend hosting your site on Netlify to enjoy some of their perks, like automatic form detection.\n\nNetlify’s serverless form handling allows you to manage forms without extra API calls or additional JavaScript. Once enabled, the built-in form detection feature allows our build system to automatically parse your HTML at deploy time, so there’s no need for you to make an API call or include extra JavaScript on your site.\n\nLearn how to set them up on [Netlify documentation](https://docs.netlify.com/forms/setup/)\n\n\n\u003ca name=\"deployment\"\u003e\u003c/a\u003e\n\n## Deployment\n\n1. Ensure the astro.config.mjs, client.json, robots.txt and \\_redirects have been filled out. \n2. Navigate to your Netlify Admin Panel, click _Add new site | Import an existing project_\n3. Follow the instructions to connect your GitHub repository to Netlify.\n\n\u003ca name=\"acknowledgments\"\u003e\u003c/a\u003e\n\n## Acknowledgments\n\nThe author would like to acknowledge:\n* [Cedar Studios](https://github.com/cedar-studios) - Their [Intermediate-Astro-Kit-LESS](https://github.com/cedar-studios/Intermediate-Astro-Kit-LESS/tree/master) is the base of this template.\n* [CodeStitch](https://codestitch.app/) - Some of their free stitches were used in this template.\n\u003ca name=\"Conclusion\"\u003e\u003c/a\u003e\n\n## Conclusion\nI hope that this kit will prove useful to you. If you have any questions or would like to connect, feel free to reach out on [Twitter](https://twitter.com/BuckyBuck135) or at `buckybuck` on Discord.\n\nHappy coding!\n***Geoffrey***\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodeStitchOfficial%2FBeginner-Astro-Starter-Kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCodeStitchOfficial%2FBeginner-Astro-Starter-Kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodeStitchOfficial%2FBeginner-Astro-Starter-Kit/lists"}