diff --git a/_config.yml b/_config.yml index 4541073ab8..f99875566d 100644 --- a/_config.yml +++ b/_config.yml @@ -18,17 +18,14 @@ cache: # For example, you want to put your custom styles file # outside theme directory in root `source/_data`, set # `styles: ../../../../../source/_data/styles.styl` - -# ATTENTION! Do not need to touch any `../..` paths, -# only relative paths behind `source` can be modified. #custom_file_path: - #head: ../../../../../source/_data/head.swig - #header: ../../../../source/_data/header.swig - #sidebar: ../../../../source/_data/sidebar.swig + #head: source/_data/head.swig + #header: source/_data/header.swig + #sidebar: source/_data/sidebar.swig - #styles: ../../../../../source/_data/styles.styl - #mixins: ../../../../../source/_data/mixins.styl - #variables: ../../../../../source/_data/variables.styl + #styles: source/_data/styles.styl + #mixins: source/_data/mixins.styl + #variables: source/_data/variables.styl # --------------------------------------------------------------- diff --git a/layout/_macro/sidebar.swig b/layout/_macro/sidebar.swig index e90eebe25b..4dcf14d980 100644 --- a/layout/_macro/sidebar.swig +++ b/layout/_macro/sidebar.swig @@ -136,7 +136,7 @@ {% endif %} {% if theme.custom_file_path.sidebar %} - {% set custom_sidebar = theme.custom_file_path.sidebar %} + {% set custom_sidebar = '../../../../' + theme.custom_file_path.sidebar %} {% else %} {% set custom_sidebar = '../_custom/sidebar.swig' %} {% endif %} diff --git a/layout/_partials/head/head.swig b/layout/_partials/head/head.swig index f9651db862..905f942c59 100644 --- a/layout/_partials/head/head.swig +++ b/layout/_partials/head/head.swig @@ -132,7 +132,7 @@ {% if theme.custom_file_path.head %} - {% set custom_head = theme.custom_file_path.head %} + {% set custom_head = '../../../../../' + theme.custom_file_path.head %} {% else %} {% set custom_head = '../../_custom/head.swig' %} {% endif %} diff --git a/layout/_partials/header.swig b/layout/_partials/header.swig index 81d71ad7bc..84697e3bbc 100644 --- a/layout/_partials/header.swig +++ b/layout/_partials/header.swig @@ -91,7 +91,7 @@ {% if theme.custom_file_path.header %} - {% set custom_header = theme.custom_file_path.header %} + {% set custom_header = '../../../../' + theme.custom_file_path.header %} {% else %} {% set custom_header = '../_custom/header.swig' %} {% endif %} diff --git a/source/css/main.styl b/source/css/main.styl index 880e8c336e..fdb13608dd 100644 --- a/source/css/main.styl +++ b/source/css/main.styl @@ -4,9 +4,9 @@ $scheme = hexo-config('scheme') ? hexo-config('scheme') : 'Muse'; -$custom_styles = hexo-config('custom_file_path.styles') ? hexo-config('custom_file_path.styles') : custom; -$custom_mixins = hexo-config('custom_file_path.mixins') ? hexo-config('custom_file_path.mixins') : custom; -$custom_variables = hexo-config('custom_file_path.variables') ? hexo-config('custom_file_path.variables') : custom; +$custom_styles = hexo-config('custom_file_path.styles') ? "../../../../../" + hexo-config('custom_file_path.styles') : custom; +$custom_mixins = hexo-config('custom_file_path.mixins') ? "../../../../../" + hexo-config('custom_file_path.mixins') : custom; +$custom_variables = hexo-config('custom_file_path.variables') ? "../../../../../" + hexo-config('custom_file_path.variables') : custom; $variables = base $scheme $custom_variables; $mixins = base $scheme $custom_mixins;