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 global layout configuration #425

Merged
merged 2 commits into from
Dec 30, 2020
Merged

Conversation

fluffy-critter
Copy link
Collaborator

Summary

Adds the ability to globally configure the default layout settings for entry.body/entry.more/etc.

Closes #424

Detailed description

The configuration object now takes an additional dict, layout, which provides defaults for layout methods. For example,

app = publ.Publ(name, {
    'layout': {
        'max_width': 768,
        'max_height': 1024
    }
})

Additionally, some fixes were made to how default attributes get applied to pure-HTML entries, and external images now use CSS to specify the container size instead of always applying max_width to the width attribute.

Developer/user impact

Test plan

Added a global max_width default of 768 to the test app, and verified that all of the larger-than-768xwhatever images were clamped to 768xwhatever, and that it could be overridden on a per-image basis if needed.

Got a site to show off?

@fluffy-critter fluffy-critter merged commit 099f8f2 into main Dec 30, 2020
@fluffy-critter fluffy-critter deleted the feature/424-layout-defaults branch March 20, 2022 19:26
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.

Global layout defaults
1 participant