mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-19 06:06:54 +00:00
Improved script tools.
This commit is contained in:
@@ -11,6 +11,8 @@ MIT License
|
||||
'''
|
||||
|
||||
import sys
|
||||
import os
|
||||
import glob
|
||||
|
||||
|
||||
def get_yaml(path):
|
||||
@@ -37,6 +39,16 @@ def get_yaml(path):
|
||||
return yaml, num
|
||||
|
||||
|
||||
def get_makrdown_files(path):
|
||||
MD_EXTENSIONS = ["md", "markdown", "markdn", "mdown"]
|
||||
ret_files = []
|
||||
|
||||
for extension in MD_EXTENSIONS:
|
||||
ret_files.extend(glob.glob(os.path.join(path, "*." + extension)))
|
||||
|
||||
return ret_files
|
||||
|
||||
|
||||
def check_py_version():
|
||||
if not sys.version_info.major == 3 and sys.version_info.minor >= 5:
|
||||
print("WARNING: This script requires Python 3.5 or higher, "
|
||||
|
||||
Reference in New Issue
Block a user