mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge 77c6c6fd3f into 2aa0c6e24b
This commit is contained in:
commit
7c7b32e444
1 changed files with 5 additions and 3 deletions
|
|
@ -595,9 +595,11 @@ class PdfGenerator(Generator):
|
|||
if obj.source_path.endswith('.rst'):
|
||||
filename = obj.slug + ".pdf"
|
||||
output_pdf = os.path.join(output_path, filename)
|
||||
# print('Generating pdf for', obj.source_path, 'in', output_pdf)
|
||||
with open(obj.source_path) as f:
|
||||
self.pdfcreator.createPdf(text=f.read(), output=output_pdf)
|
||||
with open(obj.source_path, encoding='utf-8') as f:
|
||||
pdf_content = f.read()
|
||||
siteurl = "/".join((self.settings['SITEURL'], 'static', ''))[:-1]
|
||||
pdf_content = pdf_content.replace("|filename|", siteurl)
|
||||
self.pdfcreator.createPdf(text=pdf_content, output=output_pdf)
|
||||
logger.info(' [ok] writing %s' % output_pdf)
|
||||
|
||||
def generate_context(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue