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

Fix section.transparent serialization #2462

Merged
merged 1 commit into from
Mar 21, 2024
Merged

Fix section.transparent serialization #2462

merged 1 commit into from
Mar 21, 2024

Conversation

wold5
Copy link
Contributor

@wold5 wold5 commented Mar 19, 2024

Fixes passing section.transparent for e8b04bb and #1840

I cobbled a test together from the examples, but suspect it only checks for a section having transparent set internally, and not a template having access to {{ section.transparent }}... Since both rely on meta.transparent anyway, it's perhaps best to leave it at this.

If you have any remarks, let me know.

#[test]
fn check_transparancy() {
    let (mut site, _tmp_dir, _public) = build_site("test_site");
    site.load().unwrap();

    let mut path = env::current_dir().unwrap().parent().unwrap().parent().unwrap().to_path_buf();
    path.push("test_site");
    let posts_path = path.join("content").join("posts");
    let transparent_section_path = posts_path.join("2018");

    let library = site.library.read().unwrap();
    let section = library.sections.get(&transparent_section_path.join("_index.md")).unwrap();   
    assert_eq!(section.meta.transparent, true);
}

Fixes passing section.transparency for
getzola#1840
Copy link
Collaborator

@Keats Keats left a comment

Choose a reason for hiding this comment

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

Thanks

@Keats Keats merged commit 7a12e62 into getzola:next Mar 21, 2024
5 checks passed
veluca93 pushed a commit to veluca93/zola that referenced this pull request May 14, 2024
Keats pushed a commit that referenced this pull request Jun 20, 2024
Fixes passing section.transparency for
#1840
berdandy pushed a commit to berdandy/azola that referenced this pull request Sep 17, 2024
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