diff --git a/mkdocs_nype/macros_includes/contact_form.md b/mkdocs_nype/macros_includes/contact_form.md new file mode 100644 index 0000000..eb9541d --- /dev/null +++ b/mkdocs_nype/macros_includes/contact_form.md @@ -0,0 +1,56 @@ +{#- + !!!NOTE: This macro is included in all contact.md / offer.md / free-offer.md files. Edit with caution. +-#} + +{%- include 'setup_vars.md' -%} + +{#- nype_config is the reference to page.meta.nype_config, so modify this to pass data to the theme templates. -#} +{%- set _ = nype_config.required_js_keys.update({ 'contact_form_action_hex': {} }) -%} + +{%- set email_label = "E-mail:" if nype_config.js.contact_form_allow_personal_emails else "Company E-mail:" -%} +{%- set email_placeholder = "Input your e-mail" if nype_config.js.contact_form_allow_personal_emails else "Input your company e-mail" -%} + +
+
+ + + + + + + + + +
+
\ No newline at end of file diff --git a/mkdocs_nype/macros_includes/discord_invite.md b/mkdocs_nype/macros_includes/discord_invite.md index 3985536..ded60ed 100644 --- a/mkdocs_nype/macros_includes/discord_invite.md +++ b/mkdocs_nype/macros_includes/discord_invite.md @@ -1,10 +1,4 @@ -{%- if not nype_config -%} - {%- set nype_config = {} -%} -{%- endif -%} - -{%- if not nype_config.js -%} - {%- set _ = nype_config.update({ 'js': {} }) -%} -{%- endif -%} +{%- include 'setup_vars.md' -%} {%- set discord_invite = nype_config.js.discord_invite or "" -%} {%- set discord_header = nype_config.discord_header or "" -%} @@ -12,6 +6,9 @@ {%- set discord_title = nype_config.discord_title or "" -%} {%- set discord_button = nype_config.discord_button or "Join" -%} +{#- nype_config is the reference to page.meta.nype_config, so modify this to pass data to the theme templates. -#} +{%- set _ = nype_config.required_js_keys.update({ 'discord_invite': {} }) -%} +

Loading...

diff --git a/mkdocs_nype/macros_includes/hidden_email.md b/mkdocs_nype/macros_includes/hidden_email.md new file mode 100644 index 0000000..3cf7dcf --- /dev/null +++ b/mkdocs_nype/macros_includes/hidden_email.md @@ -0,0 +1,10 @@ +{#- + !!!NOTE: This macro is included in all contact.md / offer.md / free-offer.md files. Edit with caution. +-#} + +{%- include 'setup_vars.md' -%} + +{#- nype_config is the reference to page.meta.nype_config, so modify this to pass data to the theme templates. -#} +{%- set _ = nype_config.required_js_keys.update({ 'contact_form_email_hex': {} }) -%} + +{#- Whitespace #} `Show e-mail` {# Whitespace -#} \ No newline at end of file diff --git a/mkdocs_nype/macros_includes/setup_vars.md b/mkdocs_nype/macros_includes/setup_vars.md new file mode 100644 index 0000000..fa51a01 --- /dev/null +++ b/mkdocs_nype/macros_includes/setup_vars.md @@ -0,0 +1,15 @@ +{%- if page.meta and not page.meta.nype_config -%} + {%- set _ = page.meta.update({ 'nype_config': {} }) -%} +{%- endif -%} + +{%- if not nype_config -%} + {%- set nype_config = page.meta.nype_config -%} +{%- endif -%} + +{%- if not nype_config.js -%} + {%- set _ = nype_config.update({ 'js': {} }) -%} +{%- endif -%} + +{%- if not nype_config.required_js_keys -%} + {%- set _ = nype_config.update({ 'required_js_keys': {} }) -%} +{%- endif -%} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index adcadd5..051be7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "hatchling.build" [project] name = "mkdocs-nype" -version = "0.16.5" +version = "0.16.6" description = "MkDocs theme for Nype MkDocs projects, extends the Material for MkDocs theme" authors = [ { name = "Kamil Krzyśków", email = "kk@npe.cm" }