<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>
</span></span><spanstyle="display:flex;"><span><spanstyle="color:#c1abea">description</span> = <spanstyle="color:#63c381">"The global meta description of your website"</span>
</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>
<divclass="highlight"><pretabindex="0"style="color:#b0c4de;background-color:#282c34;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><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>
</span></span></code></pre></div><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>
<ahref="https://vodoraslo.xyz/">Homepage</a><divclass="rssSvg"><ahref="/index.xml"><imgsrc="/rss.svg"style="max-height:1.5em"alt="RSS Feed"title="Subscribe via RSS for updates."></a></div>