瀏覽代碼

Remove dependence on mkdocs-simple-hooks

Since mkdocs v1.4, the hooks are a native feature
Tom Hubrecht 2 年之前
父節點
當前提交
99a0c72d49
共有 3 個文件被更改,包括 7 次插入7 次删除
  1. 4 3
      docs/hooks.py
  2. 3 3
      mkdocs.yml
  3. 0 1
      requirements.txt

+ 4 - 3
docs/hooks.py

@@ -1,6 +1,7 @@
 import os
 import shutil
 
-def copy_fonts(config, **kwargs):
-    site_dir = config['site_dir']
-    shutil.copytree('docs/static/fonts', os.path.join(site_dir, 'get'))
+
+def on_post_build(config, **kwargs):
+    site_dir = config["site_dir"]
+    shutil.copytree("docs/static/fonts", os.path.join(site_dir, "get"))

+ 3 - 3
mkdocs.yml

@@ -67,13 +67,13 @@ markdown_extensions:
       emoji_index: !!python/name:material.extensions.emoji.twemoji
       emoji_generator: !!python/name:materialx.emoji.to_svg
 
+hooks:
+  - docs/hooks.py
+
 plugins:
   - search
   - minify:
       minify_html: true
-  - mkdocs-simple-hooks:
-      hooks:
-        on_post_build: "docs.hooks:copy_fonts"
 
 nav:
   - "Getting started": index.md

+ 0 - 1
requirements.txt

@@ -1,4 +1,3 @@
 # The documentation uses 'mkdocs', which is written in Python
 mkdocs-material
 mkdocs-minify-plugin
-mkdocs-simple-hooks