File tree 2 files changed +7
-8
lines changed
2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -72,10 +72,13 @@ def check
72
72
73
73
posts . each do |doc |
74
74
errors [ doc ] << "missing author variable" if doc . author_missing?
75
- errors [ doc ] << "missing translator variable" if doc . translator_missing?
76
- errors [ doc ] << "missing or invalid date variable" if doc . date_missing?
77
75
errors [ doc ] << "date mismatch between filename and YAML front matter (UTC)" if doc . date_mismatch?
78
76
errors [ doc ] << "wrong time zone offset in YAML front matter (not UTC)" if doc . yaml_date_not_utc?
77
+
78
+ unless doc . old_post?
79
+ errors [ doc ] << "missing translator variable" if doc . translator_missing?
80
+ errors [ doc ] << "missing or invalid date variable" if doc . date_missing?
81
+ end
79
82
end
80
83
end
81
84
Original file line number Diff line number Diff line change @@ -32,20 +32,16 @@ def author_missing?
32
32
end
33
33
34
34
def translator_missing?
35
- return nil if old_post?
36
-
37
35
!yaml . has_key? ( "translator" )
38
36
end
39
37
40
38
# date missing or invalid
41
39
def date_missing?
42
- return nil if old_post?
43
-
44
40
yaml [ "date" ] . nil? || !yaml [ "date" ] . respond_to? ( :getutc )
45
41
end
46
42
47
43
def date_mismatch?
48
- return nil if ( date_missing? || old_post? )
44
+ return nil if date_missing?
49
45
50
46
yaml_date_utc != slug_date
51
47
end
@@ -59,7 +55,7 @@ def slug_date
59
55
end
60
56
61
57
def yaml_date_not_utc?
62
- return nil if ( date_missing? || old_post? )
58
+ return nil if date_missing?
63
59
64
60
yaml [ "date" ] . utc_offset != 0
65
61
end
You can’t perform that action at this time.
0 commit comments