From 116028a1d22c708fcd3f876b6068b7194626144f Mon Sep 17 00:00:00 2001 From: "l.feng" <43399351+msclock@users.noreply.github.com> Date: Sun, 1 Dec 2024 15:15:37 +0800 Subject: [PATCH] fix: mkdocs nox commands and refine conf file (#18) Signed-off-by: l.feng <43399351+msclock@users.noreply.github.com> --- ...[% if docs_type == 'mkdocs' %]mkdocs.yml[% endif %].jinja | 5 +++-- template/noxfile.py.jinja | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/template/[% if docs_type == 'mkdocs' %]mkdocs.yml[% endif %].jinja b/template/[% if docs_type == 'mkdocs' %]mkdocs.yml[% endif %].jinja index 182008d..45f97a9 100644 --- a/template/[% if docs_type == 'mkdocs' %]mkdocs.yml[% endif %].jinja +++ b/template/[% if docs_type == 'mkdocs' %]mkdocs.yml[% endif %].jinja @@ -1,5 +1,6 @@ [% from pathjoin("includes", "variable.jinja") import repo_url with context -%] [% from pathjoin("includes", "variable.jinja") import page_url with context -%] +[%- from pathjoin("includes", "utilities.jinja") import first_letters with context -%] site_name: {{ project_name }} site_description: {{ project_description }} @@ -12,6 +13,7 @@ docs_dir: . exclude_docs: | out + build docs/includes [%- if repo_name == 'ss-pybind11' %] template @@ -19,6 +21,7 @@ exclude_docs: | theme: name: material + favicon: "https://img.shields.io/badge/{{ first_letters(project_name) }}-blue" features: - content.action.edit @@ -103,8 +106,6 @@ plugins: enable_creation_date: true fallback_to_build_date: true type: datetime - exclude: - - out/* - minify: minify_html: true minify_js: true diff --git a/template/noxfile.py.jinja b/template/noxfile.py.jinja index 4136d96..3ff4ff3 100644 --- a/template/noxfile.py.jinja +++ b/template/noxfile.py.jinja @@ -94,9 +94,9 @@ def docs(session: nox.Session) -> None: shared_args.append("--strict") if args.serve: - session.run("mkdocs", "--serve") + session.run("mkdocs", "serve", *posargs) else: - session.run("mkdocs", "build", "-d", "docs/_build/html") + session.run("mkdocs", *shared_args) [% endif %] @nox.session