Skip to content

Commit

Permalink
Remove dotes from paths from custom files paths feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-nginx committed Jan 20, 2018
1 parent 4482f76 commit 1cb4d08
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
15 changes: 6 additions & 9 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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


# ---------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion layout/_macro/sidebar.swig
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
2 changes: 1 addition & 1 deletion layout/_partials/head/head.swig
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
</script>

{% 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 %}
Expand Down
2 changes: 1 addition & 1 deletion layout/_partials/header.swig
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
</nav>

{% 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 %}
Expand Down
6 changes: 3 additions & 3 deletions source/css/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1cb4d08

Please sign in to comment.