{"id":13841,"date":"2020-08-12T09:35:21","date_gmt":"2020-08-12T15:35:21","guid":{"rendered":"https:\/\/macblaze.ca\/?page_id=13841"},"modified":"2020-09-12T09:14:54","modified_gmt":"2020-09-12T15:14:54","slug":"hugo-notes","status":"publish","type":"page","link":"https:\/\/macblaze.ca\/?page_id=13841","title":{"rendered":"Hugo Notes"},"content":{"rendered":"<p><strong>NOTE:<\/strong> Details about <a href=\"https:\/\/macblaze.ca\/?p=7856\">markdown syntax are here<\/a>.<\/p>\n<h1>Table of Contents<\/h1>\n<ol>\n<li><a href=\"#hugo-overview\">Hugo Overview<\/a>\n<ol>\n<li><a href=\"#basic-hugo-commands\">Basic Hugo commands<\/a><\/li>\n<li><a href=\"#Themes\">Themes<\/a><\/li>\n<li><a href=\"#Archetypes\">Archetypes<\/a><\/li>\n<\/ol>\n<ul>\n<li><a href=\"#frontmatter\">Frontmatter<\/a><\/li>\n<li><a href=\"#standard-taxonomies\">Standard Taxonomies<\/a><\/li>\n<\/ul>\n<ol>\n<li><a href=\"#templates\">Templates<\/a><\/li>\n<\/ol>\n<ul>\n<li><a href=\"#basic-templates\">Basic Templates<\/a><\/li>\n<li><a href=\"#section-templates\">Section Templates<\/a><\/li>\n<li><a href=\"#base-baseof-templates\">Base (baseof) Templates<\/a><\/li>\n<\/ul>\n<ol>\n<li><a href=\"#partial-templates\">Partial Templates<\/a><\/li>\n<li><a href=\"#hugo-variables\">Hugo Variables<\/a><\/li>\n<li><a href=\"#hugo-functions\">Hugo Functions<\/a><\/li>\n<\/ol>\n<ul>\n<li><a href=\"#conditionals\">Conditionals<\/a><\/li>\n<\/ul>\n<ol>\n<li><a href=\"#data\">Data<\/a><\/li>\n<li><a href=\"#shortcodes\">Shortcodes<\/a><\/li>\n<li><a href=\"#themes\">Themes<\/a><\/li>\n<\/ol>\n<\/li>\n<li><a href=\"#images\">Images<\/a>\n<ol>\n<li><a href=\"#basic-insertion\">Basic Insertion<\/a><\/li>\n<li><a href=\"#fancybox\">Fancybox<\/a><\/li>\n<li><a href=\"#page-bundles\">Page Bundles<\/a><\/li>\n<\/ol>\n<\/li>\n<li><a href=\"#code-notes\">Code Notes<\/a>\n<ol>\n<li><a href=\"#links\">Links<\/a><\/li>\n<li><a href=\"#my-shortcodes\">My Shortcodes<\/a><\/li>\n<li><a href=\"#target_blank\">target=&#8221;_blank&#8221;<\/a><\/li>\n<li><a href=\"#enable-html-in-markdown\">Enable html in markdown<\/a><\/li>\n<li><a href=\"#emojis\">Emojis<\/a><\/li>\n<\/ol>\n<\/li>\n<li><a href=\"#deploy\">Deploy<\/a><\/li>\n<\/ol>\n<h1>Hugo Overview<\/h1>\n<h2>Basic Hugo commands<\/h2>\n<ul>\n<li>&lt;https:\/\/gohugo.io\/commands\/hugo\/&gt;<\/li>\n<\/ul>\n<p>###Content Creation<\/p>\n<h4>New Page<\/h4>\n<p><code>hugo new filename.md<\/code><br \/>\nor<br \/>\n<code>hugo new folder\/filename.md<\/code><br \/>\n&#8211; to use archetype: <code>hugo new folder\/folder2\/filename.md -k name_of_type<\/code><\/p>\n<h5>New List Pages<\/h5>\n<p>Hugo will automatically create a list page at root level but not in lower levels so use<br \/>\n<code>hugo new folder\/_index.md<\/code> to create a list page.<br \/>\n&#8211; works for sub-directory pages: <code>hugo new folder\/folder2\/_index.md<\/code><\/p>\n<h3>Running the server<\/h3>\n<h4>Run server<\/h4>\n<p>This opens a testing server at &lt;http:\/\/localhost:1313&gt;<br \/>\n&#8211; <code>hugo server<\/code><br \/>\n&#8211; <code>hugo server -D<\/code> (<em>shows drafts<\/em>)<\/p>\n<h4>Build site<\/h4>\n<p><code>hugo<\/code><br \/>\nor<br \/>\n<code>hugo -D<\/code> (<em>shows drafts<\/em>)<\/p>\n<ul>\n<li>this creates a &#8220;public&#8221; folder with your built site<\/li>\n<li>remember to delete before next build<\/li>\n<\/ul>\n<h4>New Site<\/h4>\n<p><code>hugo new site NewSiteName<\/code><\/p>\n<h4>Check your version<\/h4>\n<p><code>hugo version<\/code><br \/>\n&#8211; <code>brew upgrade hugo<\/code><br \/>\n&#8211; find executable <code>which hugo<\/code><\/p>\n<h4>Check config<\/h4>\n<p>To view your site\u2019s current configuration, which includes a lot of default settings, run the following command from the directory:<\/p>\n<p><code>hugo config | more<\/code><\/p>\n<h2>Themes<\/h2>\n<ul>\n<li>Themeless repo &lt;https:\/\/github.com\/infiniteink\/themeless-gitless-intro-hugo\/archive\/master.zip&gt;<\/li>\n<li>Bare White Theme &lt;https:\/\/github.com\/niklasfasching\/whitespace&gt;<\/li>\n<li>create your own i.e. <code>astart-theme<\/code><\/li>\n<\/ul>\n<h2>Archetypes<\/h2>\n<p>Are templates for default pages, frontmatter etc. (<em>see next section<\/em>)<br \/>\n&#8211; \/archetypes\/default.md<\/p>\n<h2>### Sample Format<\/h2>\n<p>title: &#8220;{{ replace .Name &#8220;-&#8221; &#8221; &#8221; | title }}&#8221;<br \/>\ndate: {{ .Date }}<br \/>\ndraft: true<\/p>\n<h2>author: [&#8220;Bob&#8221;,&#8221;Ted&#8221;,&#8221;Alice&#8221;]<\/h2>\n<ul>\n<li>Remember to delete <code>default.md<\/code> in top level directory when using a theme&#8217;s archetypes<\/li>\n<li>Can add custom defaults: <code>author: \"Author Name\"<\/code>, <code>dotColor:<\/code> etc.<\/li>\n<li>can be used to add comments (i.e. shortcodes)<\/li>\n<li>Can use lists (arrays) [&#8220;option1&#8221;, &#8220;option2&#8221;]<\/li>\n<li>Use custom archetypes by naming them same as directory (DirName).<\/li>\n<li>E.g. \/archetypes\/DirName.md will affect all files in\/content\/DirName\/FileName.md<\/li>\n<\/ul>\n<h3>Frontmatter<\/h3>\n<ul>\n<li>sets parameters for individual pages<\/li>\n<li>created by Archetypes. Can be modified individually.<\/li>\n<li>in YAML, TOML or json<\/li>\n<li>can add custom content &amp; variables<\/li>\n<li><code>myVar: \"MyValue\"<\/code><\/li>\n<li><code>image: \"MyPostImage\"<\/code><\/li>\n<\/ul>\n<p>YAML delineated by:<\/p>\n<hr \/>\n<p>title: &#8220;This is a title&#8221;<br \/>\ndate: 2020-01-01T:11:12:19-04:00<\/p>\n<h2>draft: true<\/h2>\n<p>TOML delineated by:<\/p>\n<p>+++<br \/>\ntitle = &#8220;This is my title&#8221;<br \/>\ndate: 2020-01-01T:11:12:19-04:00<br \/>\ndraft = False<br \/>\n+++<\/p>\n<h3>Standard Taxonomies (tags and categories)<\/h3>\n<p><em>Hugo automatically generates list pages for standard taxonomies.<\/em><br \/>\n&#8211; They are placed in frontmatter:<\/p>\n<hr \/>\n<p>title: &#8220;This is a title&#8221;<br \/>\ntags: [&#8220;Coding&#8221;, &#8220;Python&#8221;, &#8220;Web Development&#8221;]<\/p>\n<h2>categories: [&#8220;Computers&#8221;]<\/h2>\n<h4>Custom Taxonomies<\/h4>\n<p>You can add custom taxonomies i.e. <code>moods: [\"happy\",\"upbeat\",\"sad\", \"morose\"]<\/code> to frontmatter<br \/>\n&#8211; they don&#8217;t automatically generate list page<br \/>\n&#8211; must be added to config.toml (When adding custom taxonomies, you need to put in the default taxonomies too, if you want to keep them.)<br \/>\n&#8211; note singular vs plural construction<\/p>\n<pre><code>[taxonomies]\ntag = \"tags\"\ncategory = \"categories\"\nmood = \"moods\"`\n<\/code><\/pre>\n<h4>Menus<\/h4>\n<p>menu:<br \/>\n[&#8220;main&#8221;,&#8221;secondary&#8221;]:<br \/>\nparent: art<br \/>\nweight: 100<\/p>\n<h2>Templates<\/h2>\n<ul>\n<li>&lt;https:\/\/gohugo.io\/templates\/&gt;<\/li>\n<li>found in:<\/li>\n<li>\/themes\/theme-name\/layouts\/_default\/ list.html, single.html<\/li>\n<li>\/layouts\/&#95;default\/ list.html, single.html<\/li>\n<li>can create basic templates for specific pages e.g. index.html, 404.html etc.<\/li>\n<\/ul>\n<h4>Commenting<\/h4>\n<p>Can be use in shortcodes, layouts and partials<br \/>\n{{\/*<br \/>\nGo HTML<br \/>\nmulti-line<br \/>\ncomment<br \/>\n*\/}}<\/p>\n<h3>Basic Templates<\/h3>\n<h4>List templates<\/h4>\n<ul>\n<li>\/layouts\/&#95;default\/list.html<\/li>\n<li>\/themes\/theme-name\/layouts\/list.html<\/li>\n<\/ul>\n<h4>Single templates<\/h4>\n<ul>\n<li>\/layouts\/&#95;default\/single.html<\/li>\n<li>\/themes\/theme-name\/layouts\/single.html<\/li>\n<\/ul>\n<h4>Homepage template<\/h4>\n<ul>\n<li>\/layouts\/index.html<\/li>\n<li>\/themes\/theme-name\/layouts\/index.html<\/li>\n<\/ul>\n<h3>Section Templates<\/h3>\n<p>Create folder in \/layouts\/ named after section in \/content\/<br \/>\n&#8211; <code>\/layouts\/DirName\/single.html<\/code> affects files in <code>\/content\/DirName\/single.html<\/code><br \/>\n&#8211; can be list.html, single.html and index.html templates<br \/>\n&#8211; overrides default templates<\/p>\n<h3>Base (baseof) Templates<\/h3>\n<p>Are an over-arching template for organizing entire Hugo website.<br \/>\n&#8211; Can be used to define Header -&gt; Main Content &#8211; &gt; Sidebar -&gt; Footer structure<br \/>\n&#8211; sections are called Blocks<\/p>\n<p>Create a new file \/layouts\/&#95;default\/<strong>baseof.html<\/strong><br \/>\n&#8211; use a basic html layout<br \/>\n&#8211; insert blocks where appropriate<\/p>\n<p>{{block &#8220;main&#8221; . }}<\/p>\n<p>{{end}}<\/p>\n<p>or<\/p>\n<p>{{block &#8220;footer&#8221; . }}<br \/>\nDefault base of footer<br \/>\n{{end}}<\/p>\n<h4>In Layout Pages<\/h4>\n<ul>\n<li>remove html from single.html and list.html etc. templates<\/li>\n<li>to call in layout template add:<\/li>\n<\/ul>\n<p>{{ define &#8220;main&#8221; }}<br \/>\nThis is content<br \/>\n{{end}}<\/p>\n<ul>\n<li>you can override Block in single.html, list.html<\/li>\n<\/ul>\n<p>{{ define &#8220;footer&#8221; }}<br \/>\nOverride default footer<br \/>\n{{end}}<\/p>\n<h2>Partial templates<\/h2>\n<ul>\n<li>Used to create smaller elements<\/li>\n<li>header, footer etc.<\/li>\n<li>place in \/layouts\/partials\/MyPartial.html<\/li>\n<li>use in template <code>{{partial \"mypartial\" . }}<\/code><\/li>\n<li>&#8220;.&#8221; refers to scope<\/li>\n<\/ul>\n<p>Can pass custom dictionary etc. as scope<br \/>\n&#8211; <code>{{partial \"header\" (dict \"MyTitle\" \"Custom Title\" \"MyDate\" \"Custom Date\") }}<\/code> in template<br \/>\n&#8211; then add <code>{{.MyTitle}}<\/code> or <code>{{.MyDate}}<\/code> in header.html (partial) to call custom info<\/p>\n<h2>Hugo Variables<\/h2>\n<ul>\n<li>can&#8217;t be used in content files \u2014 only in templates<\/li>\n<li>displays content: {{.Content}}<\/li>\n<li>url: {{.URL}} url<\/li>\n<li>title: {{.Title}}<\/li>\n<li>visit &lt;https:\/\/gohugo.io\/variables&gt;<\/li>\n<\/ul>\n<h3>Custom Frontmatter Variables<\/h3>\n<ul>\n<li>access in template files<\/li>\n<li>in frontmatter of content md file<\/li>\n<li><code>color: \"blue\"<\/code><\/li>\n<li><code>{{.Params.color}}<\/code><\/li>\n<li>can be used in html (`<\/li>\n<\/ul>\n<p>`)<\/p>\n<h3>Custom Variables<\/h3>\n<ul>\n<li>define <code>{{ $myVarName := \"A String\"}}<\/code><\/li>\n<li>call <code>{{$myVarName}}<\/code><\/li>\n<\/ul>\n<h2>Hugo Functions<\/h2>\n<ul>\n<li>can only used in layout folder (templates etc. like variables)<\/li>\n<li>&lt;https:\/\/gohugo.io\/functions\/&gt;<\/li>\n<li>{{function&#95;name param1, param2}}<\/li>\n<li>{{truncate 10 &#8220;This is a really, really really long string&#8221;}}<\/li>\n<li>{{add 1 5}} gives 6<\/li>\n<li>{{singularize &#8220;dogs&#8221;}} gives dog<\/li>\n<\/ul>\n<p>Loop through pages and adds title:<\/p>\n<p><code>{{range .Pages}}<\/code><br \/>\n`<\/p>\n<p>{{.Title}}<\/p>\n<p><code><\/code>{{end}}`<\/p>\n<h3>Conditionals<\/h3>\n<ul>\n<li>eq equals<\/li>\n<li>lt less than<\/li>\n<li>le less than or equals<\/li>\n<li>gt greater than<\/li>\n<li>ge greater than or equals<\/li>\n<li>ne not equals<\/li>\n<\/ul>\n<p><code>{{if eq $var1 $var2}}<\/code> or <code>{{if not (eq $var1 $var2)}}<\/code><br \/>\nThen&#8230;<br \/>\n<code>{{end}}<\/code><\/p>\n<p>And\/Or<br \/>\n&#8211; <code>{{if and (lt $var1 $var2) (lt $var1 $var3)}}<\/code><\/p>\n<p>Else\/Else if<br \/>\n&#8211; <code>{{else}}<\/code><br \/>\n&#8211; <code>{{else if eq $var1 $var2}}<\/code><\/p>\n<p><strong>Example:<\/strong><br \/>\n<code>{{$title := .Title}}<\/code><br \/>\n<code>{{range .Site.Pages}}<\/code><br \/>\n`<\/p>\n<p>{{.Title}}<\/p>\n<p><code><\/code>{{end}}`<\/p>\n<h2>Data<\/h2>\n<ul>\n<li>Use in layouts folder (templates)<\/li>\n<li>place datafile in \/data\/<\/li>\n<li>json, YAML, toml<\/li>\n<\/ul>\n<p><code>{{range .Site.Data.boatlist}}<\/code><br \/>\n<code>{{.Name}} \u2014 ${{.Price}}<\/code><br \/>\n<code>{{end}}<\/code><\/p>\n<h2>Shortcodes<\/h2>\n<h3>Hugo Shortcodes<\/h3>\n<p><code>{{&amp;lt; shortcode_name param1 &amp;gt;}}<\/code><\/p>\n<ul>\n<li>Youtube Shortcode: <code>{{}}<\/code><\/li>\n<li>Instagram Shortcode: <code>{{&amp;lt; instagram_simple BGvuInzyFAe hidecaption &amp;gt;}}<\/code><\/li>\n<li>Twitter: <code>{{&amp;lt; tweet 1085870671291310081 &amp;gt;}}<\/code><\/li>\n<li>Vimeo Simple : <code>{{&amp;lt; vimeo_simple 48912912 &amp;gt;}}<\/code><\/li>\n<li>&lt;https:\/\/gohugo.io\/content-management\/shortcodes\/#use-hugos-built-in-shortcodes&gt;<\/li>\n<\/ul>\n<h3>Custom Shortcodes<\/h3>\n<p>see <a href=\"#my-shortcodes\">My Shortcodes<\/a><br \/>\n&#8211; partials for using in content markdown files<br \/>\n&#8211; in \/layouts\/shortcodes\/myshortcodename.html<br \/>\n&#8211; call with <code>{{&amp;lt; myshortcodename &amp;gt;}}<\/code><br \/>\n&#8211; can have double tags:<br \/>\n<code>{{&amp;lt; myshortcodename &amp;gt;}}<\/code><br \/>\nThis is test in the shortcode tags<br \/>\n<code>{{&amp;lt; \/myshortcodename &amp;gt;}}<\/code><br \/>\n&#8211; call with {{.Inner}}<br \/>\n&#8211; `<\/p>\n<p>{{.Inner}}<\/p>\n<p><code>- won't render markdown unless in<\/code>{{% \/myshortcodename %}}` (doesnt&#8217;t work?)<\/p>\n<p>Can pass in Variables<br \/>\n&#8211; <code>{{&amp;lt; myshortcodename color=\"blue\"&amp;gt;}}<\/code><br \/>\n&#8211; in shortcode file: `<\/p>\n<p>This is the Shortcode text<\/p>\n<p>`<br \/>\n&#8211; use tick marks instead of single quotes for embedded quotes<\/p>\n<h4>Positional parameter<\/h4>\n<ul>\n<li>`<\/li>\n<\/ul>\n<p>This is the Shortcode text<\/p>\n<p>`<br \/>\n&#8211; grabs first parameter (parameter number 0)<\/p>\n<h2>Themes<\/h2>\n<p>Download theme to \/themes\/ and<\/p>\n<h3>Install a theme<\/h3>\n<p>$ cd themes<br \/>\n$ git clone URL_TO_THEME<\/p>\n<ul>\n<li>add <code>theme = \"themename\"<\/code> to config.toml<\/li>\n<li>run <code>hugo -t ThemeName<\/code><\/li>\n<\/ul>\n<h1>Images<\/h1>\n<h2>Basic Insertion<\/h2>\n<p>Place images in \/static<br \/>\n&#8211; markdown: <code>![image alt text](\/my_image.png)<\/code><br \/>\n&#8211; html: &#8220;<br \/>\n&#8211; figure shortcode: <code>{{&amp;lt; figure src=\"\/media\/spf13.jpg\" title=\"Steve Francia\" &amp;gt;}}<\/code><br \/>\n&#8211; lots of parameters like target, caption, class etc. &lt;https:\/\/gohugo.io\/content-management\/shortcodes\/#figure&gt;<\/p>\n<h2>Fancybox<\/h2>\n<p>Image links for the above shortcodes use Fancybox3 as a lightbox &lt;http:\/\/fancyapps.com\/fancybox\/3\/&gt;<\/p>\n<h2>Page Bundles<\/h2>\n<p>Allow you to bundle resources in one area.<br \/>\n&#8211; consists of folder, a file named index.md, and resources (i.e images etc)<\/p>\n<h1>Code Notes<\/h1>\n<h2>Links<\/h2>\n<p>[The details can be found here]({{&lt; relref &#8220;about-the-book&#8221; &gt;}})<br \/>\n&#8211; allows internal links<\/p>\n<h2>My Shortcodes<\/h2>\n<h3><code>link<\/code><\/h3>\n<p>{{&lt; link &#8220;See more here&#8221; &#8220;posts\/some-title&#8221; &gt;}}<br \/>\n&#8211; creates permalink shortcode relative to baseurl.<br \/>\n&#8211; modified from &lt;https:\/\/github.com\/jorinvo\/hugo-shortcodes\/blob\/master\/shortcodes\/link.html&gt;<br \/>\n&#8211; takes 2 unnamed parameters<br \/>\n&#8211; First parameter is the link text &#8220;See more here&#8221;<br \/>\n&#8211; Second parameter is the relative URL &#8220;posts\/some-title&#8221;<\/p>\n<h3><code>youtube<\/code><\/h3>\n<p>{{&lt; youtube id=&#8221;RabX4yNyd6s&#8221; width=&#8221;600&#8243; class=&#8221;youtube&#8221; &gt;}}<br \/>\n&#8211; takes one named parameter: width=&#8221;000&#8243;<br \/>\n&#8211; defaults to 400 x 225<\/p>\n<h3><code>video<\/code><\/h3>\n<p>{{&lt; video src=&#8221;Extro-V2.mp4&#8243; poster=&#8221;BK-ID-Poster-V2-400&#215;225.png&#8221; width=&#8221;200&#8243;&gt;}}<br \/>\n&#8211; links to page Bundle video<br \/>\n&#8211; takes 3 named parameters:src=, poster= (default image file) and width=<br \/>\n&#8211; width defaults to 400<\/p>\n<h3><code>singleimage<\/code><\/h3>\n<p>{{&lt; singleimage &#8220;&#42;cats&#42;&#8221; &#8220;This is a caption&#8221; Fill &#8220;200&#215;200&#8221; &gt;}}<\/p>\n<p>This is a single image shortcode to display images from the Page Bundle.<br \/>\n&#8211; 5 unnamed parameters<br \/>\n1. name is &#8220;&#42;filename&#42;&#8221; without file ending<br \/>\n2. caption<br \/>\n3. Resize, Fill, or Fit<br \/>\n4. Image size Resize uses &#8220;000&#8221; and Fill or Fit uses&#8221;000&#215;000&#8243;<br \/>\n5. optional external href &#8220;http:\/\/astart.ca&#8221;<br \/>\n&#8211; resizes linked original to &#8220;1200&#215;800&#8221;<\/p>\n<h3><code>singleimagestatic<\/code><\/h3>\n<p>{{&lt; singleimagestatic &#8220;feather.jpg&#8221; &#8220;Fit 300&#215;300&#8221; Fit &#8220;300&#215;300&#8221; &gt;}}<\/p>\n<p>This is a single image shortcode to display images from the root <code>\/assets\/images<\/code> folder.<br \/>\n&#8211; 4 unnnamed parameters<br \/>\n1. name is &#8220;filename.jpg&#8221; <em>must have file ending!<\/em><br \/>\n2. caption<br \/>\n3. Resize, Fill, or Fit<br \/>\n4. Image size Resize uses &#8220;000&#8221; and Fill or Fit uses&#8221;000&#215;000&#8243;<br \/>\n&#8211; resizes linked original to &#8220;1200&#215;800&#8221;<\/p>\n<h4><code>sample-figurerev<\/code><\/h4>\n<p>{{&lt; figurerev src=&#8221;\/feather.jpg&#8221; link=&#8221;http:\/\/apple.com&#8221; Target=&#8221;_blank&#8221; title=&#8221;Image Title&#8221; caption=&#8221;Bob, Bob, Bob!&#8221; alt=&#8221;This is the alt text.&#8221; height=&#8221;200&#8243; width=&#8221;325&#8243; class=&#8221;gallery&#8221; &gt;}}<\/p>\n<ul>\n<li>based on Hugo&#8217;s original <code>figure<\/code> short code &lt;https:\/\/github.com\/gohugoio\/hugo\/blob\/master\/tpl\/tplimpl\/embedded\/templates\/shortcodes\/figure.html&gt;<\/li>\n<li>displays images from root <code>\/assets\/images<\/code> folder with lots of parameters available<\/li>\n<li>UNFINISHED<\/li>\n<\/ul>\n<h4>A single permanent image<\/h4>\n<p>&#91;image alt text](\/images\/BK-ID-headerlogo.png)<\/p>\n<p>A single image from the <code>\/static\/<\/code> folder<br \/>\n&#8211; renders exactly as is<br \/>\n&#8211; meant for global images<\/p>\n<h3>flexbox<\/h3>\n<p>{{&lt; flex box &gt;}}<br \/>\n{{&lt;singleimage &#8220;&#8221; &#8220;&#8221; &#8220;&#8221;&gt;}}<br \/>\n{{&lt; \/flexbox&gt;}}<br \/>\n&#8211; nested images within a flexbox container<\/p>\n<h3><code>foldergallery<\/code><\/h3>\n<p>{{&lt; foldergallery &#8220;200&#8221; &gt;}}<\/p>\n<p>An automatic gallery of photographs from the Page Bundle.<br \/>\n&#8211; no way to display captions<br \/>\n&#8211; takes size as unnamed parameter: &#8220;400&#8221;<br \/>\n&#8211; resizes linked original to &#8220;1200&#215;800&#8221;<\/p>\n<h3><code>foldergalleryfilter<\/code><\/h3>\n<p>{{&lt; foldergalleryfilter &#8220;200&#8221; &gt;}}<\/p>\n<p>Same as above but adds filters<br \/>\n&#8211; filters must be set in shortcode at this point<br \/>\n&#8211; Grayscale, Sepia, Gaussian Blur<\/p>\n<h3><code>old-foldergallerylist<\/code><\/h3>\n<p><strong>DEPRECATED: Superceded by Using <code>singleimage<\/code> with &#8216;flex box&#8217; instead<\/strong><\/p>\n<p>{{&lt; foldergallerylist &#8220;<em>IMG_6535<\/em>&#8221; &#8220;This is a loaf of bread&#8221; &#8220;200&#8221; &gt;}}<br \/>\n{{&lt; foldergallerylist &#8220;<em>cats<\/em>&#8221; &#8220;This is Pete and Em again&#8221; &#8220;200&#8221; &gt;}}<\/p>\n<p>This is a gallery of images stored in the Page Bundle, but called by means of a list, which allows it to have custom sizes and captions.<br \/>\n&#8211; For now it needs to have a \\<\/p>\n<p>surrounding it to clear the float.<\/p>\n<ul>\n<li>4 unnnamed parameters<\/li>\n<\/ul>\n<ol>\n<li>name is &#8220;filename.jpg&#8221; <em>must have file ending!<\/em><\/li>\n<li>caption<\/li>\n<li>Height Fit size<\/li>\n<li>optional external link &#8220;http:\/\/astart.ca&#8221;<\/li>\n<\/ol>\n<p>&#8211; resizes linked original to &#8220;1200&#215;800&#8221;<\/p>\n<h3>JSON <code>boatlist<\/code> and <code>ebooklist<\/code><\/h3>\n<p>Shortcodes to list json data files<br \/>\n&#8211; <code>boatlist<\/code> uses two columns<br \/>\n&#8211; <code>{{booklist \"magazines\"}}<\/code> uses one parameter to name database in file<br \/>\n&#8211; <code>{{&amp;lt; ebooklist &amp;gt;}}<\/code><\/p>\n<h2>target=&#8221;_blank&#8221;<\/h2>\n<ul>\n<li>in config.toml file<\/li>\n<\/ul>\n<h4>Blackfriday<\/h4>\n<p>&lt;https:\/\/code.luasoftware.com\/tutorials\/hugo\/how-to-create-link-with-target-blanks-in-hugo-markdown\/&gt;<\/p>\n<p>[Blackfriday]<br \/>\nplainIDAnchors = true<br \/>\nhrefTargetBlank = true<\/p>\n<h4>Goldmark<\/h4>\n<p>&lt;https:\/\/agrimprasad.com\/post\/hugo-goldmark-markdown\/&gt;<\/p>\n<p>The Markdown renderer has changed in the latest Hugo v0.62.0 from Blackfriday to Goldmark which should allow Hugo markdown to be more compatible with other markdown flavours, such as that of GitHub.<\/p>\n<p>In order to open links in new tab with the Goldmark markdown renderer, create a file at <code>layouts\/_default\/_markup\/render-link.html<\/code> with the following content:<\/p>\n<p><code>{{ .Text }}<\/code><\/p>\n<h2>Enable html in markdown<\/h2>\n<p>&lt;https:\/\/jdhao.github.io\/2019\/12\/29\/hugo_html_not_shown\/&gt;<\/p>\n<h4>Goldmark<\/h4>\n<p>[markup]<br \/>\ndefaultMarkdownHandler = &#8220;goldmark&#8221;<br \/>\n[markup.goldmark]<br \/>\n[markup.goldmark.renderer]<br \/>\nunsafe = true<\/p>\n<h4>Blackfriday<\/h4>\n<p>[markup]<br \/>\ndefaultMarkdownHandler = &#8220;blackfriday&#8221;<\/p>\n<h2>Emojis<\/h2>\n<p><code>enableEmoji = true<\/code> to config.toml<br \/>\n&lt;https:\/\/www.webfx.com\/tools\/emoji-cheat-sheet\/&gt;<\/p>\n<p>Must be above Optional Parameters section<br \/>\n&#8211; \ud83d\ude42<br \/>\n&#8211; :frowning_face_:<br \/>\n&#8211; :heart:<\/p>\n<p>Use <code>{{ emojify :smile: :heart: :frowning_face_: }}<\/code> in templates<\/p>\n<h1>Deploy<\/h1>\n<p>Change to active directory<br \/>\n&#8211; \/Site Astart <code>.\/deploy<\/code><br \/>\n&#8211; need to change config.toml to add <code>publishDir =\"astart\/\"<\/code><\/p>\n<h3>Deploy script<\/h3>\n<p>#!\/bin\/sh<br \/>\nUSER=user<br \/>\nHOST=domain<br \/>\nDIR=home\/macblaze\/public_html\/ # the directory where your web site files should go<\/p>\n<p>hugo &amp;&amp; rsync -avz &#8211;exclude=&#8217;.DS_Store&#8217; &#8211;delete \/Users\/admin\/Documents\/Projects\/WEB\\ PROJECTS\/Site\\ Astart\/astart ${USER}@${HOST}:\/${DIR}<\/p>\n<p>exit 0<\/p>\n<ul>\n<li>needs full local path<\/li>\n<li>local publishDir must match dir on server<\/li>\n<\/ul>\n<p><strong>Note:<\/strong> ssh configured to go direct to astart\/ directory<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NOTE: Details about markdown syntax are here. Table of Contents Hugo Overview Basic Hugo commands Themes Archetypes Frontmatter Standard Taxonomies Templates Basic Templates Section Templates Base (baseof) Templates Partial Templates Hugo Variables Hugo Functions Conditionals Data Shortcodes Themes Images Basic Insertion Fancybox Page Bundles Code Notes Links My Shortcodes target=&#8221;_blank&#8221; Enable html in markdown Emojis [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false},"_links":{"self":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/pages\/13841"}],"collection":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13841"}],"version-history":[{"count":19,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/pages\/13841\/revisions"}],"predecessor-version":[{"id":13958,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/pages\/13841\/revisions\/13958"}],"wp:attachment":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}