mirror of
https://gitee.com/huanghongxun/HMCL-docs.git
synced 2026-09-15 08:31:11 +08:00
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user