使用 github 页面部署 Reveal.js 演示文稿,但未加载 html

问题描述 投票:0回答:1

我正在尝试使用外部插件部署 Reveal.js 演示文稿,https://github.com/janschoepke/reveal_externa。 问题是,部署时,它显示以下错误:

Said error

以我的低理解,这意味着它无法找到我的html源,我尝试了一些基本的建议,比如改变我编写路径的方式等等,但到目前为止没有任何效果。

为了以防万一,我将添加一个指向我的存储库的链接。 这里

另外,这是我的文件夹的分布,html 文件位于演示文件夹中。 Folder distribution

这是我的索引 html:

<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

        <title>Curso OpenGL</title>

        <link rel="stylesheet" href="dist/reset.css">
        <link rel="stylesheet" href="dist/reveal.css">
        <link rel="stylesheet" href="dist/theme/serif.css">

        <!-- Theme used for syntax highlighted code -->
        <link rel="stylesheet" href="plugin/highlight/monokai.css">
        
    </head>
    <body>
        <div class="reveal">
            <div class="slides">
                <section data-external="presentation/title.html"></section>

                <section data-external="presentation/content.html"></section>

                <section data-external-replace="presentation/basics/introduction.html"></section>

                <section data-external-replace="presentation/development enviroment/DE.html"></section>
                
                <section data-external-replace="presentation/fundaments/fundamentals.html"></section>

                <section data-external-replace="presentation/basicFigures/BF.html"></section>
                
                <section data-external-replace="presentation/geometricTransformations/gt.html"></section>
                
                <section data-external-replace="presentation/camara/pc.html"></section>

                <section data-external-replace="presentation/shadows/is.html"></section>

                <section data-external-replace="presentation/texture/texture.html"></section>

                <section data-external-replace="presentation/animation/animation.html"></section>

                <section data-external-replace="presentation/user/userInteraction.html"></section>
                
            </div>
        </div>

        <script src="dist/reveal.js"></script>
        <script src="plugin/notes/notes.js"></script>
        <script src="plugin/markdown/markdown.js"></script>
        <script src="plugin/highlight/highlight.js"></script>
        <script src="plugin/zoom/zoom.js"></script>
        
        
        <script>
            // More info about initialization & config:
            // - https://revealjs.com/initialization/
            // - https://revealjs.com/config/
            Reveal.initialize({
                hash: true,

                dependencies: [
                    {
                        src: 'node_modules/reveal_external/external/external.js',
                        condition: function() {
                            return !!document.querySelector( '[data-external],[data-external-replace]' );
                        }
                    },

                ],

                plugins: [ RevealZoom, RevealNotes, RevealMarkdown, RevealHighlight ],

                // Learn about plugins: https://revealjs.com/plugins/
                

            });
        </script>
    </body>
</html>

我尝试过更改路径格式,仅使用 dist 文件夹部署分支,也许解决方案或答案非常明显,但我无法破解它。

我对这一切都很陌生,特别是部署的概念,所以这是一个相当困境的情况。

更新: 我尝试使用插件文件夹中的外部插件进行部署,还更改了路径以避免指向node_modules的路径,在开发服务器本地工作正常,部署显示相同的错误,因此我假设在所有尝试中至少包含该插件。

javascript html github github-pages reveal.js
1个回答
0
投票

这有点尴尬,但我希望它能帮助任何遇到类似问题的人。 正如 C3roe 指出的那样,问题归结为外部插件被实现为节点依赖项,它至少不正确,解决方案基本上是将外部插件包含为插件。

External folder in plugin folder

之后路径标题游戏出了问题,不知道为什么它是唯一一个没有在 github 页面中渲染的游戏。如果我不得不猜测我会说这是某种保留字?类似这样的事情。

无论如何,已经解决了,thx。

© www.soinside.com 2019 - 2024. All rights reserved.