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

Can't get first slide as feature image #494

Open
ooker777 opened this issue Jul 11, 2024 · 0 comments
Open

Can't get first slide as feature image #494

ooker777 opened this issue Jul 11, 2024 · 0 comments

Comments

@ooker777
Copy link
Contributor

If in your option there is no feature image, then this line

export default async (initialUrl, targetDir) => {
const { featuredSlide } = getOptions();
if (!featuredSlide || !puppeteer) {
return;
}
will return and you don't have any feature image.

If --featured-slide 0 is set, then this function

const getSlideAnchor = featuredSlide => {
const [slide, subslide] = featuredSlide.split('-').map(slide => _.parseInt(slide, 10));
return `${isNaN(slide) ? '' : '#/' + slide + (isNaN(subslide) ? '' : '/' + subslide)}`;
};
will make the URL to be:

${initialUrl}#/0

and this will return error. I try to change the condition to:

isNaN(slide) || slide === 0 

and the URL is just:

${initialUrl}

which should work, but it still get error. I have no idea on how to fix this.

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