Wp Vue screenshot

Wp Vue

Author Avatar Theme by Alexmacarthur
Updated: 16 Apr 2020
456 Stars

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

Categories

Overview:

This is a simple Vue application that retrieves posts from a WordPress REST API endpoint. The application can be customized to suit individual needs, and contributions are encouraged to improve the application for everyone. The installation process involves defining important values through Node environment variables, and the application can be deployed locally or on a hosting platform like Netlify. The application also includes caching of AJAX requests for efficient loading of posts. Additionally, users can set a different endpoint via a URL parameter.

Features:

  • Retrieval of WordPress posts: The application pulls posts from a WordPress REST API endpoint.
  • Customization: Users can clone or fork the application and make modifications to suit their own needs.
  • Contribution: Users are encouraged to contribute to the project to make improvements for everyone.
  • Installation: The installation process involves defining important values through Node environment variables.
  • Deployment: The application can be deployed locally or on a hosting platform like Netlify.
  • Caching: AJAX requests are cached in memory to improve loading speed of posts.
  • Endpoint customization: Users can set a different endpoint via a URL parameter.

Installation:

  1. Clone or fork the project.
  2. Run npm install in the root of the project to install dependencies.
  3. Set your environment variables by creating a .env.local file in the root of the project.
  4. Define the following values in the .env.local file:
    • REST_ENDPOINT: The WordPress REST API endpoint from which data will be pulled.
    • 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.
  5. If deploying the application on your own, make sure these values are set through a .env file or in your hosting platform’s dashboard.

Summary:

This Vue application allows users to retrieve posts from a WordPress REST API endpoint. It can be customized and contributed to for further improvements. The installation process involves setting environment variables, and the application can be deployed locally or on a hosting platform. Caching is implemented for efficient loading of posts, and users can set a different endpoint via a URL parameter.