All Projects → alexmacarthur → Wp Vue

alexmacarthur / Wp Vue

Licence: mit
A simple Vue blog template that displays posts from any WordPress REST API endpoint.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Wp Vue

Api Blueprint Boilerplate
Minimalistic boilerplate to quick-start API specification using API Blueprint description language.
Stars: ✭ 71 (-83.22%)
Mutual labels:  rest-api, starter-template
Pop
Monorepo of the PoP project, including: a server-side component model in PHP, a GraphQL server, a GraphQL API plugin for WordPress, and a website builder
Stars: ✭ 160 (-62.17%)
Mutual labels:  rest-api, wordpress
Laravel Woocommerce
WooCommerce Rest API for Laravel
Stars: ✭ 86 (-79.67%)
Mutual labels:  rest-api, wordpress
Wp Rest Api Log
WordPress plugin for logging REST API requests and responses
Stars: ✭ 58 (-86.29%)
Mutual labels:  rest-api, wordpress
YATAS
Yet Another Tailwind Alpine Starter
Stars: ✭ 18 (-95.74%)
Mutual labels:  starter-template, netlify
Snipcart Wordpress React
Strapping React.js on a WordPress Backend: WP REST API Example
Stars: ✭ 66 (-84.4%)
Mutual labels:  rest-api, wordpress
React With Wordpress
🔥 Example of react application to access WordPress REST API
Stars: ✭ 137 (-67.61%)
Mutual labels:  rest-api, wordpress
Wp Jamstack Deployments
A WordPress plugin for JAMstack deployments
Stars: ✭ 222 (-47.52%)
Mutual labels:  netlify, wordpress
Wp Rest Api Cache
Enable caching for WordPress REST API and increase speed of your application
Stars: ✭ 239 (-43.5%)
Mutual labels:  rest-api, wordpress
Co Cart
🛒 CoCart is a flexible, open-source solution to enabling the shopping cart via the REST API for WooCommerce.
Stars: ✭ 198 (-53.19%)
Mutual labels:  rest-api, wordpress
Great Big Example Application
A full-stack example app built with JHipster, Spring Boot, Kotlin, Angular 4, ngrx, and Webpack
Stars: ✭ 899 (+112.53%)
Mutual labels:  rest-api, starter-template
Woo Next
🚀 React WooCommerce theme, built with Next JS, Webpack, Babel, Node, Express, using GraphQL and Apollo Client
Stars: ✭ 342 (-19.15%)
Mutual labels:  rest-api, wordpress
Nuepress
📖 Nuxt.js + WordPress REST API
Stars: ✭ 524 (+23.88%)
Mutual labels:  rest-api, wordpress
Acf To Rest Api
Exposes Advanced Custom Fields Endpoints in the WordPress REST API
Stars: ✭ 1,152 (+172.34%)
Mutual labels:  rest-api, wordpress
Headless Wp Starter
🔪 WordPress + React Starter Kit: Spin up a WordPress-powered React app in one step
Stars: ✭ 4,144 (+879.67%)
Mutual labels:  rest-api, wordpress
Wp Rest Starter
Starter package for working with the WordPress REST API in an object-oriented fashion.
Stars: ✭ 105 (-75.18%)
Mutual labels:  rest-api, wordpress
Eleventy Starter Boilerplate
🚀 Eleventy Starter is production-ready with SEO-friendly for quickly starting a blog. ⚡ Built with Eleventy, ESLint, Prettier, Webpack, PostCSS, Tailwind CSS and Netlify CMS (optional).
Stars: ✭ 139 (-67.14%)
Mutual labels:  netlify, blogging
Gatsby Starter Netlify Cms
Example gatsby + netlify cms project
Stars: ✭ 1,932 (+356.74%)
Mutual labels:  netlify, starter-template
Wp Nuxt
The module adds WP-API to your nuxt application.
Stars: ✭ 179 (-57.68%)
Mutual labels:  rest-api, wordpress
nuxt-starter-netlify-cms
Example nuxt + netlify cms project. Nuxt port of Gatsby starter app.
Stars: ✭ 13 (-96.93%)
Mutual labels:  starter-template, netlify

WP Vue

Build Status Netlify Status

This is just a simple Vue application (scaffolded using the Vue CLI) that pulls posts from a WordPress REST API endpoint. Clone or fork this sucka & rip it apart to suit your own needs. If you have ideas to make it better for everyone else, contribute!

Install

In the root of the project, run npm install.

Usage

Set Your Environment Variables

Various important values are loaded into the application via Node environment variables, which you'll need to define. Locally, run cp .env.sample .env.local to create a local file for defining the following:

  • REST_ENDPOINT - The WordPress REST API endpoint from which data will be pulled. Leave off the trailing slash. Example: https://blah-blah-blah.com/wp-json/wp/v2
  • POSTS_PER_PAGE - The default number of posts per page that will be displayed.
  • GA_TRACKING_ID - A Google Analytics tracking ID.
  • REQUEST_CACHE_MAX - The maximum number of AJAX requests that will be cached in memory.

When deploying this on your own, you'll need to have these values set through a .env file you ship yourself, or if you're using something like Netlify, you can define them in your dashboard.

Spin Up Locally

Run npm run serve to spin up a running version from localhost.

Build for Production

Run npm run build.

Deploy to Netlify

Netlify is amazing, so if you're in need of somewhere to host your own version of this project, I highly recommend it.

Deploy to Netlify

Caching

Out of the box, WP Vue will locally cache AJAX requests in memory, and then load them as needed. This first happens on page load, when all queried posts on the current and adjacent pages are cached for quick access later.

To keep things from getting out of control, a maximum request cache value is set. Once your cache reaches this max (regardless of how large each request is), the first request in memory will deleted as a new one is added. So, you shouldn't have to worry too much about an insane amount of data being locally stored as you move through posts.

Manually reloading the page will kill this cache. It will not persist.

Set Endpoint via URL Parameter

If you'd like to share link to a version of WP Vue that uses a different endpoint than what's set via the code, you can pass that endpoint in as a URL parameter:

Example: https://wp.netlify.com?endpoint=https://css-tricks.com/wp-json/wp/v2

Instead of using the default, this will use whatever endpoint you provide in the URL.

Contribute

Please do! See the <CONTRIBUTING.md> for details.

License

MIT © Alex MacArthur

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].