From e1e1e305bcd95066465da8bfe6913d485774fe4b Mon Sep 17 00:00:00 2001 From: JamesFlare1212 Date: Tue, 19 Nov 2024 08:01:10 -0500 Subject: [PATCH] optimize pdf in posts --- .gitmodules | 3 +++ config/_default/hugo.toml | 3 ++- content/en/posts/ecse-1010/lab01/index.md | 2 +- content/zh-cn/posts/ecse-1010/lab01/index.md | 2 +- themes/hugo-embed-pdf-shortcode | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) create mode 160000 themes/hugo-embed-pdf-shortcode diff --git a/.gitmodules b/.gitmodules index 4b11354..a5f2b9b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,3 +5,6 @@ [submodule "themes/component-projects"] path = themes/component-projects url = https://github.com/hugo-fixit/component-projects.git +[submodule "themes/hugo-embed-pdf-shortcode"] + path = themes/hugo-embed-pdf-shortcode + url = https://github.com/anvithks/hugo-embed-pdf-shortcode.git diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml index 71b2457..05e62a0 100644 --- a/config/_default/hugo.toml +++ b/config/_default/hugo.toml @@ -15,7 +15,8 @@ title = "FlareBlog" # Hostname (and path) to the root baseURL = "https://www.jamesflare.com/" # theme list -theme = ["FixIt", "component-projects"] +theme = ["FixIt", "component-projects", "hugo-embed-pdf-shortcode"] +enableInlineShortcodes = true defaultContentLanguage = "en" # language code ["en", "zh-CN", "fr", "pl", ...] languageCode = "en" diff --git a/content/en/posts/ecse-1010/lab01/index.md b/content/en/posts/ecse-1010/lab01/index.md index 736f610..1ff00b1 100644 --- a/content/en/posts/ecse-1010/lab01/index.md +++ b/content/en/posts/ecse-1010/lab01/index.md @@ -50,7 +50,7 @@ repost: ## Lab Document - +{{< link href="Lab01.pdf" content="Lab01.pdf" title="Download Lab01.pdf" download="Lab01.pdf" card=true >}} ## 1. Prove Ohm's Law, KCL, and KVL in a Circuit diff --git a/content/zh-cn/posts/ecse-1010/lab01/index.md b/content/zh-cn/posts/ecse-1010/lab01/index.md index 68ccff0..853b101 100644 --- a/content/zh-cn/posts/ecse-1010/lab01/index.md +++ b/content/zh-cn/posts/ecse-1010/lab01/index.md @@ -50,7 +50,7 @@ repost: ## Lab Document - +{{< link href="Lab01.pdf" content="Lab01.pdf" title="Download Lab01.pdf" download="Lab01.pdf" card=true >}} ## 1. 验证欧姆定律、KCL 和 KVL 在电路中的应用 diff --git a/themes/hugo-embed-pdf-shortcode b/themes/hugo-embed-pdf-shortcode new file mode 160000 index 0000000..de797b1 --- /dev/null +++ b/themes/hugo-embed-pdf-shortcode @@ -0,0 +1 @@ +Subproject commit de797b1a64f95fffb04324aec0fbc5c16175d75c