Add collections dedicated to pdf template
This commit is contained in:
parent
39a9ec10ca
commit
3d230cdd6a
|
|
@ -16,6 +16,12 @@ export default async function (eleventyConfig) {
|
|||
process.env.DEBUG && console.log(inspect(sections));
|
||||
return sections;
|
||||
});
|
||||
eleventyConfig.addCollection("pdfSections", (collectionApi) => {
|
||||
const sections = collectionApi.getFilteredByGlob("./src/pages/sections/**")
|
||||
.sort((a, b) => (a.data?.pdf?.order ?? a.data.order) - (b.data?.pdf?.order ?? b.data.order));
|
||||
process.env.DEBUG && console.log(inspect(sections));
|
||||
return sections;
|
||||
});
|
||||
eleventyConfig.addCollection("projects", (collectionApi) => {
|
||||
const projects = collectionApi.getFilteredByGlob("./src/projects/**")
|
||||
.sort((a, b) => a.data.order - b.data.order);
|
||||
|
|
|
|||
|
|
@ -25,13 +25,10 @@ links:
|
|||
</ul>
|
||||
</section>
|
||||
|
||||
<p>
|
||||
The time is {{ "now" | date: "%Y-%m-%d %H:%M" }}
|
||||
<p style="margin-bottom: 1ch;">{{ author.about }}</p>
|
||||
|
||||
</p>
|
||||
|
||||
{% for section in collections.sections %}
|
||||
{% if section.data.excludeFromPdf != true %}
|
||||
{% for section in collections.pdfSections %}
|
||||
{% if section.data.pdf.exclude != true %}
|
||||
{% assign items = collections[section.data.collection] %}
|
||||
{% include 'partials/components/pdf/section' %}
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue