Skip to content

Commit

Permalink
chore: add hero block to PageTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Sep 22, 2023
1 parent 81d3264 commit 32dd981
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mknodes/manual/navs_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,14 @@ def create_template_page(page: mk.MkPage):
text = (
'page.template.announce_block.content = mk.MkMetadataBadges(typ="classifiers")\n'
"page.template.footer_block.content = mk.MkProgressBar(50)\n"
f'page.template.tabs_block.content = mk.MkCode("{code}")'
f'page.template.tabs_block.content = mk.MkCode("{code}")\n'
'page.template.hero_block.content = mk.MkHeader("A header!")'
)
page += mk.MkCode(text)
page.template.announce_block.content = mk.MkMetadataBadges(typ="classifiers")
page.template.footer_block.content = mk.MkProgressBar(50)
page.template.tabs_block.content = mk.MkCode(f"{code}")
page.template.hero_block.content = mk.MkHeader("A header!")


def create_mkdefaultwebsite_section(nav: mk.MkNav):
Expand Down
2 changes: 2 additions & 0 deletions mknodes/pages/pagetemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(
self.footer_block = templateblocks.FooterBlock(parent)
self.libs_block = templateblocks.LibsBlock()
self.styles_block = templateblocks.StylesBlock()
self.hero_block = templateblocks.HeroBlock()

def __bool__(self):
return any(self.blocks)
Expand All @@ -47,6 +48,7 @@ def blocks(self) -> list[templateblocks.Block]:
self.libs_block,
self.styles_block,
self.outdated_block,
self.hero_block,
]

def __repr__(self):
Expand Down
4 changes: 4 additions & 0 deletions mknodes/pages/templateblocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ class FooterBlock(HtmlBlock):
block_id = "footer"


class HeroBlock(HtmlBlock):
block_id = "hero"


class OutdatedBlock(HtmlBlock):
block_id = "outdated"

Expand Down

0 comments on commit 32dd981

Please sign in to comment.