slidevjs / slidev

Presentation Slides for Developers
https://sli.dev
MIT License
33.49k stars 1.37k forks source link

docs: howto include icons when publishing #1558

Closed draptik closed 6 months ago

draptik commented 6 months ago

Can we update the documentation on how to include icons as described in https://sli.dev/guide/syntax#icons when publishing the slides?

I've tried including the packages in the github workflow without success.

      - name: Install slidev
        run:  |
            cd ${{ env.PRESENTATION_FOLDER }}
            npm i -g @slidev/cli
            npm i -g @slidev/theme-default
            npm i -g unplugin-icons
            npm i -g @iconify/json
            npm i -g playwright-chromium

When presenting the slides on localhost everything is fine.

When publishing the slides to github-pages (as an example), the github ci build fails, complaining that

✓ 353 modules transformed.
x Build failed in 1.71s
Error: [unplugin-icons] Could not load ~icons/noto/pile-of-poo (imported by ../../../../../../@slidev/slides/57.md): Icon `noto/pile-of-poo` not found

I'm probably missing something obvious.

antfu commented 6 months ago

You can try installing @iconify-json/noto - otherwise please provide a minimal reproduction

antfu commented 6 months ago

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info. Please provide a minimal reproduction to reopen the issue. Thanks.

Why reproduction is required

draptik commented 6 months ago

@antfu thanks for closing this so fast:

It was a 'userland' issue.

In case anybody ends up here:

I hadn't updated my .github/workflows script in a while.

Here is a working example (you need a valid github token):

https://github.com/draptik/slidev-demo1

deploys to

https://github.com/draptik/slidev-demo1-public