mirror of
https://github.com/sbrow/thor.git
synced 2026-08-26 11:23:32 -04:00
refactor: $content, and &body renamed to $main and &content.
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
- [ ] Integrity hash
|
||||
- Allows users to verify their output didn't change after upgrading to a new version
|
||||
- [ ] Content-hash fingerprinting for CSS and JS cache busting
|
||||
- [ ] try to combine render_page_html and render_home_html?
|
||||
- [ ] Avoid `json.Value` / `json.Object` where possible.
|
||||
- [ ] Create a json schema file for `thor.json`.
|
||||
- [ ] make `parse` an overload of `parse_text/parse_inline` and `parse_file`, or something.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</head>
|
||||
<body>
|
||||
{{$nav}}{{/nav}}
|
||||
{{$content}}{{/content}}
|
||||
{{$main}}{{/main}}
|
||||
{{$sidebar}}{{/sidebar}}
|
||||
{{$footer}}{{/footer}}
|
||||
</body>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</ul>
|
||||
</nav>
|
||||
{{/nav}}
|
||||
{{$content}}
|
||||
{{$main}}
|
||||
<main>
|
||||
<h1>Archive</h1>
|
||||
{{#posts | group_by year}}
|
||||
@@ -26,7 +26,7 @@
|
||||
</section>
|
||||
{{/posts}}
|
||||
</main>
|
||||
{{/content}}
|
||||
{{/main}}
|
||||
{{$sidebar}}
|
||||
<aside>
|
||||
<h3>Recent Comments</h3>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{> nav}}{{$content}}{{/content}}
|
||||
{{> nav}}{{$main}}{{/main}}
|
||||
{{> footer}}
|
||||
</body>
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{{<base}}
|
||||
{{$content}}
|
||||
{{$main}}
|
||||
<main>
|
||||
<header>
|
||||
{{&body}}
|
||||
{{&content}}
|
||||
</header>
|
||||
<ul>
|
||||
{{#pages}} <li><a href="{{permalink}}">{{&title}}</a><span>{{#date_iso}}<time
|
||||
@@ -11,5 +11,5 @@
|
||||
{{/pages}}
|
||||
</ul>
|
||||
</main>
|
||||
{{/content}}
|
||||
{{/main}}
|
||||
{{/base}}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{{<base}}
|
||||
{{$content}}
|
||||
{{$main}}
|
||||
<main>
|
||||
<article>
|
||||
<h1>{{page_title}}</h1>
|
||||
{{#date_iso}} <time class="subtitle" datetime="{{date_iso}}">{{date_display}}</time>
|
||||
{{/date_iso}} {{&body}}
|
||||
{{/date_iso}} {{&content}}
|
||||
</article>
|
||||
</main>
|
||||
{{/content}}
|
||||
{{/main}}
|
||||
{{/base}}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{{<base}}
|
||||
{{$content}}
|
||||
{{$main}}
|
||||
<main>
|
||||
<h1>{{page_title}}</h1>
|
||||
{{&body}}
|
||||
{{&content}}
|
||||
{{#posts | group_by year}}
|
||||
<section>
|
||||
<h2>{{key}}</h2>
|
||||
@@ -15,5 +15,5 @@
|
||||
</section>
|
||||
{{/posts}}
|
||||
</main>
|
||||
{{/content}}
|
||||
{{/main}}
|
||||
{{/base}}
|
||||
|
||||
+4
-4
@@ -21,7 +21,7 @@ Page_Context :: struct {
|
||||
Base_Data :: struct {
|
||||
now: string,
|
||||
params: json.Value,
|
||||
body: string,
|
||||
content: string,
|
||||
title: string,
|
||||
description: string,
|
||||
og: Open_Graph,
|
||||
@@ -279,7 +279,7 @@ render_page_html :: proc(
|
||||
}
|
||||
data.title = fmt.tprintf("%s | %s", page.title, site.title)
|
||||
data.page_title = page.title
|
||||
data.body = page.body_html
|
||||
data.content = page.body_html
|
||||
data.date = page.date
|
||||
data.og = og_for_page(site.og, page)
|
||||
return render_template(content_tpl, data, partials)
|
||||
@@ -305,7 +305,7 @@ render_home_html :: proc(
|
||||
base = base,
|
||||
}
|
||||
data.title = site.title
|
||||
data.body = home.body_html
|
||||
data.content = home.body_html
|
||||
data.pages = list_pages
|
||||
data.og = og_for_page(site.og, home)
|
||||
return render_template(content_tpl, data, partials)
|
||||
@@ -333,7 +333,7 @@ render_section :: proc(
|
||||
base = base,
|
||||
}
|
||||
if has_index {
|
||||
data.body = section_index.body_html
|
||||
data.content = section_index.body_html
|
||||
data.page_title = section_index.title
|
||||
data.title = fmt.tprintf("%s | %s", section_index.title, site.title)
|
||||
data.og = og_for_page(site.og, section_index)
|
||||
|
||||
Reference in New Issue
Block a user