Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headless WordPress plugin #322

Open
oscarotero opened this issue Nov 23, 2022 · 7 comments
Open

Headless WordPress plugin #322

oscarotero opened this issue Nov 23, 2022 · 7 comments
Labels
enhancement New feature or request Idea plugins

Comments

@oscarotero
Copy link
Member

Enter your suggestions in details:

It would be a helper similar to search but returning pages and posts from a WordPress instance. For example:

export const layout = "layouts/post.njk";

export default function* ({ wp }) {
    for (const post of wp.posts()) {
        return post;
    }
}
@oscarotero oscarotero added enhancement New feature or request plugins labels Nov 23, 2022
@oscarotero
Copy link
Member Author

Done here https://github.com/lumeland/experimental-plugins/tree/main/wordpress

@oscarotero oscarotero added this to the 1.15.0 milestone Dec 29, 2022
@oscarotero oscarotero removed this from the 1.15.0 milestone Feb 6, 2023
@ngdangtu-vn
Copy link
Contributor

Correct me if I'm wrong, but the plugin doesn't seem to support CPTs, Custom Taxonomies (CT) and Custom (role) Users right?

In my current WP project, I created a CPT with 2 CT. Not to mention I also have plenty Custom Fields. If you plan to release the plugin now, the user scope will be limited. It not that bad if it can support wordpress.com smoothly.

@oscarotero
Copy link
Member Author

The plugin is very limited as is now.
I think maybe is not a good idea because for big sites it's very slow because it depends on the WP API, HTTP connection, etc.

I think a better aproach would be to simply create a script to download the content once, save it as markdown files and then you can build the site using the downloaded content. If you need to upgrade the content, just download it again.

Probably an archetype would fit better for this use case.

@ngdangtu-vn
Copy link
Contributor

Well, indeed that it is the most flexible way to do so. But I wonder if the type: "post", could be set manually with fallback value is "post". If possible, it would make the plugin be much more flexible.

I'm not worry much about big sites, however, with one more field can be add manually, ten more unaware problems may arrive =))

But still, I'm kinda curious of how far I can push this one :?

@oscarotero
Copy link
Member Author

oscarotero commented Sep 8, 2023

It's you feel strong and want to work on improving this plugin, I'll appreciate it :)

@ngdangtu-vn
Copy link
Contributor

About the demo config file, it didn't work right? Because my TypeScript complaint wrong type.

@oscarotero
Copy link
Member Author

It should work fine now.
The blog was down and the demo was using a local copy of Lume

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Idea plugins
Projects
None yet
Development

No branches or pull requests

2 participants