Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
mateus2k2 committed Jun 21, 2024
1 parent ae34675 commit 8e8aedf
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN apk add --no-cache --virtual .build-deps gcc libc-dev libxslt-dev && \
pip install --no-cache-dir lxml>=3.5.0 && \
pip install mkdocs-glightbox && \
pip install mkdocs-rss-plugin && \
pip install mkdocs-macros-plugin && \
apk del .build-deps

RUN pip install --no-cache-dir \
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN apk add --no-cache --virtual .build-deps gcc libc-dev libxslt-dev && \
pip install --no-cache-dir lxml>=3.5.0 && \
pip install mkdocs-glightbox && \
pip install mkdocs-rss-plugin && \
pip install mkdocs-macros-plugin && \
apk del .build-deps

RUN pip install --no-cache-dir \
Expand Down
2 changes: 2 additions & 0 deletions docs/en/blog/posts/teste1.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ slug: test1

## teste 1

{{ price(teste_macro_var, 50) }}

loremloremloremlorem loremlorem loremlorem loremlorem loremlorem loremlorem loremloremloremlorem loremlorem loremlorem loremlorem loremlorem loremlorem

<!-- more -->
Expand Down
6 changes: 6 additions & 0 deletions mkdocs.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ theme:
plugins:
- glightbox
- social
- macros:
module_name: overrides/scripts/macros
include_dir: overrides/include
on_error_fail: true
on_undefined: strict
- search:
lang: en
- blog:
Expand All @@ -59,6 +64,7 @@ plugins:
as_update: date.updated

extra:
teste_macro_var: 100
version:
provider: mike
social:
Expand Down
7 changes: 7 additions & 0 deletions mkdocs.pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ theme:
repo: fontawesome/brands/git-alt

plugins:
- glightbox
- social
- macros:
module_name: overrides/scripts/macros
include_dir: overrides/include
on_error_fail: true
on_undefined: strict
- search:
lang: pt
- blog:
Expand All @@ -57,6 +63,7 @@ plugins:
as_update: date.updated

extra:
teste_macro_var: 10
version:
provider: mike
social:
Expand Down
Empty file added overrides/include/keep
Empty file.
9 changes: 9 additions & 0 deletions overrides/scripts/macros.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def define_env(env):
"""
This is the hook for the functions (new form)
"""

@env.macro
def price(unit_price, no):
"Calculate price"
return unit_price * no

0 comments on commit 8e8aedf

Please sign in to comment.