Skip to content

Conversation

@sergimos
Copy link

@sergimos sergimos commented Jan 7, 2026

Description

This pull request adds the possibility to enable header and footer on the cover page and toc pages when generating a pdf.
Before this, the cover page and toc pages where automatically skipped for the header and footer generation.

To enable the header and footer I added two new metadata variables:

  • pdfHeaderFooterOnCover
  • pdfHeaderFooterOnToc

Documentation

The new metadata variables have been added to the repo documentation.

Testing

Testing with the following configurations was done:

# toc.yml

pdf: true
pdfFileName: pdf/documentation.pdf
pdfTocPage: true
pdfCoverPage: pdf/cover.html
pdfHeaderTemplate: pdf/header.html
pdfFooterTemplate: pdf/footer.html
pdfHeaderFooterOnToc: true
pdfHeaderFooterOnCover: true
items:
- name: 📖 SMS
  href: doc/toc.yml
- name: 🔧 API Reference
  href: api/toc.yml

Outcome --> Header and footer on all the pages.


# toc.yml

pdf: true
pdfFileName: pdf/documentation.pdf
pdfTocPage: true
pdfCoverPage: pdf/cover.html
pdfHeaderTemplate: pdf/header.html
pdfFooterTemplate: pdf/footer.html
pdfHeaderFooterOnToc: false
pdfHeaderFooterOnCover: false
items:
- name: 📖 SMS
  href: doc/toc.yml
- name: 🔧 API Reference
  href: api/toc.yml

Outcome --> Header and footer on all the pages except cover and toc.


# toc.yml

pdf: true
pdfFileName: pdf/documentation.pdf
pdfTocPage: true
pdfCoverPage: pdf/cover.html
pdfHeaderTemplate: pdf/header.html
pdfFooterTemplate: pdf/footer.html
pdfHeaderFooterOnToc: false
pdfHeaderFooterOnCover: true
items:
- name: 📖 SMS
  href: doc/toc.yml
- name: 🔧 API Reference
  href: api/toc.yml

Outcome --> Header and footer on all the pages except toc (same works also for disabling header/footer on cover).


# toc.yml

pdf: true
pdfFileName: pdf/documentation.pdf
pdfTocPage: true
pdfHeaderFooterOnToc: true
pdfHeaderFooterOnCover: true
items:
- name: 📖 SMS
  href: doc/toc.yml
- name: 🔧 API Reference
  href: api/toc.yml

Outcome --> Default footer on all the pages.


# toc.yml

pdf: true
pdfFileName: pdf/documentation.pdf
pdfCoverPage: pdf/cover.html
pdfHeaderTemplate: pdf/header.html
pdfFooterTemplate: pdf/footer.html
pdfHeaderFooterOnToc: true
pdfHeaderFooterOnCover: true
items:
- name: 📖 SMS
  href: doc/toc.yml
- name: 🔧 API Reference
  href: api/toc.yml

Outcome --> Default footer on all the pages. No toc printed


# toc.yml

pdf: true
pdfFileName: pdf/documentation.pdf
pdfTocPage: true
pdfHeaderTemplate: pdf/header.html
pdfFooterTemplate: pdf/footer.html
pdfHeaderFooterOnToc: true
pdfHeaderFooterOnCover: true
items:
- name: 📖 SMS
  href: doc/toc.yml
- name: 🔧 API Reference
  href: api/toc.yml

Outcome --> Default footer on all the pages including toc. No cover printed


@sergimos
Copy link
Author

sergimos commented Jan 8, 2026

@dotnet-policy-service agree

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.

1 participant