From 979063d7283d0237ab23247401f332ba34a7c51f Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Sat, 18 Nov 2023 11:47:04 +0000 Subject: [PATCH] Updt grid spacing on latest posts --- custom/__init__.py | 18 +++++---- custom/__pycache__/__init__.cpython-310.pyc | Bin 1195 -> 1196 bytes docs/index.md | 40 +++++++++++++------- setup.py | 23 ++++++----- 4 files changed, 49 insertions(+), 32 deletions(-) diff --git a/custom/__init__.py b/custom/__init__.py index 9c6b9c6..8451307 100644 --- a/custom/__init__.py +++ b/custom/__init__.py @@ -1,8 +1,8 @@ from mkdocs.plugins import BasePlugin import re -class MyCustom(BasePlugin): +class MyCustom(BasePlugin): def on_nav(self, nav, config, files): self.nav = nav @@ -11,13 +11,17 @@ def on_nav(self, nav, config, files): page.read_source(config) def recent_pages(): - #import ipdb; ipdb.set_trace() - return [page for page in self.nav.pages if page.parent \ - and re.match(r'\d{4}', page.parent.title) \ - and 'image' in page.meta] + # import ipdb; ipdb.set_trace() + return [ + page + for page in self.nav.pages + if page.parent + and re.match(r"\d{4}", page.parent.title) + and "image" in page.meta + ] - setattr(nav, 'recent_pages', recent_pages) + setattr(nav, "recent_pages", recent_pages) return nav def on_page_context(self, context, page, config, nav): - return context \ No newline at end of file + return context diff --git a/custom/__pycache__/__init__.cpython-310.pyc b/custom/__pycache__/__init__.cpython-310.pyc index 5bf40a6e56e8c0ce19c01aafa327271c5ab83984..f4208e9e2a82c05bea0d656af913532d436e8ba2 100644 GIT binary patch delta 108 zcmZ3@xrUQBpO=@50SGQHj!3<=k@qMgqxa;?jFyu{nUuwZfZ}WnOiV0{On>=UnEr6F zGW}s=ne4$-%*6(hVgkZ{lMgb@VdR<|$6UiGHTgDk9zQEksu(2C!N9@DBQiOHC5Vw3 E08jE3j{pDw delta 113 zcmZ3(xtfzVpO=@50SILIO;cBI .grid-item { - border: 2px solid #eee; - padding: 2em; - display: inline-block; - width: 18em; - height: 20em; - vertical-align: middle; + border: 2px solid #eee; + padding: 1em; + display: inline-block; + width: 18em; + height: 20em; + vertical-align: middle; + margin-bottom: 0.5em; +} + +.grid-item .content { + display: flex; + flex-direction: column; + justify-content: center; + height: 100%; } +
+ {% for page in navigation.recent_pages() %} -{% endfor %} \ No newline at end of file +{% endfor %} +
\ No newline at end of file diff --git a/setup.py b/setup.py index dfa25b7..78dc95a 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,16 @@ from distutils.core import setup setup( - name='mkdocs-custom', - version='0.0.1', - author='Scott Pierce', - author_email='ddrscott@gmail.com', - packages=['custom'], - description='Local custom plugin', - install_requires=['mkdocs', 'jinja2'], - + name="mkdocs-custom", + version="0.0.1", + author="Scott Pierce", + author_email="ddrscott@gmail.com", + packages=["custom"], + description="Local custom plugin", + install_requires=["mkdocs", "jinja2"], entry_points={ - 'mkdocs.plugins': [ - 'custom = custom:MyCustom', + "mkdocs.plugins": [ + "custom = custom:MyCustom", ] - } -) \ No newline at end of file + }, +)