So, originally I was using a GH Action to download a pdf export from the Google Drive apis (was going to link to the post for content, but I think my site is flagged cause I posted about a project fixing what I thought was an issue, and it was considered spammy?).
But anyway, I realized that since I’m doing a load_data for the html version, which is nice for local testing, why not try to see if I can do it for the pdf. The docs have an svg after all.
From poking at the docs and code, I suspect the answer is “no, only these specific text content-types work” (but I missed aliases and made my own redirects, so maybe I missed something here too). I can get the data, but it’s still being wrapped in an <html>etc
and I haven’t looked at the headers yet, but I feel like they are not gonna tell me anything I like.
Is it possible?
Repo for context: wow, I’m disallowed from posting even github for a question. Harsh.
+++
title = "test"
template = "test.md"
path="resume.pdf"
content-type="application/pdf"
draft=true
[extra]
file_id = "1kIqp7dlp3ve_OZwADFs-07_ufVsyChBLz_1YKgn8ElU"
+++
template:
{%-set url = "https://www.googleapis.com/drive/v2/files/" ~ page.extra.file_id ~ "/export?mimeType=application/pdf&key=" ~ get_env(name="GAPI_KEY")-%}{{- load_data(url=url) | safe -}}