{"record":{"id":"09532df85a7b5cb4","repo":"imathis/octopress","slug":"error-in-tag-include-array-valid-syntax-inclu","errorCode":null,"errorMessage":"Error in tag 'include_array' - Valid syntax: include_array [array from _config.yml]","messagePattern":"Error in tag 'include_array' - Valid syntax: include_array \\[array from _config\\.yml\\]","errorType":"exception","errorClass":"SyntaxError","httpStatus":null,"severity":"error","filePath":"plugins/include_array.rb","lineNumber":20,"sourceCode":"# Author: Jason Woodward http://www.woodwardjd.com\n# Description: Import files on your filesystem as specified in a configuration variable in _config.yml.  Mostly cribbed from Jekyll's include tag.\n# Syntax: {% include_array variable_name_from_config.yml %}\n#\n# Example 1:\n# {% include_array asides  %}\n#\n# _config.yml snippet:\n# asides: [asides/twitter.html, asides/custom/my_picture.html]\n#\nmodule Jekyll\n\n  class IncludeArrayTag < Liquid::Tag\n    Syntax = /(#{Liquid::QuotedFragment}+)/\n    def initialize(tag_name, markup, tokens)\n      if markup =~ Syntax\n        @array_name = $1\n      else\n        raise SyntaxError.new(\"Error in tag 'include_array' - Valid syntax: include_array [array from _config.yml]\")\n      end\n\n      super\n    end\n\n    def render(context)\n      includes_dir = File.join(context.registers[:site].source, '_includes')\n\n      if File.symlink?(includes_dir)\n        return \"Includes directory '#{includes_dir}' cannot be a symlink\"\n      end\n\n      rtn = ''\n      (context.environments.first['site'][@array_name] || []).each do |file|\n        if file !~ /^[a-zA-Z0-9_\\/\\.-]+$/ || file =~ /\\.\\// || file =~ /\\/\\./\n          rtn = rtn + \"Include file '#{file}' contains invalid characters or sequences\"\n        end\n","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/imathis/octopress/blob/5717a50f4e4964ea8423997d6456b04c653f0348/plugins/include_array.rb#L2-L38","documentation":"Raised at Liquid parse time by the include_array Jekyll plugin when the tag's markup does not match a single Liquid QuotedFragment (include_array.rb:15-21). The tag requires exactly one argument: the name of a top-level key in _config.yml that holds an array of partial paths (e.g. asides). The regex only fails when the argument is missing or consists solely of characters QuotedFragment excludes (commas, colons, bare quotes); a missing _config.yml key does NOT raise this, because render falls back to an empty array at line 34. Because it is a Liquid SyntaxError, the whole Jekyll build stops.","triggerScenarios":"Writing {% include_array %} with no argument; passing an argument made only of excluded punctuation such as {% include_array , %} or {% include_array : %}; leaving stray punctuation after a deleted variable name in a layout. The accepted form is one bare word after the tag name, e.g. {% include_array asides }.","commonSituations":"Hand-editing Octopress/Jekyll layouts and accidentally deleting the variable name; copy-pasting the usage example but leaving its placeholder unexpanded; migrating templates from Jekyll's built-in {% include %} tag and forgetting that include_array takes a _config.yml key, not a filename.","solutions":["Add the argument: {% include_array asides %} — one bare word, no brackets or colons","Make sure that word is a top-level key in _config.yml whose value is an array of paths under _includes","Sweep every template for bare tags: grep -rnE 'include_array\\s*%}' . and fix each hit","If you only need one partial, use Jekyll's built-in {% include file.html %} instead"],"exampleFix":"// before\n{% include_array %}\n\n// after\n{% include_array asides %}\n\n# _config.yml\nasides: [asides/twitter.html, asides/custom/my_picture.html]","handlingStrategy":"validation","validationCode":"# Fail fast before the build: find include_array tags whose argument cannot parse\nQUOTED = /\\A#{Liquid::QuotedFragment}+\\z/\nDir.glob('**/*.{html,markdown,erb}').each do |path|\n  File.read(path).scan(/\\{%\\s*include_array\\s*(.*?)\\s*%\\}/m).flatten.each do |arg|\n    warn \"#{path}: {% include_array %} needs exactly one _config.yml array name\" if arg.to_s !~ QUOTED\n  end\nend","typeGuard":"# Returns true when the markup include_array would accept\ndef valid_include_array_markup?(markup)\n  markup.to_s =~ /\\A#{Jekyll::IncludeArrayTag::Syntax}\\z/ ? true : false\nend","tryCatchPattern":"begin\n  Liquid::Template.parse(source)\nrescue SyntaxError => e\n  if e.message.include?(\"include_array\")\n    abort \"Template error: every {% include_array %} tag needs one _config.yml array key — #{e.message}\"\n  end\n  raise\nend","preventionTips":["Always give include_array exactly one bare argument: {% include_array asides %}","Keep the matching array key defined at the top level of _config.yml","Grep templates for bare tags before deploying: grep -rnE 'include_array\\s*%}' _layouts _includes _posts","Prefer Jekyll's built-in {% include %} when you don't need a config-driven array of partials"],"tags":["jekyll","liquid","syntax-error","ruby","static-site"],"backgroundTag":"template-syntax-error","analyzedSha":"5717a50f4e4964ea8423997d6456b04c653f0348","analyzedAt":"2026-08-21T17:21:26.485Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}