Add a file library in Google Drive for pages to link to
Tools → Media → Files uploads PDF, Office (.docx, .xlsx, .pptx), MP3, M4A and zip files, up to 50 MB, to the shared drive's Blog folder and shares each as anyone with the link can view (migration 048). A file's name and contents must agree. Content block links get "Choose a file" (paragraph, button and image links, list and link items, link cards). A link card also takes the file's name and Drive's picture of its first page, fetched after upload and saved into the image library; cards to Drive say "Google Drive". Deleting a file says first what still links to it. Setup and the nginx block: docs/google-drive-and-mail.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
36c9226bd9
commit
934598f954
13 changed files with 772 additions and 33 deletions
28
server/src/migrations/048_drive_files.sql
Normal file
28
server/src/migrations/048_drive_files.sql
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
-- ═══════════════════════════════════════════════════════════════
|
||||
-- 048 FILES IN GOOGLE DRIVE
|
||||
--
|
||||
-- Files for the public site to link to (a handout, slides, a talk's
|
||||
-- audio, a brand kit), uploaded from Tools → Media → Files into the
|
||||
-- shared drive's "Blog" folder (routes/files.js) and shared as
|
||||
-- "anyone with the link can view". Content blocks link to `url`,
|
||||
-- Drive's page for the file.
|
||||
--
|
||||
-- preview /uploads/... of Drive's picture of the first page, in
|
||||
-- the media library, once Drive has drawn one (PDFs and
|
||||
-- Office files); a link card to the file takes it as its
|
||||
-- picture
|
||||
-- ═══════════════════════════════════════════════════════════════
|
||||
|
||||
CREATE TABLE drive_files (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
drive_id TEXT NOT NULL UNIQUE,
|
||||
name TEXT NOT NULL,
|
||||
mime TEXT NOT NULL,
|
||||
bytes INTEGER NOT NULL CHECK (bytes >= 0),
|
||||
url TEXT NOT NULL,
|
||||
preview TEXT,
|
||||
uploaded_by INTEGER REFERENCES admin_users (id) ON DELETE SET NULL,
|
||||
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
||||
) STRICT;
|
||||
|
||||
CREATE INDEX drive_files_created_idx ON drive_files (created_at DESC);
|
||||
Loading…
Add table
Add a link
Reference in a new issue