Browse Source

remove dead code

- mathjax.html: no page sets enableMathJax, and it was loading a
  useless polyfill along with some MathJax v2 code that never ran
- section.html: blog, speaking and writing have their own templates
- baseurl and figure shortcodes: no longer used

The generated site is identical.

Refs #11

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YNHsWYTXPThURz6TbVS1j3
master
Nicolas Massé 1 month ago
parent
commit
ac5a0ea9d5
  1. 4
      layouts/_partials/head.html
  2. 36
      layouts/_partials/mathjax.html
  3. 1
      layouts/_shortcodes/baseurl.html
  4. 10
      layouts/_shortcodes/figure.html
  5. 14
      layouts/section.html

4
layouts/_partials/head.html

@ -86,10 +86,6 @@
<script defer data-domain="itix.fr" src="https://plausible.io/js/plausible.js"></script> <script defer data-domain="itix.fr" src="https://plausible.io/js/plausible.js"></script>
{{- end -}} {{- end -}}
{{- if .Params.enableMathJax -}}
{{- partial "mathjax.html" . -}}
{{- end -}}
<!-- Deal with the case of english articles published in the french site --> <!-- Deal with the case of english articles published in the french site -->
{{- partial "lang-detection.html" . -}} {{- partial "lang-detection.html" . -}}
{{- if .Store.Get "en_article_in_fr_site" -}} {{- if .Store.Get "en_article_in_fr_site" -}}

36
layouts/_partials/mathjax.html

@ -1,36 +0,0 @@
<!-- From https://note.qidong.name/2018/03/hugo-mathjax/ -->
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js"></script>
<script>
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
},
svg: {
fontCache: 'global'
}
};
</script>
<script type="text/javascript" id="MathJax-script"
async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
MathJax.Hub.Queue(function() {
// Fix <code> tags after MathJax finishes running. This is a
// hack to overcome a shortcoming of Markdown. Discussion at
// https://github.com/mojombo/jekyll/issues/199
var all = MathJax.Hub.getAllJax(), i;
for(i = 0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
</script>
<style>
code.has-jax {
font: inherit;
font-size: 100%;
background: inherit;
border: inherit;
color: #515151;
}
</style>

1
layouts/_shortcodes/baseurl.html

@ -1 +0,0 @@
{{- .Page.Site.BaseURL -}}

10
layouts/_shortcodes/figure.html

@ -1,10 +0,0 @@
<!-- This shortcode renders an HTML figure based on a file dropped in the /public folder -->
{{ $url := .Get "src" }}
<figure>
<img src="{{ $url }}" alt="{{- .Get "title" | plainify -}}">
{{ with .Get "title" }}
<figcaption>
{{- . -}}
</figcaption>
{{ end }}
</figure>

14
layouts/section.html

@ -1,14 +0,0 @@
{{ define "main" }}
<!-- the section.html layout is used to render a list of articles under writing, speaking, etc. -->
<article class="section">
<header>
<h1>{{ .Title }}</h1>
</header>
{{ .Content }}
<ul>
{{ range (sort .Pages "Date").Reverse }}
<li><a href="{{.RelPermalink}}">{{ .Title }}</a></li>
{{ end }}
</ul>
</article>
{{ end }}
Loading…
Cancel
Save