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

Using vite-plugin-posthtml and vite-plugin-liquid together doesn't work. #5

Open
prd-nghia-cao opened this issue Dec 25, 2023 · 0 comments

Comments

@prd-nghia-cao
Copy link

HI, I wanna use posthtml-base-url in my project (currently is running Vite + Vituum + Vituum Plugin Liquid) but It doesn't work. As I console log the HTML it got process in this function of vite-plugin-posthtml, it show that posthtml will process the pre-processed index.liquid so it doesn't have any <img /> tag to prepend the base url:

const render = await new Promise((resolve) => {
  const output = {};
  console.log("html", html)

  posthtml(plugins.concat(...pluginOptions.plugins))
    .process(html, pluginOptions.options)
    .catch((error) => {
      output.error = error;
      resolve(output);
    })
    .then((result) => {
      // @ts-ignore
      output.content = result?.html;
      resolve(output);
    });
});

The HTML:

{% layout "layouts/default-layout.liquid" %}
{% block content %}
  {% render "partials/overview/hero.liquid" %}
  {% render "partials/overview/intro.liquid" %}
{% endblock %}

Is there any way I could get the processed HTML instead of the Liquid file? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant