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

Add absolute image renderer #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nathansebhastian
Copy link

  • Add absolute image renderer to localhost:9000 as shown in
  • Allow EPUB generator to download the image from local production build

Closes #8

Allow EPUB generator to download the image from local production build
@netlify
Copy link

netlify bot commented Dec 31, 2020

👷 Deploy request for wizardly-snyder-c98440 pending review.
Visit the deploys page to approve it

🔨 Explore the source changes: b612d15

@@ -35,6 +35,16 @@ export const headingRenderer = ({ children: reactChildren, level }) => {
return React.createElement("h" + level, { id: slug }, children);
};

export const absoluteImageRenderer = ({ src, alt }) => {
src = src.replace("./", "http://localhost:9000/")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a variable in the book info that takes care of the local URL, I am using it here:

await page.goto(info.localURL, {
waitUntil: "networkidle2",

Mind using that?

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

Successfully merging this pull request may close these issues.

Image not downloaded for Epub?
3 participants