Merge branch 'master' into date-improvements
1 files deleted
4 files added
7 files modified
| | |
| | | - Multilingual |
| | | - 100⁄100 Google Lighthouse score |
| | | - Google Analytics (optional) |
| | | - SimpleAnalytics (optional) |
| | | - Comments powered by Disqus (optional) |
| | | - Katex support (optional) |
| | | - Formspree Contact Form (optional) |
| | |
| | | |
| | | Add you own favicon in `static/favicons/favicon.ico`. |
| | | |
| | | ### Copyright |
| | | By default the copyright, will show the current year, but you can change this by configuring the `copyright` parameter. |
| | | ```toml |
| | | copyright = "2020-2021" |
| | | ``` |
| | | |
| | | ### Navigation items |
| | | |
| | | Non-content entries can be added right from the `config.toml` file. |
| | |
| | | displayMode = "dark" |
| | | ``` |
| | | |
| | | ### Disable Theme Switcher |
| | | You can easily disable the theme switcher from the `config.toml`. All you have to do is to set the parameter `disableThemeSwitcher` to `true`. |
| | | ```toml |
| | | [params] |
| | | disableThemeSwitcher = true # Theme switcher is enabled by default |
| | | ``` |
| | | |
| | | ### Disable Animations |
| | | You can easily disable the animations from the `config.toml`. All you have to do is to set the parameter `doNotLoadAnimations` to `true`. |
| | | ```toml |
| | |
| | | googleAnalytics = "UA-123-45" |
| | | ``` |
| | | |
| | | ### Simple Analytics |
| | | |
| | | To use Simple Analytics, it has to be enabled by setting the parameter to true. If you are using a custom subdomain to evade Adblockers, then specify the URL without a trailing slash. |
| | | |
| | | ```toml |
| | | [params.simpleAnalytics] |
| | | enable = true |
| | | # customurl = "https://analytics.example.com" |
| | | ``` |
| | | |
| | | ### Google Site Verification |
| | | |
| | | To use Google Site Verification, add the following line to the `[params]`: |
| | |
| | | // initialize default value |
| | | function getTheme() { |
| | | return localStorage.getItem('theme') ? localStorage.getItem('theme') : null; |
| | | } |
| | | |
| | | function setTheme(style) { |
| | | document.documentElement.setAttribute('data-theme', style); |
| | | localStorage.setItem('theme', style); |
| | | } |
| | | |
| | | function init() { |
| | | // initialize default value |
| | | var theme = getTheme(); |
| | | |
| | | // check if a prefered color theme is set for users that have never been to our site |
| | | const userPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; |
| | | if (theme === null) { |
| | | if (userPrefersDark) { |
| | | setTheme('dark'); |
| | | } else if (!document.documentElement.getAttribute('data-theme')) { |
| | | setTheme('light'); |
| | | } else { |
| | | setTheme(document.documentElement.getAttribute('data-theme')); |
| | | } |
| | | } else { |
| | | // load a stored theme |
| | | if (theme == 'light') { |
| | | document.documentElement.setAttribute('data-theme', 'light'); |
| | | } else { |
| | | document.documentElement.setAttribute('data-theme', 'dark'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // switch themes |
| | | function switchTheme(e) { |
| | | var theme = getTheme(); |
| | | if (theme == 'light') { |
| | | setTheme('dark'); |
| | | } else { |
| | | setTheme('light'); |
| | | } |
| | | } |
| | | |
| | | document.addEventListener('DOMContentLoaded', function () { |
| | | var themeSwitcher = document.querySelector('.theme-switch'); |
| | | themeSwitcher.addEventListener('click', switchTheme, false); |
| | | }, false); |
| | | |
| | | document.addEventListener("DOMContentLoaded", function () { |
| | | // Get all "navbar-burger" elements |
| | | var $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll(".navbar-burger"), 0); |
| | |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | init(); |
| | | }); |
| New file |
| | |
| | | // initialize default value |
| | | function getTheme() { |
| | | return localStorage.getItem('theme') ? localStorage.getItem('theme') : null; |
| | | } |
| | | |
| | | function setTheme(style) { |
| | | document.documentElement.setAttribute('data-theme', style); |
| | | localStorage.setItem('theme', style); |
| | | } |
| | | |
| | | function init() { |
| | | // initialize default value |
| | | const theme = getTheme(); |
| | | |
| | | // check if a preferred color theme is set for users that have never been to our site |
| | | const userPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; |
| | | if (theme === null) { |
| | | if (userPrefersDark) { |
| | | setTheme('dark'); |
| | | } else if (!document.documentElement.getAttribute('data-theme')) { |
| | | setTheme('light'); |
| | | } else { |
| | | setTheme(document.documentElement.getAttribute('data-theme')); |
| | | } |
| | | } else { |
| | | // load a stored theme |
| | | if (theme === 'light') { |
| | | document.documentElement.setAttribute('data-theme', 'light'); |
| | | } else { |
| | | document.documentElement.setAttribute('data-theme', 'dark'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // switch themes |
| | | function switchTheme() { |
| | | const theme = getTheme(); |
| | | if (theme === 'light') { |
| | | setTheme('dark'); |
| | | } else { |
| | | setTheme('light'); |
| | | } |
| | | } |
| | | |
| | | document.addEventListener('DOMContentLoaded', function () { |
| | | const themeSwitcher = document.querySelector('.theme-switch'); |
| | | themeSwitcher.addEventListener('click', switchTheme, false); |
| | | }, false); |
| | | |
| | | init(); |
| | |
| | | [params] |
| | | title = "I'm Jane Doe" |
| | | author = "Jane Doe" |
| | | #copyright = "2020-2021" |
| | | description = "Call me Jane" |
| | | profilePicture = "images/profile.jpg" |
| | | keywords = "" |
| | |
| | | #contactFormAction = "https://formspree.io/f/your-form-hash-here" |
| | | # Google Site Verify |
| | | #googleSiteVerify = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" |
| | | # indexDateFormat = "Mon, Jan 2, 2006" |
| | | # listDateFormat = "Jan 2" |
| | | # singleDateFormat = "Mon, Jan 2, 2006" |
| | | |
| | | indexDateFormat = "Mon, Jan 2, 2006" |
| | | listDateFormat = "Jan 2" |
| | | singleDateFormat = "Mon, Jan 2, 2006" |
| | | |
| | | [params.simpleAnalytics] |
| | | # enable = true |
| | | # customurl = "https://analytics.example.com" |
| | | |
| | | ## Math settings |
| | | [params.math] |
| New file |
| | |
| | | [category] |
| | | other = "categoria" |
| | | |
| | | [tag] |
| | | other = "etiqueta" |
| | | |
| | | [reading_time] |
| | | one = "Tempo de leitura: 1 minuto" |
| | | other = "Tempo de leitura: {{ .Count }} minutos" |
| | | |
| | | [page_not_found] |
| | | other = "Página não encontrada" |
| | | |
| | | [page_does_not_exist] |
| | | other = "Desculpa, esta página não existe." |
| | | |
| | | [head_back] |
| | | other = "Retornar à <a href=\"{{ . }}\">página inicial</a>." |
| | | |
| | | [comments] |
| | | other = "comentários" |
| | | |
| | | [send] |
| | | other = "Enviar" |
| New file |
| | |
| | | [category] |
| | | other = "分类" |
| | | |
| | | [tag] |
| | | other = "标签" |
| | | |
| | | [reading_time] |
| | | one = "阅读时间 1 分钟" |
| | | other = "阅读时间 {{ .Count }} 分钟" |
| | | |
| | | [page_not_found] |
| | | other = "页面未找到" |
| | | |
| | | [page_does_not_exist] |
| | | other = "抱歉,此页面不存在" |
| | | |
| | | [head_back] |
| | | other = "返回<a href=\"{{ . }}\">首页</a>." |
| | | |
| | | [comments] |
| | | other = "评论" |
| | | |
| | | [send] |
| | | other = "发送" |
| | |
| | | </div> |
| | | |
| | | {{- partial "footer.html" . -}} |
| | | {{- if (eq .Site.Params.simpleAnalytics.enable true) -}} |
| | | {{- partial "analytics/simpleanalytics.html" . -}} |
| | | {{- end -}} |
| | | </body> |
| | | |
| | | </html> |
| New file |
| | |
| | | {{ with .Site.Params.simpleAnalytics.customUrl }} |
| | | <script async defer src="{{ . | relURL }}/latest.js"></script> |
| | | <noscript><img src="{{ . | relURL }}/noscript.gif" alt=""/></noscript> |
| | | {{ else }} |
| | | <script async defer src=" https://scripts.simpleanalyticscdn.com/latest.js"></script> |
| | | <noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt=""/></noscript> |
| | | {{ end }} |
| | |
| | | {{ end -}} |
| | | |
| | | <!-- JavaScript --> |
| | | {{ $anatole := resources.Get "js/anatole-header.js" }} |
| | | {{ $secureJS := $anatole | resources.Minify | resources.Fingerprint }} |
| | | {{ $anatoleHeader := resources.Get "js/anatole-header.js" }} |
| | | {{ $secureHeaderJS := $anatoleHeader | resources.Minify | resources.Fingerprint }} |
| | | <script type="text/javascript" |
| | | src="{{ $secureJS.Permalink }}" |
| | | integrity="{{ $secureJS.Data.Integrity }}" |
| | | src="{{ $secureHeaderJS.Permalink }}" |
| | | integrity="{{ $secureHeaderJS.Data.Integrity }}" |
| | | crossorigin="anonymous"></script> |
| | | |
| | | |
| | | {{ if not .Site.Params.disableThemeSwitcher }} |
| | | {{ $anatoleThemeSwitcher := resources.Get "js/anatole-theme-switcher.js" }} |
| | | {{ $secureThemeSwitcherJS := $anatoleThemeSwitcher | resources.Minify | resources.Fingerprint }} |
| | | <script type="text/javascript" |
| | | src="{{ $secureThemeSwitcherJS.Permalink }}" |
| | | integrity="{{ $secureThemeSwitcherJS.Data.Integrity }}" |
| | | crossorigin="anonymous"></script> |
| | | {{ end }} |
| | | |
| | | {{- $js := "" -}} |
| | | {{- range .Site.Params.customJs -}} |
| | | {{- if or (in . "http://") (in . "https://") -}} |
| | |
| | | </li> |
| | | {{ end }} |
| | | {{ end }} |
| | | <li class="theme-switch-item"> |
| | | <a class="theme-switch" title="Switch Theme"> |
| | | <i class="fas fa-adjust fa-fw" aria-hidden="true"></i> |
| | | </a> |
| | | </li> |
| | | {{ if not .Site.Params.disableThemeSwitcher }} |
| | | <li class="theme-switch-item"> |
| | | <a class="theme-switch" title="Switch Theme"> |
| | | <i class="fas fa-adjust fa-fw" aria-hidden="true"></i> |
| | | </a> |
| | | </li> |
| | | {{ end }} |
| | | </ul> |
| | | </div> |
| | |
| | | {{ end }} |
| | | </ul> |
| | | <div class="footer"> |
| | | <div class="by_farbox">© {{ .Site.Params.author }} {{ now.Format "2006"}} </div> |
| | | <div class="by_farbox">© {{ .Site.Params.author }} {{ if isset .Site.Params "copyright" }} {{ .Site.Params.copyright }} {{ else }} {{ now.Format "2006"}} {{end}}</div> |
| | | </div> |
| | | </div> |