Code Monkey home page Code Monkey logo

Comments (3)

0xashu avatar 0xashu commented on June 15, 2024

发现由于 <% include common/navbar %> 中引用 img 路径问题导致。

原来的 img 路径引用:

<img class="navbar-logo" src="../../img/logo.svg" alt="imtoken logo" />

修改后的路径:

<img class="navbar-logo" src="../img/logo.svg" alt="imtoken logo" />

奇怪的地方是,如果是路径错误的话,但 index.html 却可以工作。
另外 includes ejs 模板后,有效路径是根据当前 html 页面作为相对路径。

// 如果编译阶段,有对应的报错提示就更好了。

from tmt-workflow.

littledu avatar littledu commented on June 15, 2024

这里的 include 相当于把代码片段粘贴到对应位置,所以是相对于 父级 的,也就是所存在的 html 页面。

至于图片路径引用错误理论来讲应该是在打开页面运行时才发现,对编译阶段应该是不影响的,可能会有的影响可能是开启了 reversion 功能,需要修改 logo.svg 的名字因为路径错误没找到。

from tmt-workflow.

0xashu avatar 0xashu commented on June 15, 2024

@littledu 但我奇怪的是,在 index.html 中居然可以工作。

from tmt-workflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.