mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed config types for blog plugin slugify functions
This commit is contained in:
parent
6c1cee0a01
commit
adad8238c6
@ -18,7 +18,7 @@
|
|||||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
# IN THE SOFTWARE.
|
# 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.config_options import Choice, Deprecated, Optional, Type
|
||||||
from mkdocs.config.base import Config
|
from mkdocs.config.base import Config
|
||||||
from pymdownx.slugs import slugify
|
from pymdownx.slugs import slugify
|
||||||
@ -41,7 +41,7 @@ class BlogConfig(Config):
|
|||||||
post_url_date_format = Type(str, default = "yyyy/MM/dd")
|
post_url_date_format = Type(str, default = "yyyy/MM/dd")
|
||||||
post_url_format = Type(str, default = "{date}/{slug}")
|
post_url_format = Type(str, default = "{date}/{slug}")
|
||||||
post_url_max_categories = Type(int, default = 1)
|
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_slugify_separator = Type(str, default = "-")
|
||||||
post_excerpt = Choice(["optional", "required"], default = "optional")
|
post_excerpt = Choice(["optional", "required"], default = "optional")
|
||||||
post_excerpt_max_authors = Type(int, default = 1)
|
post_excerpt_max_authors = Type(int, default = 1)
|
||||||
@ -62,7 +62,7 @@ class BlogConfig(Config):
|
|||||||
categories = Type(bool, default = True)
|
categories = Type(bool, default = True)
|
||||||
categories_name = Type(str, default = "blog.categories")
|
categories_name = Type(str, default = "blog.categories")
|
||||||
categories_url_format = Type(str, default = "category/{slug}")
|
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_slugify_separator = Type(str, default = "-")
|
||||||
categories_allowed = Type(list, default = [])
|
categories_allowed = Type(list, default = [])
|
||||||
categories_toc = Optional(Type(bool))
|
categories_toc = Optional(Type(bool))
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
# IN THE SOFTWARE.
|
# 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.config_options import Choice, Deprecated, Optional, Type
|
||||||
from mkdocs.config.base import Config
|
from mkdocs.config.base import Config
|
||||||
from pymdownx.slugs import slugify
|
from pymdownx.slugs import slugify
|
||||||
@ -41,7 +41,7 @@ class BlogConfig(Config):
|
|||||||
post_url_date_format = Type(str, default = "yyyy/MM/dd")
|
post_url_date_format = Type(str, default = "yyyy/MM/dd")
|
||||||
post_url_format = Type(str, default = "{date}/{slug}")
|
post_url_format = Type(str, default = "{date}/{slug}")
|
||||||
post_url_max_categories = Type(int, default = 1)
|
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_slugify_separator = Type(str, default = "-")
|
||||||
post_excerpt = Choice(["optional", "required"], default = "optional")
|
post_excerpt = Choice(["optional", "required"], default = "optional")
|
||||||
post_excerpt_max_authors = Type(int, default = 1)
|
post_excerpt_max_authors = Type(int, default = 1)
|
||||||
@ -62,7 +62,7 @@ class BlogConfig(Config):
|
|||||||
categories = Type(bool, default = True)
|
categories = Type(bool, default = True)
|
||||||
categories_name = Type(str, default = "blog.categories")
|
categories_name = Type(str, default = "blog.categories")
|
||||||
categories_url_format = Type(str, default = "category/{slug}")
|
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_slugify_separator = Type(str, default = "-")
|
||||||
categories_allowed = Type(list, default = [])
|
categories_allowed = Type(list, default = [])
|
||||||
categories_toc = Optional(Type(bool))
|
categories_toc = Optional(Type(bool))
|
||||||
|
Loading…
Reference in New Issue
Block a user