File tree 2 files changed +38
-0
lines changed
2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 51
51
mkdir -p _site/blog
52
52
bundle exec jekyll build --source . --destination _site --config _config.yml --drafts
53
53
54
+ - name : List files for debugging
55
+ run : ls -la . bin/ _site/ _drafts/
56
+
54
57
- name : Set permissions on _site
55
58
run : chmod -R a-w _site
56
59
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Directory containing posts
4
+ POSTS_DIR=" _posts"
5
+
6
+ # Flag to track if any inconsistencies are found
7
+ inconsistent=false
8
+
9
+ # Iterate over each post file in the _posts directory
10
+ for file in " $POSTS_DIR " /* .md; do
11
+ # Extract filename without extension
12
+ filename=$( basename " $file " .md)
13
+
14
+ # Extract date from filename (assumes format YYYY-MM-DD-title)
15
+ file_date=$( echo " $filename " | cut -d' -' -f1-3 | sed ' s/-//g' )
16
+
17
+ # Extract date from front matter
18
+ frontmatter_date=$( sed -n ' s/^date: \(.*\)/\1/p' " $file " | cut -d' T' -f1)
19
+
20
+ # Compare file date with front matter date
21
+ if [ " $file_date " != " $frontmatter_date " ]; then
22
+ echo " Inconsistency found in $file :"
23
+ echo " Filename date: $file_date "
24
+ echo " Front matter date: $frontmatter_date "
25
+ inconsistent=true
26
+ fi
27
+ done
28
+
29
+ # Exit with error if inconsistencies were found
30
+ if $inconsistent ; then
31
+ echo " Inconsistencies detected. Please correct them."
32
+ exit 1
33
+ else
34
+ echo " All dates are consistent."
35
+ fi
You can’t perform that action at this time.
0 commit comments