{"id":15491298,"url":"https://github.com/theodesp/astro-wordpress-starter","last_synced_at":"2025-04-22T19:21:24.179Z","repository":{"id":97066270,"uuid":"577370080","full_name":"theodesp/astro-wordpress-starter","owner":"theodesp","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-14T14:57:55.000Z","size":173,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-19T10:00:25.236Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/theodesp.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":"2022-12-12T15:31:54.000Z","updated_at":"2023-11-06T04:19:27.000Z","dependencies_parsed_at":"2023-03-13T16:19:36.991Z","dependency_job_id":null,"html_url":"https://github.com/theodesp/astro-wordpress-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodesp%2Fastro-wordpress-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodesp%2Fastro-wordpress-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodesp%2Fastro-wordpress-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodesp%2Fastro-wordpress-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theodesp","download_url":"https://codeload.github.com/theodesp/astro-wordpress-starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250306601,"owners_count":21408927,"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":[],"created_at":"2024-10-02T07:44:44.275Z","updated_at":"2025-04-22T19:21:24.165Z","avatar_url":"https://github.com/theodesp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Astro WordPress Starter\n\nThis project is meant to be a flexible starting point for people interested in using [Astro](https://astro.build/) with WordPress as a headless CMS. If you want some additional resources to help get you started, check out the blog post and video linked below.\n\n[✍️ Read the step-by-step tutorial](https://developers.wpengine.com/blog/building-a-headless-wordpress-site-with-astro)\n[📹 Watch the video](https://www.youtube.com/watch?v=BcoxZZIfESI)\n\n## Requirements\n- [WordPress](https://wordpress.org/)\n- [WPGraphQL](https://www.wpgraphql.com/docs/introduction)\n- Environment Variables\n\nAdd a variable to your `.env` and then hit `npm run dev`:\n\n`WORDPRESS_API_URL = https://yoursitename.com/graphql`\n\n### Routing and Templates\n\nThis starter project leans into the WordPress CMS routing capabilities and uses a `getNodeByUri` query in WPGraphQL to handle any route path that WordPress knows about. This allows you to handle all WordPress content types using the `[...uri].astro` component. From there, Astro parses the `uri` and uses that to call `getNodeByURI` from `api.js` to fetch data about that resource from the CMS. Once data is returned, we look at the content type and then dynamically resolve a content template from the `templates` directory.\n\n#### Adding Content Types\n\nThis project comes with built in support for Post, Page, Tag, and Category types, but could easily be extended for custom post types or other native content types. To add support for a custom post type you would do the following:\n1. Add a GraphQL fragment for your post type to `getNodeByURI` from `api.js`\n2. Add an Astro component as a template\n3. Add a case to the switch statement in `[...uri].astro` to catch the content type and resolve the template\n\n#### Overriding Default Routing\n\nSince routes using [rest parameters in Astro](https://docs.astro.build/en/core-concepts/routing/#rest-parameters) come last in the [route priority order](https://docs.astro.build/en/core-concepts/routing/#route-priority-order), you can easily override this catch-all routing pattern by creating a more specific route to handle a given path. \n\nFor example, if you want the path `/category/food-trucks` to be handled by a different Astro component, you can add a corresponding file to the `pages` directory to override the default `...uri` route.\n\n\n### Menus \n\nBy default, the menu assigned to the `Primary` menu location will be used for your header menu.\n\n\n## Headless WordPress Hosting with Atlas\n\nWP Engine's Atlas platform provides a performant and user-friendly hosting platform for headless WordPress and Node-based JavaScript apps. [Create a free sandbox account](https://wpengine.com/atlas/) to try the platform, and check out our Astro deployment guide for instruction to deploy to the platform.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheodesp%2Fastro-wordpress-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheodesp%2Fastro-wordpress-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheodesp%2Fastro-wordpress-starter/lists"}