fix: Removed content from Template_Context.

now accessible only through page.content.
This commit is contained in:
Spencer Brower
2026-07-28 11:45:21 -04:00
parent d51172c836
commit fcf349eb51
+1 -4
View File
@@ -13,7 +13,6 @@ import "core:time/datetime"
Template_Context :: struct { Template_Context :: struct {
params: json.Value, params: json.Value,
now: string, now: string,
content: string,
title: string, title: string,
description: string, description: string,
og: Open_Graph, og: Open_Graph,
@@ -154,6 +153,7 @@ render_site :: proc(site: ^Site) {
break break
} }
} }
ctx.page = home
// Collect sections // Collect sections
sections := make(map[string]bool) sections := make(map[string]bool)
@@ -248,7 +248,6 @@ render_page_html :: proc(
ctx := ctx ctx := ctx
ctx.title = fmt.tprintf("%s | %s", page.title, site.title) ctx.title = fmt.tprintf("%s | %s", page.title, site.title)
ctx.page = page ctx.page = page
ctx.content = page.content
ctx.og = og_for_page(site.og, page) ctx.og = og_for_page(site.og, page)
return render_template(content_tpl, ctx, partials) return render_template(content_tpl, ctx, partials)
} }
@@ -270,7 +269,6 @@ render_home_html :: proc(
ctx := ctx ctx := ctx
ctx.title = site.title ctx.title = site.title
ctx.content = home.content
ctx.pages = list_pages ctx.pages = list_pages
ctx.og = og_for_page(site.og, home) ctx.og = og_for_page(site.og, home)
@@ -296,7 +294,6 @@ render_section :: proc(
ctx := ctx ctx := ctx
if has_index { if has_index {
ctx.content = section_index.content
ctx.page = section_index ctx.page = section_index
ctx.title = fmt.tprintf("%s | %s", section_index.title, site.title) ctx.title = fmt.tprintf("%s | %s", section_index.title, site.title)
ctx.og = og_for_page(site.og, section_index) ctx.og = og_for_page(site.og, section_index)