From 8b2fba895aa804e895eaa02a622f318113a35663 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Wed, 29 Jun 2022 17:34:05 -0700 Subject: [PATCH] feat: image scaling (closes #131) --- assets/styles/base.scss | 2 +- content/notes/hosting.md | 6 +++++- layouts/partials/textprocessing.html | 6 ++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/assets/styles/base.scss b/assets/styles/base.scss index 1c353f3..776f32d 100644 --- a/assets/styles/base.scss +++ b/assets/styles/base.scss @@ -85,7 +85,7 @@ table { } img { - width: 100%; + max-width: 100%; border-radius: 3px; margin: 1em 0; } diff --git a/content/notes/hosting.md b/content/notes/hosting.md index d46aff6..8db2746 100644 --- a/content/notes/hosting.md +++ b/content/notes/hosting.md @@ -3,9 +3,11 @@ title: "Deploying Quartz to the Web" tags: - setup weight: -1 +aliases: +- hosting --- -## GitHub Pages +## Hosting on GitHub Pages Quartz is designed to be effortless to deploy. If you forked and cloned Quartz directly from the repository, everything should already be good to go! Follow the steps below. ### Enable GitHub Actions @@ -13,6 +15,8 @@ By default, GitHub disables workflows from running automatically on Forked Repos ![Enable GitHub Actions](notes/images/github-actions.png)*Enable GitHub Actions* +![[notes/images/github-actions.png|200]] + ### Enable GitHub Pages Head to the 'Settings' tab of your forked repository and go to the 'Pages' tab. diff --git a/layouts/partials/textprocessing.html b/layouts/partials/textprocessing.html index 56e2e8b..dfb0ff2 100644 --- a/layouts/partials/textprocessing.html +++ b/layouts/partials/textprocessing.html @@ -27,10 +27,8 @@ {{$inner := . | strings.TrimPrefix "![[" | strings.TrimSuffix "]]" }} {{$split := split $inner "|"}} {{$path := index $split 0 | relURL}} - {{$reference := split $path "#"}} - {{$title := index $reference 0}} - {{$display := default $title (index $split 1)}} - {{$img := printf "" $path $display}} + {{$width := index $split 1}} + {{$img := printf "" $path (default "auto" $width)}} {{$content = replace $content . $img}} {{else}} {{$inner := . | strings.TrimPrefix "[[" | strings.TrimSuffix "]]" }}