Modifications to use Socials in the hugo.toml and add to the side bar

This commit is contained in:
Marcus 2024-09-18 02:17:49 +00:00
parent 5128e596d6
commit 613fc7d7a8
7 changed files with 119 additions and 3 deletions

View File

@ -1,3 +0,0 @@
##Welcome to Marcus World!
This is an attempt at making the index file. If this works we'll put some images.

17
example.html Normal file
View File

@ -0,0 +1,17 @@
{{ with .Params.hide_example }}
<!-- No data here! -->
{{ else }}
<div>
In the config.yaml or config.toml file you would have something like
<p>
[params]
name = 'Simba'
Then in the partial you use the variables with brackets like this
{{ .Site.Params.name }} or like {{ now.Year }}
Check out this guide
https://cloudcannon.com/tutorials/hugo-beginner-tutorial/hugo-templating-basics/
</p>
</div>
{{ end }}

View File

@ -49,6 +49,12 @@ preserveTaxonomyNames = true
# Text to go before copyright information
prefix= "[FSF 2016](https://www.fsf.org/about/) [GNOME Lover](https://www.gnome.org/friends/) [GPG Key](https://keys.openpgp.org/vks/v1/by-fingerprint/034C591E11591CC00ADCF3DA7DC7E4FF11629043)"
[params.socials]
mastodon = "https://tilde.zone/@mnw"
sdf-pixelfed = "https://pixelfed.sdf.org/mnw"
pixelfed = "https://pixelfed.social/mnw"
xmpp = "xmpp:mnw@jabber.sdf.org"
[menu]
# This displays buttons in the navbar to access your contents
[[menu.main]]

23
i18n/en.toml Normal file
View File

@ -0,0 +1,23 @@
[home]
other = "Home"
[posts]
other = "Posts"
[postslist]
other = "Blog posts"
[categories]
other = "Categories"
[socials]
other = "Socials"
[tags]
other = "Tags"
[backtohome]
other = "Back to Home"
[builton]
other = "Built on"

23
i18n/fr.toml Normal file
View File

@ -0,0 +1,23 @@
[home]
other = "Accueil"
[posts]
other = "Articles"
[postslist]
other = "Articles de blog"
[categories]
other = "Catégories"
[socials]
other = "Résea Social"
[tags]
other = "Etiquettes"
[backtohome]
other = "Retour à l'accueil"
[builton]
other = "Propulsé par"

45
layouts/index.html Normal file
View File

@ -0,0 +1,45 @@
{{ define "main" }}
<div class="row-fluid navmargin">
<div class="page-header">
<h1>{{ .Site.Params.mainpagetitle }}</h1>
</div>
</div>
<div class="row-fluid">
<div class="span9 bs-docs-sidebar">
<p class="lead">{{ .Site.Params.mainpagesubtitle }}</p>
<p></p>
<p>{{ .Site.Params.mainpagedesc }}</p>
<p></p>
<hr class="soften">
<p></p>
<h1>{{ i18n "postslist" }}</h1>
<ul>
{{ range first 10 .Site.RegularPages }}
{{ if eq .Type "post" }}
<li><a href="{{ .Permalink }}">{{ .Date.Format "2006-01-02" }} | {{ .Title }}</a></li>
{{ end }}
{{ end }}
</ul>
</div>
<div class="span3 bs-docs-sidebar">
<h1>{{ i18n "categories" }}</h1>
<ul class="nav nav-list bs-docs-sidenav">
{{ partial "categories.html" .}}
</ul>
<p></p>
<h1>{{ i18n "tags" }}</h1>
<ul class="nav nav-list bs-docs-sidenav">
{{ partial "tags.html" .}}
</ul>
<p></p>
<h1>{{ i18n "socials" }}</h1>
<ul class="nav nav-list bs-docs-sidenav">
{{ partial "socials.html" .}}
</ul>
</div>
</div>
{{ end }}

View File

@ -0,0 +1,5 @@
{{ range $key, $value := .Site.Params.socials }}
<li>
<a href="{{ $value }}" target=_blank>{{ $key }}</a>
</li>
{{ end }}