Skip to content

Commit

Permalink
Merge pull request #179 from edrlab/fixes
Browse files Browse the repository at this point in the history
Footer revisited
  • Loading branch information
gautierchomel authored Jan 16, 2025
2 parents b2c48d8 + bfd00da commit 811a51c
Show file tree
Hide file tree
Showing 17 changed files with 122 additions and 57 deletions.
22 changes: 12 additions & 10 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -687,9 +687,10 @@ kbd {
background-color: $color-dark-blue;
position: relative;
min-height: fit-content;
text-align: center;

small {
position: absolute;
// position: absolute;
bottom: 10px;
left: 20px;
a {
Expand Down Expand Up @@ -1265,15 +1266,16 @@ kbd {
}

footer {
.navbar-nav, .left {
display: none;
}

.row {
div {
flex: 0;
}
}
text-align: center;
// .navbar-nav, .left {
// display: none;
// }

// .row {
// div {
// flex: 0;
// }
// }
}

.about_title {
Expand Down
15 changes: 11 additions & 4 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ enableMissingTranslationPlaceholders = true

enableRobotsTXT = true

[sitemap]
changeFreq = ''
disable = false
filename = 'sitemap.xml'
priority = -1

# Will give values to .Lastmod etc.
enableGitInfo = true

Expand Down Expand Up @@ -98,10 +104,11 @@ section = ["HTML", "print", "RSS"]

[params]
copyright = "EDRLab"
# thorium2 = "../../docs/"
# privacy_policy = "../../th3/900_about_thorium/902_thorium-privacy-policy/"
# accessibility = "../../th3/900_about_thorium/903_thorium-accessibility-policy/"
# tou = "../../th3/900_about_thorium/901_thorium-terms-of-use/"
# thorium2 = "/docs/"
# privacy_policy = "/th3/900_about_thorium/902_thorium-privacy-policy/"
# accessibility = "/th3/900_about_thorium/903_thorium-accessibility-policy/"
# tou = "/th3/900_about_thorium/901_thorium-terms-of-use/"
sitemap = "sitemap"

# First one is picked as the Twitter card image if not set on page.
# images = ["images/project-illustration.png"]
Expand Down
7 changes: 7 additions & 0 deletions content/en/sitemap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Sitemap"
---


{{< sitemap >}}

7 changes: 7 additions & 0 deletions content/es/sitemap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Sitemap"
---


{{< sitemap >}}

7 changes: 7 additions & 0 deletions content/fr/sitemap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Sitemap"
---


{{< sitemap >}}

3 changes: 3 additions & 0 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ other = "in"
other = "all"

# Footer text
[sitemap]
other = "Site Map"

[footer_all_rights_reserved]
other = "All Rights Reserved"

Expand Down
3 changes: 3 additions & 0 deletions i18n/es.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ other = "en"
other = "todos"

# Footer text
[sitemap]
other = "Mapa del sitio"

[footer_all_rights_reserved]
other = "Derechos reservados"

Expand Down
3 changes: 3 additions & 0 deletions i18n/fr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ other = "dans"
other = "toutes les"

# Footer text
[sitemap]
other = "Carte du site"

[footer_all_rights_reserved]
other = "Tous droits résérvés"

Expand Down
5 changes: 1 addition & 4 deletions layouts/docs/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ <h1>{{ .Title }}</h1>
{{ partial "feedback.html" .Site.Params.ui.feedback }}
<br />
{{ end }}
{{ if (.Site.DisqusShortname) }}
<br />
{{ partial "disqus-comment.html" . }}
{{ end }}

{{ partial "page-meta-lastmod.html" . }}
</div>
{{ end }}
23 changes: 0 additions & 23 deletions layouts/partials/disqus-comment.html

This file was deleted.

24 changes: 16 additions & 8 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ $links := .Site.Params.links }}
<footer class="py-5 row d-print-none footer">
<footer class="py-5 d-print-none footer center">
{{/* <div class="container-fluid mx-sm-5">
<div class="row">
<div class="">
Expand Down Expand Up @@ -33,7 +33,7 @@
<!-- <input type="checkbox" name="accordion-1" id="cb2"> -->
<label for="cb2" class="tab__label">
{{ with .Site.Params.thorium2 }}
<a href="{{ . }}">
<a href="{{ .Site.Params.Baseurl }}/{{ .Language.Lang }}/{{ . }}">
<img src="/images/icons/footer-th2-icon.svg" alt="" role="presentation"/>
{{ T "footer_thorium2" }}
<div class="tab__content"></div>
Expand All @@ -45,7 +45,7 @@
<!-- <input type="checkbox" name="accordion-1" id="cb3"> -->
<label for="cb3" class="tab__label">
{{ with .Site.Params.privacy_policy }}
<a href="{{ . }}">
<a href="{{ .Site.Params.Baseurl }}/{{ .Language.Lang }}/{{ . }}">
<img src="/images/icons/footer-privacy-icon.svg" alt="" role="presentation"/>
{{ T "footer_privacy_policy" }}
<div class="tab__content"></div>
Expand All @@ -57,7 +57,7 @@
<!-- <input type="checkbox" name="accordion-1" id="cb4"> -->
<label for="cb4" class="tab__label">
{{ with .Site.Params.accessibility }}
<a href="{{ . }}">
<a href="{{ .Site.Params.Baseurl }}/{{ .Language.Lang }}/{{ . }}">">
<img src="/images/icons/footer-access-icon.svg" alt="" role="presentation"/>
{{ T "footer_accessibility" }}
<div class="tab__content"></div>
Expand All @@ -69,7 +69,7 @@
<!-- <input type="checkbox" name="accordion-1" id="cb5"> -->
<label for="cb5" class="tab__label">
{{ with .Site.Params.tou }}
<a href="{{ . }}">
<a href="{{ .Site.Params.Baseurl }}/{{ .Language.Lang }}/{{ . }}">
<img src="/images/icons/footer-tou-icon.svg" alt="" role="presentation"/>
{{ T "footer_tou" }}
<div class="tab__content"></div>
Expand Down Expand Up @@ -119,8 +119,16 @@
</div>
</div> */}}
<small class="text-white center">© 2024 <a href="https://edrlab.org">EDRLab </a> | <a
href="https://github.com/edrlab/thorium-reader-doc?tab=CC-BY-4.0-1-ov-file#readme">CC by license</a> </small>
</footer>
href="https://github.com/edrlab/thorium-reader-doc?tab=CC-BY-4.0-1-ov-file#readme">license CC by 4.0</a> |
{{/* <a href="{{ .RelPermalink }}">{{ .Language.Lang }}: {{ .LinkTitle }}{{ if .IsPage }} ({{ i18n "wordCount" . }}){{ end }}</a>
*/}}
<a
href="{{ .Site.Params.Baseurl }}/{{ .Language.Lang }}/sitemap/"> {{ T "sitemap" }}</a> {{ with .Site.Params.sitemap }}
{{/* <a href="{{ . }}">
{{ T "sitemap" }}
</a> */}}
{{ end}}</small>
{{/* </footer>
{{ define "footer-links-block" }}
<ul class="list-inline mb-0">
{{ range . }}
Expand All @@ -131,6 +139,6 @@
</li> -->
{{ end }}
</ul>
{{ end }}
{{ end }} */}}


5 changes: 5 additions & 0 deletions layouts/shortcodes/sitemap.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ul>
{{ range .Site.AllPages }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
24 changes: 24 additions & 0 deletions layouts/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{ range .Data.Pages }}
{{ if not (or (hasPrefix .RelPermalink "/tags") (hasPrefix .RelPermalink "/categories")) }}
<url>
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
<xhtml:link
rel="alternate"
hreflang="{{ .Lang }}"
href="{{ .Permalink }}"
/>{{ end }}
<xhtml:link
rel="alternate"
hreflang="{{ .Lang }}"
href="{{ .Permalink }}"
/>{{ end }}
</url>
{{ end }}
{{ end }}
</urlset>
11 changes: 11 additions & 0 deletions layouts/sitemapindex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{{ range . }}
<sitemap>
<loc>{{ .SitemapAbsURL }}</loc>
{{ if not .Lastmod.IsZero }}
<lastmod>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod>
{{ end }}
</sitemap>
{{ end }}
</sitemapindex>
12 changes: 12 additions & 0 deletions layouts/sitemapindex.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<?xml-stylesheet type="text/xsl" href="/sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{{ range . }}
<sitemap>
<loc>{{ .SitemapAbsURL }}</loc>
{{ if not .Lastmod.IsZero }}
<lastmod>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod>
{{ end }}
</sitemap>
{{ end }}
</sitemapindex>
4 changes: 0 additions & 4 deletions layouts/swagger/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ <h1>{{ .Title }}</h1>
{{ partial "feedback.html" .Site.Params.ui.feedback }}
<br />
{{ end }}
{{ if (.Site.DisqusShortname) }}
<br />
{{ partial "disqus-comment.html" . }}
{{ end }}
{{ partial "page-meta-lastmod.html" . }}
</div>
{{ end }}
4 changes: 0 additions & 4 deletions layouts/th3/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ <h1>{{ .Title }}</h1>
{{ partial "feedback.html" .Site.Params.ui.feedback }}
<br />
{{ end }}
{{ if (.Site.DisqusShortname) }}
<br />
{{ partial "disqus-comment.html" . }}
{{ end }}
{{ partial "page-meta-lastmod.html" . }}
</div>
{{ end }}

0 comments on commit 811a51c

Please sign in to comment.