简体   繁体   English

使用jekyll-assets时如何禁用文件名中的哈希

[英]How to disable hash in filename when using jekyll-assets

I'm new to Jekyll but so far it's really impressive. 我是Jekyll的新手,但到目前为止确实令人印象深刻。 The whole asset's pipeline workflow is confusing to me though. 不过,整个资产的管道工作流程令我感到困惑。 In my config.yaml file I've got the following: 在我的config.yaml文件中,我有以下内容:

gems:
- jekyll-feed
- jekyll-assets
assets:
  autowrite: true
  prefix: "/assets"
  digest: true
  assets:
    - "*.png"
    - "*.jpg"
    - "*.svg"
  sources:
    - _assets/_img

All my images are in /_assets and so far running bundle exec jekyll serve copies all these files into _site/assets/ thus rendering them at http://127.0.0.1:4000/assets/ . 我所有的映像都在/_assets并且到目前为止运行的bundle exec jekyll serve _site/assets/都会将所有这些文件复制到_site/assets/从而在http://127.0.0.1:4000/assets/呈现它们。

The issue is that when it copies, for example, canlislogo.svg , it's new filename is canlislogo-ae5640da3ff77d178133e0ab015ef4aaa0accb025aa955c9c2aeca2ae32fbca9.svg , adding a long hash. 问题是,当它复制例如canlislogo.svg ,它的新文件名是canlislogo-ae5640da3ff77d178133e0ab015ef4aaa0accb025aa955c9c2aeca2ae32fbca9.svg ,并添加了一个长哈希。 Since I'm using Grunt for all my Stylus css creation, I don't need this hash. 由于我在所有Stylus css创建过程中都使用Grunt,因此不需要此哈希。 In fact, with it, I have no way of referencing these files. 实际上,有了它,我无法引用这些文件。

How can I copy the assets automatically but drop the hash? 如何自动复制资产但删除哈希?

Please and thank you. 谢谢,麻烦您了。 :) :)

Replacing digest: true with digest: false should remove the hashes. digest: true替换digest: true digest: false应当删除哈希。

That said, I'm surprised that asset-name wouldn't be automatically routed to asset-name-#{HASH} by Jekyll? 这就是说,我很惊讶, asset-name不会自动路由到asset-name-#{HASH}通过杰基尔?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM