Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom filter is not worked on github pages #1

Open
vreality64 opened this issue Aug 6, 2017 · 1 comment
Open

custom filter is not worked on github pages #1

vreality64 opened this issue Aug 6, 2017 · 1 comment
Assignees

Comments

@vreality64
Copy link
Owner

vreality64 commented Aug 6, 2017

github pages is building jekyll in safe mode. It means custom plugins in _plugins directory are ignored because of overriding config value of _plugins dirctory.

here are code of github pages

# Options which GitHub Pages sets, regardless of the user-specified value
#
# The following values are also overridden by GitHub Pages, but are not
# overridden locally, for practical purposes:
# * source
# * destination
# * jailed
# * verbose
# * incremental
# * GH_ENV
OVERRIDES = {
  "lsi"         => false,
  "safe"        => true,
  "plugins"     => SecureRandom.hex,
  "plugins_dir" => SecureRandom.hex,
  "whitelist"   => PLUGIN_WHITELIST,
  "highlighter" => "rouge",
  "kramdown"    => {
    "template"           => "",
    "math_engine"        => "mathjax",
    "syntax_highlighter" => "rouge"
  },
  "gist"        => {
    "noscript"  => false
  }
}.freeze

how can i apply custom filter? jekyll's description is little bor ambigous.

@vreality64
Copy link
Owner Author

I think this code may be hint. config["gems"] are initialized with DEFAULT_PLUGIN values

# Given a user's config, determines the effective configuration by building a user
# configuration sandwhich with our overrides overriding the user's specified
# values which themselves override our defaults.
#
# Returns the effective Configuration
#
# Note: this is a highly modified version of Jekyll#configuration
def effective_config(user_config)
  # Merge user config into defaults
  config = Jekyll::Utils.deep_merge_hashes(MERGED_DEFAULTS, user_config)
    .fix_common_issues
    .add_default_collections

  # Merge overwrites into user config
  config = Jekyll::Utils.deep_merge_hashes config, OVERRIDES

  # Ensure we have those gems we want.
  config["gems"] = Array(config["gems"]) | DEFAULT_PLUGINS
  config["whitelist"] = config["whitelist"] | config["gems"] if disable_whitelist?

  config
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant