
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
[](https://www.npmjs.com/package/wp-nuxt) [](https://www.npmjs.com/package/wp-nuxt) [.
Add wp-nuxt dependency using yarn or npm to your project
Add wp-nuxt to modules section of nuxt.config.js
{
modules: [
// Simple usage
'wp-nuxt',
// With options
['wp-nuxt', {
endpoint: 'https://wp.kmr.io/wp-json',
extensions: true // For additional functions of wpapi-extensions
/* other options of WP-API */
}],
]
}
Info: when you pass extensions: true you will have additional functions of wpapi-extensions available. For this you also have to install WUXT Headless WordPress API Extensions on your wordpress sever.
You can use the API of WP-API using the injected 'app.$wp'. (s. example)
<script>
export default {
async asyncData ({ app, store, params }) {
return { articles: await app.$wp.posts().perPage(10) }
}
}
</script>
To use an automatically generated rss feed under /feed.xml you have to add following to your the nuxt.config.js.
It will automatically fetch the posts from your rest endpoint provided in the options. (demo)
const wpNuxtFeed = require('wp-nuxt/lib/rss')
module.exports = {
feed: [
wpNuxtFeed({
baseUrl: 'http://localhost:3000'
})
]
}
To prevent injecting the default link tag into the head you can pass the option injectDefaultHead: false.
Any options such as title or description can be overwritten through the function options. For more options look into the feed module and the definition of th function.
Using the module nuxtjs/sitemap a opinionated sitemap is provided by default.
Specific options can be overwritten like the following in the nuxt.config.js:
module.exports = {
wp: {
sitemap: {
hostname: process.env.HOSTNAME // default; format e.g. 'http://localhost:3000'
}
}
}
It can be completely overwritten using the sitemap property in the nuxt.config.js and deactivated using following:
module.exports = {
wp: {
sitemap: false
}
}
See more options in the extension nuxtjs/sitemap or in the following file
You can register your own routes e.g. for custom extentions.
module.exports = {
wp: {
endpoint: 'https://wp.kmr.io/wp-json',
customRoutes: [
{
extension: 'wp/v2',
route: 'custom-taxonomy',
name: 'customTaxonomy'
}
]
}
}
This will call wp.customTaxonomy = wp.registerRoute('wp/v2','custom-taxonomy' and make it available as app.$wp.customTaxonomy()
For more infos: https://github.com/WP-API/node-wpapi/tree/master#auto-discovery
module.exports = {
wp: {
endpoint: 'https://wp.kmr.io/wp-json',
discover: true // To auto-discover routes by url provided in 'endpoint'
}
}
Info: Make sure to handle CORS correctly. s. https://github.com/WP-API/node-wpapi/tree/master#cross-origin-auto-discovery
IE11 seems to work, but throws errors. (Help wanted)
Copyright (c) yashha
FAQs
[](https://www.npmjs.com/package/wp-nuxt) [](https://www.npmjs.com/package/wp-nuxt) [
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.