Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Update hugo theme from master #7

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
53c63fe
Fix RSS links (#117)
Jean85 Feb 9, 2018
cd931d6
Fix invald close tag (#119)
pacollins Feb 9, 2018
9d07761
Remove duplicate inclusion of Highlight.js (#116)
Jean85 Feb 10, 2018
45ef714
Add OpenGraph meta tags (#115)
Jean85 Feb 10, 2018
1a8075a
Recent posts should be a class not ID (#105)
rlees85 Feb 10, 2018
300f40e
Patch RSS icon to list
pacollins Feb 10, 2018
60201d3
Bugfix/issue 114 (#121)
dudil Feb 11, 2018
187e213
Add the possibility to set only specific social networks to share the…
dudil Feb 11, 2018
62b074f
Add capability for mathjax equations per instructions here (#126)
DanOvando Feb 25, 2018
020882f
- Add SEO elements to header, i18l friendly (#122)
dudil Feb 27, 2018
d572ce5
Port back the modified theme from the blog repository
Jean85 Feb 7, 2018
e392d33
Add topCategoriesThreshold parameter
Jean85 Feb 7, 2018
914d7d0
Change URL for 'Learn more' button
Jean85 Feb 7, 2018
b896936
Add more copyright information
Jean85 Feb 7, 2018
ee63627
Revert "Add topCategoriesThreshold parameter"
Jean85 Feb 7, 2018
37ff758
Re-add ToC
Jean85 Feb 7, 2018
9ac3c00
Apply CSS fixes for multi-authors in the sidebar
Jean85 Feb 7, 2018
a666040
Port facile-it/facile-it.github.io#15
Jean85 Feb 7, 2018
16b447d
Use super-reduced highlight.js
Jean85 Feb 7, 2018
5ad27f3
Move social share to the bottom of the post
Jean85 Feb 7, 2018
9dcf43f
Restore usage of CDN HL.js
Jean85 Feb 7, 2018
8073529
Fix jQuery-lazy init
Jean85 Feb 7, 2018
35f6db8
Update theme for Hugo 0.69.0
salvatorecordiano Apr 16, 2020
40fa6bd
Refine taxonomies refactors following Hugo docs
Jean85 Apr 17, 2020
31b9451
Fix post preview image
salvatorecordiano Dec 20, 2020
606eb96
fix standard preview on X (Twitter)
Oct 19, 2023
4adcbb0
fix preview on Telegram
Oct 20, 2023
451b25f
update twitter to x.com, update fontawesome
Jan 3, 2024
0a3a53a
new icons, update fontawesome, added Threads social network, removed …
Jan 4, 2024
f814dae
Fix preview for Whatsapp
Jan 22, 2024
19d2155
rebase new-icons into master
Apr 17, 2024
e4b52e8
update fontawesome to 6.4.2
Oct 27, 2023
f7e3594
fix icon dimension
Apr 17, 2024
b9fe97d
added og:title and og:description
Oct 30, 2023
1162118
Revert "added og:title and og:description"
Oct 30, 2023
b84a926
rebasing
Apr 17, 2024
463509a
rebasing
Apr 17, 2024
3eacd21
rebasing
Apr 17, 2024
a0515d2
fix build
Oct 30, 2023
1e88c6f
Merge branch 'master' into update_hugo_theme_from_master
pasalino Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interested in seeing a live example.
- [exampleSite](#examplesite)
- [config.toml](#configtoml)
- [Hugo's Built-In Server](#hugos-built-in-server)
- [Hugo's website SEO](#hugos-website-seo)
- [Shortcodes](#shortcodes)
- [fancybox](#fancybox)
- [img-post](#img-post)
Expand Down Expand Up @@ -115,6 +116,37 @@ hugo server

You will then be able to view your live website at [localhost:1313](http://localhost:1313).

### Hugo's website SEO

This theme support SEO elements for your website.
It was adapted and integrated thanks to the following guide:
[https://keithpblog.org/post/hugo-website-seo/](https://keithpblog.org/post/hugo-website-seo/)

If you wish to enable SEO on this theme, follow these instructions:
1. To include the following parameters in your _config.toml_
```
# .config.toml
...
enableRobotsTXT = true
canonifyURLs = true
# and if you think your md file names or locations might change:
[permalinks]
post = "/blog/:title/"
...
```

2. Add your website to Google Search Console:
- Login to the [Google Search Console](https://www.google.com/webmasters/tools/home)
- Add your website as property
- Add the html page as required by google to verify ownership
- Submit the sitemap (/sitemap.xml) for indexing
- Wait

3. Add your website to Bing
- Login to the [Bing Webmaster Console](https://www.bing.com/toolbox/webmaster/)
- Add your site, details and verify
- From the 3 option, we recommend adding the xml file to you website

## Shortcodes
In addition to the native [Hugo shortcodes](https://gohugo.io/extras/shortcodes/),
the theme also includes the following codes that I hope you find useful:
Expand Down
19 changes: 17 additions & 2 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ paginate = 3
disqusShortname = "shortname"
googleAnalytics = ""
pluralizeListTitles = false
# Set the followings to true as part of your site SEO
enableRobotsTXT = true
canonifyURLs = true

[params]
# Sets the meta tag description
Expand Down Expand Up @@ -39,6 +42,16 @@ pluralizeListTitles = false
faviconVersion = ""
# Sets Social Share links to appear on posts
socialShare = true
# Sets specific share to appear on posts (default behavior is to appear)
socialShareTwitter = true
socialShareGoogleplus = true
socialShareFacebook = true
socialShareReddit = true
socialShareLinkedin = true
socialShareStumbleupon = true
socialSharePinterest = true
socialShareEmail = true

# Load custom CSS or JavaScript files. The variable is an array so that you
# can load multiple files if necessary. You can also load the standard theme
# files by adding the value, "default".
Expand All @@ -53,7 +66,9 @@ pluralizeListTitles = false
highlightjsCDN = "//cdn.bootcss.com"
highlightjsLang = ["r", "yaml", "css"]
highlightjsTheme = "github"

MathJaxCDN = "//cdn.bootcss.com"
MathJaxVersion = "2.7.1"

# Disqus will take priority over Staticman (github.com/eduardoboucas/staticman)
# due to its ease of use. Feel free to check out both and decide what you would
# prefer to use. See Staticman.yml for additional settings.
Expand Down Expand Up @@ -177,6 +192,6 @@ pluralizeListTitles = false
vine = ""
googlescholar = ""
orcid = ""
researchgate = "example"
researchgate = "example"
# Email
email = "example"
1 change: 1 addition & 0 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

<!-- This is called by default since this theme uses highlight.js -->
<script>hljs.initHighlightingOnLoad();</script>
{{ partial "footer_mathjax" . }}
<script type="text/javascript">
$(function() {
$('.lazy').Lazy();
Expand Down
5 changes: 5 additions & 0 deletions layouts/partials/footer_mathjax.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script src="//yihui.name/js/math-code.js"></script>
<script async
src="{{ .Site.Params.MathJaxCDN | default "//cdn.bootcss.com"}}/mathjax/{{ .Site.Params.MathJaxVersion | default "2.7.1" }}/MathJax.js?config=TeX-MML-AM_CHTML">
</script>

1 change: 1 addition & 0 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-->
<html>
<head>
{{ partial "seo_schema" . }}
{{ with $.Scratch.Get "generalTitle" }}
<title>{{ . }}</title>
{{ else }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h3>
</section>

<!-- Posts List -->
<section id="recent-posts">
<section class="recent-posts">
<div class="mini-posts">
<header>
<h3>Recent Posts</h3>
Expand Down
5 changes: 5 additions & 0 deletions layouts/partials/rss-icon.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ if .RSSLink }}
<li><a href="{{ .RSSLink }}" type="application/rss+xml" target="_blank" title="RSS" class="fa fa-rss"></a></li>
{{ else }}
<li><a href="{{ .Site.RSSLink }}" type="application/rss+xml" target="_blank" title="RSS" class="fa fa-rss"></a></li>
{{ end }}
26 changes: 26 additions & 0 deletions layouts/partials/seo_schema.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "BlogPosting",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Site.BaseURL }}"
},
"articleSection" : "{{ .Section }}",
"name" : "{{ .Title }}",
"headline" : "{{ .Title }}",
"description" : "{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}",
"inLanguage" : "{{ .Lang }}",
"author" : "{{ range .Site.Author }}{{ . }}{{ end }}",
"creator" : "{{ range .Site.Author }}{{ . }}{{ end }}",
"publisher": "{{ range .Site.Author }}{{ . }}{{ end }}",
"accountablePerson" : "{{ range .Site.Author }}{{ . }}{{ end }}",
"copyrightHolder" : "{{ range .Site.Author }}{{ . }}{{ end }}",
"copyrightYear" : "{{ .Date.Format "2006" }}",
"datePublished": "{{ .Date }}",
"dateModified" : "{{ .Date }}",
"url" : "{{ .Permalink }}",
"wordCount" : "{{ .WordCount }}",
"keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}"{{ . }}",{{ end }}{{ end }}"Blog" ]
}
</script>
17 changes: 16 additions & 1 deletion layouts/partials/share-links.html
Original file line number Diff line number Diff line change
@@ -1,57 +1,72 @@
<!-- Social Share Button HTML -->

<!-- Twitter -->
{{ if .Site.Params.socialShareTwitter | default true}}
<li>
<a href="//x.com/share?url={{ .Permalink }}&amp;text={{ .Title }}&amp;via={{ .Site.Social.twitter }}" target="_blank" class="share-btn twitter">
<i class="fa-brands fa-square-x-twitter"></i>
<p>Twitter</p>
<p>X</p>
</a>
</li>
{{ end }}

<!-- Facebook -->
{{ if .Site.Params.socialShareFacebook | default true}}

<li>
<a href="//www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" target="_blank" class="share-btn facebook">
<i class="fa-brands fa-facebook"></i>
<p>Facebook</p>
</a>
</li>
{{ end }}

<!-- Reddit -->
{{ if .Site.Params.socialShareReddit | default true}}
<li>
<a href="//reddit.com/submit?url={{ .Permalink }}&amp;title={{ .Title }}" target="_blank" class="share-btn reddit">
<i class="fa-brand fa-reddit-alien"></i>
<p>Reddit</p>
</a>
</li>
{{ end }}

<!-- LinkedIn -->
{{ if .Site.Params.socialShareLinkedin | default true}}
<li>
<a href="//www.linkedin.com/shareArticle?url={{ .Permalink }}&amp;title={{ .Title }}" target="_blank" class="share-btn linkedin">
<i class="fa-brand fa-linkedin"></i>
<p>LinkedIn</p>
</a>
</li>
{{ end }}

<!-- StumbleUpon -->
{{ if .Site.Params.socialShareStumbleupon | default true}}
<li>
<a href="//www.stumbleupon.com/submit?url={{ .Permalink }}&amp;title={{ .Title }}" target="_blank" class="share-btn stumbleupon">
<i class="fa-brand fa-stumbleupon"></i>
<p>StumbleUpon</p>
</a>
</li>
{{ end }}

<!-- Pintrest -->
{{ if .Site.Params.socialSharePinterest | default true}}
<li>
<a href="//www.pinterest.com/pin/create/button/?url={{ .Permalink }}&amp;description={{ .Title }}" target="_blank" class="share-btn pinterest">
<i class="fa-brand fa-pinterest-p"></i>
<p>Pinterest</p>
</a>
</li>
{{ end }}

<!-- Email -->
{{ if .Site.Params.socialShareEmail | default true}}
<li>
<a href="mailto:?subject=Check out this post by {{ .Params.author }}&amp;body={{ .Permalink }}" target="_blank" class="share-btn email">
<i class="fa-solid fa-envelope"></i>
<p>Email</p>
</a>
</li>
{{ end }}
4 changes: 2 additions & 2 deletions layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h2>{{ .header }}</h2>
</section>

<!-- Posts List -->
<section id="recent-posts">
<section class="recent-posts">
<div class="mini-posts">
<header>
<h3>Recent Posts</h3>
Expand Down Expand Up @@ -127,7 +127,7 @@ <h3>
<!-- About -->
{{ with .Site.Params.intro.about }}
<section id="mini-bio">
<h3>About</h1>
<h3>About</h3>
<p>{{ . | safeHTML }}</p>
<a href="/ita/chi-siamo/" class="button">Learn More</a>
</section>
Expand Down
8 changes: 5 additions & 3 deletions static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@

}

}

@media screen and (max-width: 980px) {

body, input, select, textarea {
Expand Down Expand Up @@ -210,6 +208,10 @@
border-bottom: 0;
}

h1 {
font-size: 1.3em;
}

h2 {
font-size: 1.1em;
}
Expand Down Expand Up @@ -569,7 +571,7 @@
select:hover,
textarea:hover {
-webkit-transition:border-color 0.3s ease-in-out;
moz-transition:border-color 0.3s ease-in-out;
-moz-transition:border-color 0.3s ease-in-out;
transition:border-color 0.3s ease-in-out;
border-color: #2ebaae;
}
Expand Down