From f237889412aafe31d338d832a444f82ef33b81d9 Mon Sep 17 00:00:00 2001 From: Neha Deekonda <85057583+Neha9849@users.noreply.github.com> Date: Tue, 15 Mar 2022 18:27:42 +0530 Subject: [PATCH] :new: :sparkles: layouts(shortcodes): Add embed-pdf shortcode (#56) I have added a demo of this shortcode on the `installation/elements` page. For using this Shortcode, we have to pass the name of the pdf into the shortcode as shown in the demo. The pdfs should be stored in the `static/pdfs` folder. Fixes #33. Co-authored-by: Justin W. Flory --- .../installation/configuration/_index.en.md | 2 +- .../installation/elements/_index.en.md | 8 ++ exampleSite/static/pdfs/sample.pdf | Bin 0 -> 2830 bytes layouts/shortcodes/embed-pdf.html | 107 ++++++++++++++++++ 4 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 exampleSite/static/pdfs/sample.pdf create mode 100644 layouts/shortcodes/embed-pdf.html diff --git a/exampleSite/content/installation/configuration/_index.en.md b/exampleSite/content/installation/configuration/_index.en.md index 4a5e15c..e3cfa42 100644 --- a/exampleSite/content/installation/configuration/_index.en.md +++ b/exampleSite/content/installation/configuration/_index.en.md @@ -24,4 +24,4 @@ Note that some of these parameters are explained in details in other sections of # Call to action is default enabled, if you want to disable it. just change the enable = false # You can change banner title and other text from the config file. -``` \ No newline at end of file +``` diff --git a/exampleSite/content/installation/elements/_index.en.md b/exampleSite/content/installation/elements/_index.en.md index 58539be..8979f72 100644 --- a/exampleSite/content/installation/elements/_index.en.md +++ b/exampleSite/content/installation/elements/_index.en.md @@ -190,3 +190,11 @@ Markdown | Less | Pretty ##### Youtube video {{< youtube C0DPdy98e4c >}} + +
+ +##### Embed PDF + +Embedded PDFs must be committed as [static files](https://gohugo.io/content-management/static-files/) in `static/pdfs/`: + +{{< embed-pdf pdfName="sample.pdf">}} diff --git a/exampleSite/static/pdfs/sample.pdf b/exampleSite/static/pdfs/sample.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c0e31a076aeb1fa7729e82279943b3504f85338d GIT binary patch literal 2830 zcmd5;-EP}96u#$EoSOg%kdhLuKNm%TIEk^XOA{o|$l$1urA7}G%`-gh0z#{u*ztl%QS<`8GX}hHVSC$ z1#7bpRcRqJ1yrR3rNPc6{H6+9i5xEEbS|`-mS8Ju3MKNA!i6a$Sovfroahu5ZrYbf z$Y~t%wa1;kubKAQ=Lt=Mwosd>USoNma-T;(qRBA&Rz@Q%n4TTOSNCnzYHw71F1>&b zgZ9|!vhOwZ>eU{fA-OMc`Th4>8p!8gxnC!_O6sp|_(!9j!4 zl}rI2*Anp(v6E8TCW$z)#(@?w9K8J>pe)8XYW!;hbAlZxi{j`%A=xgD@m>JvAQ{$i zx+!l~m_<`ypTcJZ@b7hZF-aPQ?eXuN^uL?7r@s%cJHXn!ip%*i%*_h!Ycv4+yhKny zkVPObZIxvdMwJC^EQqpI!qH0D>D+1dx$Ge8QYh?=Y4Q9TxY=LlKA(X{v8k=GuYoxV zbzeBf?vyKQu?=mRpI}SD+lY(UFY12dGL(5vH|f26Pp*%X)OVnw6y0RN{t@%`%+H zQq6RUYqc%x-Dko|I6QmHJumVG9`X#H@aSkehNnViNHu()I11Bz5QX6&1eC8oAFJX% z&>PVZ8B|x~2Z#q<5$8z!x}w1llkSN8@P(Eiz0l$T-}T6Y5TUVSi-*XhS`k48gS4fn tdFze(DqWWB+Te?Dj27AI&pI>6zUm3`FC<{1uysXv><8rF;QVq-{svGq0pkDw literal 0 HcmV?d00001 diff --git a/layouts/shortcodes/embed-pdf.html b/layouts/shortcodes/embed-pdf.html new file mode 100644 index 0000000..9ce587c --- /dev/null +++ b/layouts/shortcodes/embed-pdf.html @@ -0,0 +1,107 @@ + + +
+
+
+
+ + / + +
+ + View PDF +
+ +
+ \ No newline at end of file