<divclass="post-content"><h2id="adding-meta-description-in-hugo">Adding meta description in Hugo<ahiddenclass="anchor"aria-hidden="true"href="#adding-meta-description-in-hugo">#</a></h2>
<p>I assume you are using Luke Smith’s theme - Lugo, if you are not, you’d have to find these files yourself (e.g. search using vscode).</p>
<h3id="setting-a-global-meta-description">Setting a global meta description<ahiddenclass="anchor"aria-hidden="true"href="#setting-a-global-meta-description">#</a></h3>
<ol>
<li>Locate your config.toml or config.yaml file</li>
</span></span><spanstyle="display:flex;"><span><spanstyle="color:#c1abea">description</span> = <spanstyle="color:#63c381">"The global meta description of your website"</span></span></span></code></pre></div>
</span></span><spanstyle="display:flex;"><span><spanstyle="color:#e06c75">description</span>: <spanstyle="color:#98c379">The global meta description of your website</span></span></span></code></pre></div>
<p>It won’t work just yet because you have to update the <code>baseof.html</code> file.</p>
<h3id="updating-the-baseofhtml-file">Updating the baseof.html file<ahiddenclass="anchor"aria-hidden="true"href="#updating-the-baseofhtml-file">#</a></h3>
<ol>
<li>Locate baseof.html</li>
<li>Add or change the meta description line with the following</li>
<pretabindex="0"class="chroma"><codeclass="language-html"data-lang="html"><spanstyle="display:flex;"><span><<spanstyle="color:#e06c75">meta</span><spanstyle="color:#b3d23c">name</span><spanstyle="color:#c7bf54">=</span><spanstyle="color:#98c379">"description"</span><spanstyle="color:#b3d23c">content</span><spanstyle="color:#c7bf54">=</span><spanstyle="color:#98c379">"{{ if .Page.Params.description }}{{ .Page.Params.description }}{{ else if .Summary}}{{ .Summary }}{{else}}{{ .Site.Params.description}}{{ end }}"</span>/></span></span></code></pre></div>
<p>And now if you start your Hugo server locally with <code>hugo serve --noHTTPCache</code> and you right click on your page -> View Page Source -> Search for the meta description tag. It should match what you left in the config file.</p>
<h3id="replacing-the-global-description-with-a-custom-one">Replacing the global description with a custom one<ahiddenclass="anchor"aria-hidden="true"href="#replacing-the-global-description-with-a-custom-one">#</a></h3>
</span></span><spanstyle="display:flex;"><span><spanstyle="color:#e06c75">description</span>: <spanstyle="color:#63c381">"Your custom description for this page"</span>
<p>Following these steps would guarantee that you have a meta description for everypage with the ability for creating a custom one whenever you need it!</p>
<divstyle="padding-bottom: 0.2em; display: inline-block;"><ahref="https://vodoraslo.xyz/articles"title="List of all my articles and writings.">📜 Articles</a><strong>•</strong><ahref="https://vodoraslo.xyz/library"title="My personal library.">📚 Library</a><strong>•</strong><ahref="https://wiki.vodoraslo.xyz"title="My personal Wiki page.">🌐 Wiki</a><strong>•</strong><ahref="https://vodoraslo.xyz/index.xml"title="Subscribe via RSS for updates.">📰 RSS</a><hr></div>