添加一种新的 frontmatter 格式 (#466)
continuous-integration/drone/push Build is passing

This commit is contained in:
neveler
2026-06-07 17:31:45 +08:00
committed by GitHub
parent aa9f72ebfe
commit 8898bb5997
17 changed files with 45 additions and 30 deletions
+13
View File
@@ -0,0 +1,13 @@
module Jekyll
class Document
YAML_FRONT_MATTER_REGEXP = %r!\A(?:---|/\* @frontmatter)\s*\n(.*?\n?)^((?:---|\*/|\.\.\.)\s*$\n?)!m.freeze
end
module Utils
def has_yaml_header?(file)
File.open(file, "rb", &:readline).match? %r!\A(---|/\* @frontmatter)\s*\r?\n!
rescue EOFError
false
end
end
end