-
Notifications
You must be signed in to change notification settings - Fork 972
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add additional tests for unrendered pages/sections:
* They can be accessed through templates directly and through sections * Unrendered pages are not added to sitemaps * Unrendered pages are not added to taxonomies
- Loading branch information
1 parent
896a805
commit 4dc7353
Showing
5 changed files
with
108 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
+++ | ||
title = 'render = false tests' | ||
slug = 'access-render' | ||
template = 'access_render.html' | ||
date = 2000-01-01 | ||
+++ | ||
|
||
This post exists to test that unrendered sections and pages are still accessible | ||
via templates. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% extends "index.html" %} | ||
|
||
{% block content %} | ||
{% set unrendered_page = get_page(path='posts/render.md') %} | ||
{% set section_with_unrendered = get_section(path='posts/_index.md') %} | ||
{% set unrendered_section = get_section(path='posts/2018/_index.md') %} | ||
Path of unrendered page: {{ unrendered_page.path | safe }} | ||
Pages in section with unrendered page: <ul>{% for page in section_with_unrendered.pages -%} | ||
<li>{{ page.path | safe }}</li> | ||
{%- endfor %}</ul> | ||
Pages in unrendered section: <ul>{% for page in unrendered_section.pages -%} | ||
<li>{{ page.path | safe }}</li> | ||
{%- endfor %}</ul> | ||
{% endblock content %} | ||
|