Use Vue.js and the WP REST API to build WordPress themes as SPAs with dynamic routing, HMR for development, SEO enabled, and SSR capable. Demo:
Overview:
Vue.wordpress is a Wordpress starter theme built using the WP REST API and Vue.js. It is optimized for SEO, performance, and ease of development. The theme is designed to be used as a foundation for creating sites that function as a single-page application on the front-end while using Wordpress and the WP REST API to manage content and fetch data.
Features:
- Front and back-end run on the same host
- Supports various client/server code partitioning strategies for optional SEO optimization
- Hot Module Replacement (HMR) for development
- Vue.js Single File Components
- Dynamic routing as set up in WP Dashboard (Settings > Permalinks)
- Vue Router internal link delegation
- Document title tag update on route change
- Consistent in-component REST API data fetching
- Integrated REST API request caching and batching
- REST API Data Localizer for state initialization and making back-end REST API requests
- Normalized data structure
- Pagination enabled
- Utility components, including ResponsiveImage, SiteLoading, ArchiveLink, etc.
Installation:
- Clone or download this repo in your /wp-content/themes directory and activate it.
- Clone or download the REST API Data Localizer companion plugin in your /wp-content/plugins directory and activate it.
- Ensure that the settings in Settings > Permalinks do not violate the rules described in Routing.
- Install the dependencies by running the command
npm install. - Build the theme by running the command
npm run build.
Summary:
Vue.wordpress is a Wordpress starter theme that combines the power of Vue.js and the WP REST API to create sites that function as single-page applications. It offers various features such as dynamic routing, REST API request caching, and integrated REST API data fetching. The theme is easy to install and customize, making it a great choice for developers who want to create SEO-friendly and performance-optimized websites using Wordpress.