Skip to content

Commit

Permalink
Fixed config types for blog plugin slugify functions
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Dec 10, 2023
1 parent 6c1cee0 commit adad823
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions material/plugins/blog/config.py
Expand Up @@ -18,7 +18,7 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

from functools import partial
from collections.abc import Callable
from mkdocs.config.config_options import Choice, Deprecated, Optional, Type
from mkdocs.config.base import Config
from pymdownx.slugs import slugify
Expand All @@ -41,7 +41,7 @@ class BlogConfig(Config):
post_url_date_format = Type(str, default = "yyyy/MM/dd")
post_url_format = Type(str, default = "{date}/{slug}")
post_url_max_categories = Type(int, default = 1)
post_slugify = Type(partial, default = slugify(case = "lower"))
post_slugify = Type(Callable, default = slugify(case = "lower"))
post_slugify_separator = Type(str, default = "-")
post_excerpt = Choice(["optional", "required"], default = "optional")
post_excerpt_max_authors = Type(int, default = 1)
Expand All @@ -62,7 +62,7 @@ class BlogConfig(Config):
categories = Type(bool, default = True)
categories_name = Type(str, default = "blog.categories")
categories_url_format = Type(str, default = "category/{slug}")
categories_slugify = Type(partial, default = slugify(case = "lower"))
categories_slugify = Type(Callable, default = slugify(case = "lower"))
categories_slugify_separator = Type(str, default = "-")
categories_allowed = Type(list, default = [])
categories_toc = Optional(Type(bool))
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/blog/config.py
Expand Up @@ -18,7 +18,7 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

from functools import partial
from collections.abc import Callable
from mkdocs.config.config_options import Choice, Deprecated, Optional, Type
from mkdocs.config.base import Config
from pymdownx.slugs import slugify
Expand All @@ -41,7 +41,7 @@ class BlogConfig(Config):
post_url_date_format = Type(str, default = "yyyy/MM/dd")
post_url_format = Type(str, default = "{date}/{slug}")
post_url_max_categories = Type(int, default = 1)
post_slugify = Type(partial, default = slugify(case = "lower"))
post_slugify = Type(Callable, default = slugify(case = "lower"))
post_slugify_separator = Type(str, default = "-")
post_excerpt = Choice(["optional", "required"], default = "optional")
post_excerpt_max_authors = Type(int, default = 1)
Expand All @@ -62,7 +62,7 @@ class BlogConfig(Config):
categories = Type(bool, default = True)
categories_name = Type(str, default = "blog.categories")
categories_url_format = Type(str, default = "category/{slug}")
categories_slugify = Type(partial, default = slugify(case = "lower"))
categories_slugify = Type(Callable, default = slugify(case = "lower"))
categories_slugify_separator = Type(str, default = "-")
categories_allowed = Type(list, default = [])
categories_toc = Optional(Type(bool))
Expand Down

0 comments on commit adad823

Please sign in to comment.