Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Project: mkdocs-landing #261

Merged
merged 1 commit into from
Oct 6, 2024
Merged

Add Project: mkdocs-landing #261

merged 1 commit into from
Oct 6, 2024

Conversation

TEParsons
Copy link
Contributor

@TEParsons TEParsons commented Oct 6, 2024

What kind of change does this PR introduce?

  • Add a project
  • Update a project
  • Remove a project
  • Add or update a category
  • Change configuration
  • Documentation
  • Other, please describe:

Description:
Adds the mkdocs theme "Landing" to the catalogue - a theme designed for making personal landing pages. See Landing's website for documentation and example implementations.

Checklist:

  • I have read the CONTRIBUTING guidelines.
  • I have not modified the README.md file. Projects are only supposed to be added or updated within the projects.yaml file since the README.md file is automatically generated.

Copy link
Collaborator

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pawamoy pawamoy merged commit f8849a4 into mkdocs:main Oct 6, 2024
1 check failed
@TEParsons
Copy link
Contributor Author

Thanks for pulling this in :) So this will become visible when update-best-of-list is next run, right?

@pawamoy
Copy link
Collaborator

pawamoy commented Oct 6, 2024

Yes, it happens once a week. I can retrigger it manually today though 👍

@TEParsons
Copy link
Contributor Author

Hmm, looks like the preview isn't working, do you need to rebuild mkdocs-gallery too?

@pawamoy
Copy link
Collaborator

pawamoy commented Oct 11, 2024

Oh yes, probably, good catch.

@pawamoy
Copy link
Collaborator

pawamoy commented Oct 11, 2024

Rebuilding the gallery right now.

@pawamoy
Copy link
Collaborator

pawamoy commented Oct 11, 2024

I'm getting this error:

Traceback (most recent call last):
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/mkdocs/__main__.py", line 288, in build_command
    build.build(cfg, dirty=not clean)
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/mkdocs/commands/build.py", line 337, in build
    _build_page(
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/mkdocs/commands/build.py", line 223, in _build_page
    output = template.render(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/jinja2/environment.py", line 939, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/mkdocs_landing/main.html", line 12, in top-level template code
    {% include "partials/header_element.html" %}
^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/mkdocs_landing/partials/header_element.html", line 24, in top-level template code
    {{ config.theme.tagline | markdown(id="tagline") }}
^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/mkdocs_landing/filters.py", line 33, in parse_markdown
    html = md.convert(text)
           ^^^^^^^^^^^^^^^^
  File "/media/data/dev/mkdocs-gallery/themes/landing/.venv/lib/python3.12/site-packages/markdown/core.py", line 341, in convert
    if not source.strip():
           ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'strip'

Do I have to add extra config to mkdocs.yml (tagline)?

@TEParsons
Copy link
Contributor Author

Ahh, yes, I didn't supply a default for that so I need to handle when it's undefined. But yes if you're able to, just supplying a value for theme.tagline will do the trick. Otherwise I'll fix that in the next version & let you know when it's on pypi.

@pawamoy
Copy link
Collaborator

pawamoy commented Oct 11, 2024

Thanks!

Otherwise I'll fix that in the next version & let you know when it's on pypi.

That'd be great, the gallery builds each theme with a common template, to fix that I'd have to special case mkdocs-landing 😅 There might be other undefined variables that could cause issues so don't hesitate to let me know when you push fixes so that I can test locally and give you feedback on potential errors 🙂

@TEParsons
Copy link
Contributor Author

Okay, I've released a new version! Here's the release: https://github.com/TEParsons/mkdocs-landing/releases/tag/0.0.4

I also added a test suite and added a test that a site with no configuration at all builds, which should catch this in future. Could you link me to the specific mkdocs.yaml used to build site previews in the gallery? I'll add it to my test suite (and implement the same sort of thing for Torillic too :P )

@pawamoy
Copy link
Collaborator

pawamoy commented Oct 12, 2024

Great 🎉 Let me try to rebuild the gallery.

Sure, here's the template: https://github.com/pawamoy/mkdocs-gallery/blob/main/templates/specimen/mkdocs.yml.

@pawamoy
Copy link
Collaborator

pawamoy commented Oct 12, 2024

OK, good, preview now working 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants