diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e510e07..460130a 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,10 +20,10 @@ - id: eslint name: eslint language: system - entry: sh -c 'eslint templates/js/*.js' - files: '' + entry: sh -c 'eslint static/js/*.js' + files: ^static/js/ - id: stylelint name: stylelint language: system entry: sh -c 'stylelint static/main.css' - files: '' + files: ^static/js/main.css$ diff --git a/gen_imgs_from_mds.py b/gen_imgs_from_mds.py index 18c5a5a..229fd2e 100755 --- a/gen_imgs_from_mds.py +++ b/gen_imgs_from_mds.py @@ -8,6 +8,8 @@ SMALLEST['jpg'] = SMALLEST['jpeg'] = b'\xff\xd8\xff\xdb\x00C\x00\x03\x02\x02\x02 SMALLEST['png'] = b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82' def gen_img(img_url): + if img_url[0] == '/': + img_url = img_url[1:] if os.path.exists(img_url): return os.makedirs(os.path.dirname(img_url), exist_ok=True)