Skip to content

Commit

Permalink
rebuilding site Mon May 27 06:49:16 PM IST 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
ppipada committed May 27, 2024
1 parent 76c3105 commit 602f5ad
Show file tree
Hide file tree
Showing 13 changed files with 24,453 additions and 39 deletions.
14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ <h2 class="m-0 mt-4">
<div class="pb-3">
<h4><span class="badge category">2024</span></h4><ul class="list-unstyled" style="margin-bottom: 1rem">
<li>
<div style="text-align: left">
<a href="https://pankajpipada.com/posts/2024-05-27-hugo-datatables/">Hugo - Integrating Datatables</a>
</div>
</li>
<li
style="
font-size: 0.8em;
color: #6c757d;
margin-bottom: 0.8rem;
"
>
<div style="text-align: left">May 27, 2024</div>
</li>
<li>
<div style="text-align: left">
<a href="https://pankajpipada.com/posts/2024-05-27-hugo-search/">Hugo - Integrate search using lunr.js</a>
</div>
Expand Down
13 changes: 11 additions & 2 deletions index.json

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
<generator>Hugo -- gohugo.io</generator>
<language>en</language>
<copyright>Copyright © 2016-2024 Pankaj Pipada. All Rights Reserved.</copyright>
<lastBuildDate>Mon, 27 May 2024 17:47:43 +0530</lastBuildDate>
<lastBuildDate>Mon, 27 May 2024 18:48:53 +0530</lastBuildDate>
<atom:link href="https://pankajpipada.com/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Hugo - Integrating Datatables</title>
<link>https://pankajpipada.com/posts/2024-05-27-hugo-datatables/</link>
<pubDate>Mon, 27 May 2024 18:02:24 +0530</pubDate>
<guid>https://pankajpipada.com/posts/2024-05-27-hugo-datatables/</guid>
<description>A guide to integrating data tables into a hugo site</description>
</item>
<item>
<title>Hugo - Integrate search using lunr.js</title>
<link>https://pankajpipada.com/posts/2024-05-27-hugo-search/</link>
Expand Down
39 changes: 26 additions & 13 deletions posts/2024-05-27-hugo-copy/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ <h2 id="resources">Resources</h2>
</span></span><span style="display:flex;"><span>[[<span style="color:#a6e22e">module</span>.<span style="color:#a6e22e">mounts</span>]]
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">source</span> = <span style="color:#e6db74">&#34;node_modules&#34;</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">target</span> = <span style="color:#e6db74">&#34;assets/vendor&#34;</span>
</span></span></code></pre></div><p>Note that if you do this, you have to explicitly mount other folders too. Defaults are shown in the Hugo documentation <a href="https://gohugo.io/hugo-modules/configuration/#module-configuration-mounts" target="_blank">here</a>
</span></span></code></pre></div></li>
<li>
<p>Note that if you do this, you have to explicitly mount other folders too. Defaults are shown in the Hugo documentation <a href="https://gohugo.io/hugo-modules/configuration/#module-configuration-mounts" target="_blank">here</a>
.</p>
</li>
<li>
Expand All @@ -192,19 +194,28 @@ <h2 id="resources">Resources</h2>
</ul>
<h2 id="non-resources">Non-Resources</h2>
<ul>
<li>Non-resources are files that Hugo does not process automatically, such as certain source maps or configuration files.</li>
<li>These files might be crucial for development or debugging but are not part of the standard resource pipeline in Hugo.</li>
<li>For non-resources, the above approach doesn&rsquo;t work directly because Hugo doesn&rsquo;t create resources for them.</li>
<li>Instead, you can follow these steps:
<li>
<p>Non-resources are files that Hugo does not process automatically, such as certain source maps or configuration files.</p>
</li>
<li>
<p>These files might be crucial for development or debugging but are not part of the standard resource pipeline in Hugo.</p>
</li>
<li>
<p>For non-resources, the above approach doesn&rsquo;t work directly because Hugo doesn&rsquo;t create resources for them.</p>
</li>
<li>
<p>Instead, you can follow these steps:</p>
<ul>
<li>Read the file.</li>
<li>Use <code>resources.FromString</code>.</li>
<li>Publish the resource.</li>
</ul>
</li>
<li>To optimize this process, you can create a partial and use it in your layout.</li>
<li>Here&rsquo;s an example partial that can be placed as <code>layouts/partials/copy-sourcemap-from-nodemodules.html</code>:</li>
</ul>
<li>
<p>To optimize this process, you can create a partial and use it in your layout.</p>
</li>
<li>
<p>Here&rsquo;s an example partial that can be placed as <code>layouts/partials/copy-sourcemap-from-nodemodules.html</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-html" data-lang="html"><span style="display:flex;"><span>{{ $mapFileOrig := . }}
</span></span><span style="display:flex;"><span>{{ $mapFileNode := printf &#34;/node_modules/%s&#34; $mapFileOrig }}
</span></span><span style="display:flex;"><span>{{ $mapFileVendor := printf &#34;vendor/%s&#34; $mapFileOrig }}
Expand All @@ -216,12 +227,14 @@ <h2 id="non-resources">Non-Resources</h2>
</span></span><span style="display:flex;"><span>{{ else }}
</span></span><span style="display:flex;"><span> {{ errorf &#34;Source map not found: %s&#34; $mapFileNode }}
</span></span><span style="display:flex;"><span>{{ end }}
</span></span></code></pre></div><ul>
<li>To use this partial, include it in your template (generally <code>baseof.html</code>, etc) like this:</li>
</ul>
</span></span></code></pre></div></li>
<li>
<p>To use this partial, include it in your template (generally <code>baseof.html</code>, etc) like this:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-html" data-lang="html"><span style="display:flex;"><span>{{ partial &#34;copy-sourcemap-from-nodemodules.html&#34; &#34;bootstrap/dist/css/bootstrap.min.css.map&#34; }}
</span></span></code></pre></div><ul>
<li>Note that during development, you <em>may</em> need to deleted the output folder and then build your site again for resource copy to work.</li>
</span></span></code></pre></div></li>
<li>
<p>Note that during development, you <em>may</em> need to deleted the output folder and then build your site again for resource copy to work.</p>
</li>
</ul>
<h2 id="conclusion">Conclusion</h2>
<p>By following these steps, you can effectively manage and include both resources and non-resources in your Hugo projects, ensuring that all necessary files are available in the final output.</p>
Expand Down
Loading

0 comments on commit 602f5ad

Please sign in to comment.