Jekyll可以处理css或js文件吗? [英] Can Jekyll act over css or js files?

查看:399
本文介绍了Jekyll可以处理css或js文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Jekyll 作为我的一个项目,它似乎是开发简单网站,但维护一些

I'm using Jekyll for one of my projects and it really seems a very good alternative for developing simple websites but maintaining some processes automated.

Liquid Extensions a>工作,所以我想知道是否可能使jekyll行动超过js和css文件。

It's nice how the Liquid Extensions work, so I was wondering if it's possible to make Jekyll act over js and css files too.

所以我可以有我的主。 css like:

So I could have my main.css like:

@import url("/stylesheets/reset.css?{{site.time | date: '%Y%m%d%H%M%S'}}");
@import url("/stylesheets/config.css?{{site.time | date: '%Y%m%d%H%M%S'}}");

使用一些帮助我还有一些变量,我可以创建使用YML前端,

Using some of the helpers I have and also some variables I could create using YML front matter, don't know if it's possible through.

但因为它只生成静态文件,我不明白为什么我不能这样做。

But since it only generated static files I don't see why I wouldn't be able to do so.

感谢

推荐答案

你只需要添加一个YAML块到文件,Jekyll会处理它。 YAML块可以为空:

Yep. You just have to add a YAML block to the file, and Jekyll will process it. The YAML block can be empty:

---
---
@import url("/stylesheets/reset.css?{{site.time | date: '%Y%m%d%H%M%S'}}");
@import url("/stylesheets/config.css?{{site.time | date: '%Y%m%d%H%M%S'}}");

这篇关于Jekyll可以处理css或js文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆