Compare commits

...

10 Commits

Author SHA1 Message Date
Samuel Proulx 3fa25abce4
Add mathjax and katex support (#75)
* Add mathjax and katex support

* update readme
2022-12-29 17:22:53 +05:30
yochidros e1a3392165 fix: display read more 2022-12-05 00:19:31 +05:30
James Montgomerie 5d283cd3a9
Break out the page description from the 'index.html' layout into its own partial - this adds the ability for a site to customize the description on the main page without altering the theme. (#71) 2022-11-27 17:29:33 +05:30
9x9x9x f753261345 fix: no need to reload for theme change
Changing the theme using toggle does not require reloading the entire page using self-linking
2022-11-14 10:37:54 +05:30
Saikat Sengupta dbf65c9a03 Update README.md 2022-11-11 17:51:33 +05:30
Alex Ungurianu 055e03eeb7 Add `rel=me` to social links 2022-11-08 10:01:14 +05:30
Artem Ryabkov 2f312c3759 Fixed title and menu links overlap in header 2022-08-14 08:34:17 +05:30
Julius Rickert fa13b875f4 Add font swapping 2022-08-14 08:33:09 +05:30
ADSWT518 26f57dd1f9 chore: Change CSS for Socials in Footer again 2022-06-25 22:49:03 +05:30
Ahmed Alsuwaidi 5fbc45536a Added <script> tag support to customJS
Added a "readmore" class to the read more links to enable finegrained css
2022-03-03 23:03:05 +05:30
8 changed files with 69 additions and 16 deletions

View File

@ -26,7 +26,7 @@ $ cd themes
$ git clone https://github.com/athul/archie.git
```
Edit the `config.toml` file with `theme="archie"`
For more information read the official [setup guide](https://gohugo.io/overview/installing/) of Hugo.
For more information read the official [setup guide](https://gohugo.io/installation/) of Hugo.
## Writing Posts
Create a new `.md` file in the *content/posts* folder
@ -79,6 +79,8 @@ paginate=3 # articles per page
mode="auto" # color-mode → light,dark,toggle or auto
useCDN=false # don't use CDNs for fonts and icons, instead serve them locally.
subtitle = "Minimal and Clean [blog theme for Hugo](https://github.com/athul/archie)"
mathjax = true # enable MathJax support
katex = true # enable KaTeX support
# Social Tags

View File

@ -1,5 +1,6 @@
/* fira-sans-regular - latin */
@font-face {
font-display: swap;
font-family: 'Fira Sans';
font-style: normal;
font-weight: 400;
@ -12,10 +13,11 @@
url('../fonts/fira-sans-v10-latin-regular.svg#FiraSans') format('svg'); /* Legacy iOS */
}
/* roboto-mono-regular - latin */
@font-face {
@font-face {
font-display: swap;
font-family: 'Roboto Mono';
font-style: normal;
font-weight: 400;
font-weight: 400;
src: url('../fonts/roboto-mono-v12-latin-regular.eot'); /* IE9 Compat Modes */
src: url('../fonts/roboto-mono-v12-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/roboto-mono-v12-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
@ -25,6 +27,7 @@
}
/* ibm-plex-mono-500italic - latin */
@font-face {
font-display: swap;
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 500;

View File

@ -138,6 +138,7 @@ header {
flex-wrap: wrap;
justify-content: space-between;
margin: 1em 0;
line-height: 2.5em;
}
header .main {
@ -171,11 +172,13 @@ footer {
.soc {
display: flex;
align-items: center;
padding-right: 1rem;
margin-right: 1rem;
border-right: 2px solid;
border-bottom: none;
}
.border {
margin-left: 0.5rem;
margin-right: 0.5rem;
border: 1px solid;
}
.footer-info {
padding: var(--footer-padding);
}

View File

@ -17,14 +17,8 @@
<section class="list-item">
<h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1>
<time>{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</time>
<br><div class="description">
{{ if isset .Params "description" }}
{{ .Description }}
{{ else }}
{{ .Summary }}&hellip;
{{ end }}
</div>
<a href="{{ .RelPermalink }}">Read more ⟶</a>
<br>{{ template "partials/pagedescription.html" . }}
<a class="readmore" href="{{ .RelPermalink }}">Read more ⟶</a>
</section>
{{ end }}
{{ template "partials/paginator.html" . }}

View File

@ -1,7 +1,8 @@
<footer>
<div style="display:flex">
{{- range $index, $key := .Site.Params.Social -}}
<a class="soc" href="{{ $key.url }}" title="{{ $key.name }}"><i data-feather="{{ $key.icon }}"></i></a>
<a class="soc" href="{{ $key.url }}" rel="me" title="{{ $key.name }}"><i data-feather="{{ $key.icon }}"></i></a>
<a class="border"></a>
{{- end -}}
</div>
<div class="footer-info">

View File

@ -7,7 +7,7 @@
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
{{ if eq .Site.Params.mode "toggle" -}}
| <a id="dark-mode-toggle" onclick="toggleTheme()" href=""></a>
| <span id="dark-mode-toggle" onclick="toggleTheme()"></span>
<script src="{{ .Site.BaseURL }}js/themetoggle.js"></script>
{{ end }}
</nav>

View File

@ -43,6 +43,47 @@
{{ $darkstyle := resources.Get "css/dark.css" | fingerprint }}
<link id="darkModeStyle" rel="stylesheet" type="text/css" href="{{ $darkstyle.Permalink }}" {{ if eq .Site.Params.mode "auto" }}media="(prefers-color-scheme: dark)"{{ end }} {{ if eq .Site.Params.mode "toggle" }}disabled{{ end }} />
{{ end }}
<!-- Mathjax support -->
{{ with .Site.Params.mathjax }}
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- inline Mathjax -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
displayMath: [['$$','$$'], ['\[','\]']],
processEscapes: true,
processEnvironments: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
TeX: { equationNumbers: { autoNumber: "AMS" },
extensions: ["AMSmath.js", "AMSsymbols.js"] }
}
});
</script>
{{ end }}
<!-- KaTeX support -->
{{ with .Site.Params.katex }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.css">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/contrib/auto-render.min.js" onload="renderMathInElement(document.body);"></script>
<!-- inline KaTeX -->
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "$", right: "$", display: false}
]
});
});
</script>
{{ end }}
<!-- Custom CSS style get applied last -->
{{- if isset .Site.Params "customcss" }}
@ -54,6 +95,8 @@
{{- range .Site.Params.customJS }}
{{- if or (hasPrefix . "http://") (hasPrefix . "https://") }}
<script src="{{ . }}"></script>
{{- else if (hasPrefix . "<script")}}
{{ .| safeHTML }}
{{- else }}
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
{{- end }}

View File

@ -0,0 +1,7 @@
<div class="description">
{{ if isset .Params "description" }}
{{ .Description }}
{{ else }}
{{ .Summary }}&hellip;
{{ end }}
</div>