diff --git a/cspell.config.yml b/cspell.config.yml index 60279518..e7874c37 100644 --- a/cspell.config.yml +++ b/cspell.config.yml @@ -4,6 +4,7 @@ words: - Cachy - cppcoreguidelines - fontawesome + - htmltitle - hustcer - imgproxy - inlinehilite diff --git a/docs/index.md b/docs/index.md index dbc0e3d8..93387793 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,3 +1,8 @@ +--- +title: clang-format and clang-tidy GitHub Action +description: Run clang-format and clang-tidy on the C/C++ files a pull request changes, with annotations, review suggestions and a thread comment. +--- + [file-annotations]: inputs-outputs.md#file-annotations [thread-comments]: inputs-outputs.md#thread-comments [step-summary]: inputs-outputs.md#step-summary diff --git a/docs/overrides/404.html b/docs/overrides/404.html new file mode 100644 index 00000000..40202e8b --- /dev/null +++ b/docs/overrides/404.html @@ -0,0 +1,14 @@ +{% extends "main.html" %} + +{#- + Gives the 404 page a title of its own, so that missing pages are not counted + under the home page's title in Google Analytics. +-#} + +{% block htmltitle %} + Page not found - {{ config.site_name }} +{% endblock %} + +{% block content %} +

404 - Not found

+{% endblock %} diff --git a/docs/overrides/main.html b/docs/overrides/main.html new file mode 100644 index 00000000..9b77bf7d --- /dev/null +++ b/docs/overrides/main.html @@ -0,0 +1,30 @@ +{% extends "base.html" %} + +{#- + Visits from the maintainers are tagged so that the Internal Traffic data + filter in Google Analytics can drop them. These docs share the + cpp-linter.github.io origin with the organization site, which sets the flag: + opening any page there or here with ?internal=1 stores it in localStorage and + ?internal=0 removes it. While it is there, every event carries + traffic_type=internal. It runs before Material's own snippet, so the setting + is queued ahead of the first page_view. +-#} + +{% block analytics %} + {% if config.extra.analytics %} + + {% endif %} + {{ super() }} +{% endblock %} diff --git a/mkdocs.yml b/mkdocs.yml index 4401284a..b00af67f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -4,6 +4,9 @@ site_url: "https://cpp-linter.github.io/cpp-linter-action" repo_url: "https://github.com/cpp-linter/cpp-linter-action" repo_name: "cpp-linter/cpp-linter-action" edit_uri: "edit/main/docs/" +# Theme overrides live in docs/ but are not pages. +exclude_docs: | + overrides/ nav: - index.md - inputs-outputs.md @@ -16,6 +19,7 @@ nav: theme: name: material + custom_dir: docs/overrides features: - navigation.top - content.tabs.link @@ -65,6 +69,11 @@ extra: social: - icon: fontawesome/brands/github link: https://github.com/cpp-linter/cpp-linter + # The same Google Analytics property as cpp-linter.github.io and the other + # cpp-linter docs, which all share that origin. + analytics: + provider: google + property: G-JKH4SXC7HC extra_css: - https://cpp-linter.github.io/stylesheets/shared.css