{"id":15695923,"url":"https://github.com/alexmacarthur/wp-vue","last_synced_at":"2025-04-05T03:02:33.900Z","repository":{"id":21883282,"uuid":"89963070","full_name":"alexmacarthur/wp-vue","owner":"alexmacarthur","description":"A simple Vue blog template that displays posts from any WordPress REST API endpoint.","archived":false,"fork":false,"pushed_at":"2023-01-06T01:47:09.000Z","size":1970,"stargazers_count":455,"open_issues_count":33,"forks_count":108,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-04-14T11:56:20.199Z","etag":null,"topics":["blogging","javascript","netlify","rest-api","starter-template","theme","vue","vue-blog","wordpress"],"latest_commit_sha":null,"homepage":"https://wp.netlify.com","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexmacarthur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-01T21:07:06.000Z","updated_at":"2024-03-08T08:01:56.000Z","dependencies_parsed_at":"2023-01-13T21:43:43.445Z","dependency_job_id":null,"html_url":"https://github.com/alexmacarthur/wp-vue","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmacarthur%2Fwp-vue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmacarthur%2Fwp-vue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmacarthur%2Fwp-vue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmacarthur%2Fwp-vue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexmacarthur","download_url":"https://codeload.github.com/alexmacarthur/wp-vue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280190,"owners_count":20912966,"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":["blogging","javascript","netlify","rest-api","starter-template","theme","vue","vue-blog","wordpress"],"created_at":"2024-10-03T19:05:24.516Z","updated_at":"2025-04-05T03:02:33.828Z","avatar_url":"https://github.com/alexmacarthur.png","language":"Vue","funding_links":[],"categories":["脚手架","Components \u0026 Libraries","Vue","Scaffold","Scaffold [🔝](#readme)"],"sub_categories":["源代码编辑","Scaffold","Source Code Editing"],"readme":"# WP Vue\n\n[![Build Status](https://travis-ci.org/alexmacarthur/wp-vue.svg?branch=master)](https://travis-ci.org/alexmacarthur/wp-vue) [![Netlify Status](https://api.netlify.com/api/v1/badges/87ff7587-b7b2-4828-965c-97e606b81013/deploy-status)](https://app.netlify.com/sites/wp/deploys)\n\nThis is just a simple Vue application (scaffolded using the [Vue CLI](https://cli.vuejs.org/)) that pulls posts from a WordPress REST API endpoint. Clone or fork this sucka \u0026 rip it apart to suit your own needs. If you have ideas to make it better for everyone else, contribute!\n\n## Install\n\nIn the root of the project, run `npm install`.\n\n## Usage\n\n### Set Your Environment Variables\n\nVarious 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:\n\n- `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`\n- `POSTS_PER_PAGE` - The default number of posts per page that will be displayed.\n- `GA_TRACKING_ID` - A Google Analytics tracking ID.\n- `REQUEST_CACHE_MAX` - The maximum number of AJAX requests that will be cached in memory.\n\nWhen 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.\n\n### Spin Up Locally\n\nRun `npm run serve` to spin up a running version from localhost.\n\n### Build for Production\n\nRun `npm run build`.\n\n### Deploy to Netlify\n\nNetlify is amazing, so if you're in need of somewhere to host your own version of this project, I highly recommend it.\n\n[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/alexmacarthur/wp-vue)\n\n## Caching\n\nOut 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.\n\nTo 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.\n\nManually reloading the page will kill this cache. It will not persist.\n\n## Set Endpoint via URL Parameter\n\nIf 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:\n\nExample: `https://wp.netlify.com?endpoint=https://css-tricks.com/wp-json/wp/v2`\n\nInstead of using the default, this will use whatever endpoint you provide in the URL.\n\n## Contribute\n\nPlease do! See the \u003cCONTRIBUTING.md\u003e for details.\n\n## License\n\nMIT © [Alex MacArthur](https://macarthur.me)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmacarthur%2Fwp-vue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexmacarthur%2Fwp-vue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmacarthur%2Fwp-vue/lists"}