Skip to content

Commit d585a0a

Browse files
committed
Refactor PostCSS incremental fix plugin: extract watched file patterns into a constant for reuse and clarity.
1 parent 7f3476e commit d585a0a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

_plugins/postcss_incremental_fix.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44

55
module Jekyll
66
module PostcssTrigger
7+
# File patterns to watch for changes that should trigger CSS rebuild
8+
WATCHED_FILE_PATTERNS = %w[
9+
_layouts/**/*.html
10+
_includes/**/*.html
11+
*.html
12+
*.md
13+
*/**/*.html
14+
*/**/*.md
15+
stylesheets/**/_*.css
16+
stylesheets/_*/**/*.css
17+
].freeze
18+
719
class << self
820
attr_accessor :last_check_time, :css_touched
921
end
@@ -25,7 +37,7 @@ class << self
2537
next if Jekyll::PostcssTrigger.css_touched
2638

2739
# Check if any HTML/Markdown files or included CSS files have changed
28-
content_patterns = %w[_layouts/**/*.html _includes/**/*.html *.html *.md */**/*.html */**/*.md stylesheets/**/_*.css stylesheets/_*/**/*.css]
40+
content_patterns = Jekyll::PostcssTrigger::WATCHED_FILE_PATTERNS
2941

3042
html_changed = false
3143
last_check = Jekyll::PostcssTrigger.last_check_time

0 commit comments

Comments
 (0)