Skip to content

添加子目录支持 #3

@yqw1218

Description

@yqw1218

由于目前的静态资源定位是固定的,没有支持子目录结构,于是在 _config.yml 中添加了

# Static files
vendors: /vendors
css: /css

并更改 _partials/head.swig

{% if theme.fancybox %}
  <link rel="stylesheet" type="text/css" href="{{ url_for(theme.vendors) }}/fancybox/source/jquery.fancybox.css?v=2.1.5"/>
{% endif %}

<link rel="stylesheet" type="text/css" href="{{ url_for(theme.css) }}/main.css?v={{ theme.version }}"/>

{% if theme.favicon %}
    <link rel="icon" type="image/x-icon" href="{{ url_for(theme.favicon) }}" />
{% endif %}

_partials/scripts.swig

{% if theme.jquery || theme.fancybox %}
  <script type="text/javascript" src="{{ url_for(theme.vendors) }}/jquery/dist/jquery.min.js"></script>
{% endif %}

{% if theme.fancybox %}
  <script type="text/javascript" src="{{ url_for(theme.vendors) }}/fancybox/source/jquery.fancybox.pack.js"></script>
  <script type="text/javascript">
    $(document).ready(function() {
      $(".fancybox").fancybox();
    });
  </script>
{% endif %}

希望有帮上一些忙 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions