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

check for filename and use filename title before class.name #532

Open
kjaymiller opened this issue Jan 19, 2024 · 0 comments
Open

check for filename and use filename title before class.name #532

kjaymiller opened this issue Jan 19, 2024 · 0 comments
Labels
good first issue Good for newcomers
Milestone

Comments

@kjaymiller
Copy link
Collaborator

Current Implementation uses the __class__.__name__ attribute

@property
def _title(self) -> str:
"""
The title of the Page
If no title is provided, use the class name.
"""
return getattr(self, "title", self.__class__.__name__)

If there is a content_path defined, would it be better to use the filename instead.

This would solve a the issue of overwritting files in a collection when no title is provided.

I would also be okay with raising warnings for this case.

@kjaymiller kjaymiller added the good first issue Good for newcomers label Jan 19, 2024
@kjaymiller kjaymiller added this to the 2024.2.1 milestone Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: No status
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant