Skip to content

Commit

Permalink
copy over my changes from the theme until they can be upstreamed
Browse files Browse the repository at this point in the history
  • Loading branch information
luxifr committed Nov 12, 2023
1 parent a50d8ac commit 7e9b020
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 0 deletions.
53 changes: 53 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<head>
{{ if .Site.Params.forceRedirect }}
<script>
if (location.host != new URL("{{ .Site.BaseURL }}").host) location.href = "{{ .Site.BaseURL }}"
</script>
{{ end }}
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />

{{ if .OutputFormats.Get "RSS" }}
{{ with .OutputFormats.Get "RSS" }}
<link href="{{ .Permalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
<link href="{{ .Permalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}" />
{{ end }}
{{ end }}

{{- partial "head_icons.html" . -}}

<title>
{{ if and (.Title) (ne .Title .Site.Title) }}
{{ .Title }} &ndash;
{{ end }}
{{ .Site.Title | default "Ficurinia" }}
</title>

{{/*
how to update these hashes:
https://gitlab.com/gabmus/hugo-ficurinia/-/merge_requests/5
*/}}
<link href="/symbols-nerd-font/symbols-nerd-font.css" rel="stylesheet"
integrity="sha512-lydow8GLOLlYNOtHlksNCmGWWCBsbIEtikXpHzfWqx78HLlyQZHOzyLwPpKol4Th6aCwLUXOfODVYgwrd3nwKQ==" />
{{ if .Site.Params.replaceJetBrainsMono }}
<link href="/{{ .Site.Params.replaceJetBrainsMono }}/{{ .Site.Params.replaceJetBrainsMono }}.css"
rel="stylesheet" />
{{ else }}
<link href="/jetbrains-mono/jetbrains-mono.css" rel="stylesheet"
integrity="sha512-tJxlgL6v1Y7kFf+qB8SloaAMKnOAw6WouknxXtIjkBux9Y/9aX81EUWOJO8c/3l98DmjG8brr4to7zaez606Fg==" />
{{ end }}

{{ if and site.Params.cactusCommentsSiteName (.Params.comments | default true) }}
<link rel="stylesheet" href="https://latest.cactus.chat/style.css" type="text/css">
{{ end }}
{{ $style := resources.Get "/scss/style.scss" | resources.ExecuteAsTemplate "/scss/style.scss" . | resources.ToCSS
(dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") | resources.Fingerprint
"sha512" }}
<link type="text/css" rel="stylesheet" href={{ $style.Permalink }} integrity="{{ $style.Data.Integrity }}" />
{{- partial "inject/head.html" . -}}
{{- partial "head_meta_seo.html" . -}}
{{- partial "head_meta_opengraph.html" . -}}
{{- partial "head_meta_twitter.html" . -}}
<link rel="manifest" href="/manifest/index.json" />
</head>
60 changes: 60 additions & 0 deletions layouts/partials/single_post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{{- partial "inject/content-before.html" . -}}
<article class="card single">
{{ if .Params.showTitle | default true }}
<h1>{{ .Title }}</h1>
{{ end }}
{{ if (.Params.showDate | default true) }}
<p class="date">
<span title='{{ i18n "date" }}'></span>
{{- partial "date.html" .Date -}}
{{- if .Site.Params.showLastmod | default false -}}
{{- if ne (.Date | time.Format "Jan 02, 2006 3:04 PM Z07:00") (.Lastmod.Format "Jan 02, 2006 3:04 PM Z07:00")
-}}
- updated: {{- partial "date.html" .Lastmod -}}
{{ end }}
{{ end }}
</p>
{{ end }}
{{ if and (.Params.toc | default false) (.Site.Params.tocBeforeImage | default false) }}
{{- partial "toc.html" . -}}
{{ end }}
{{ if .Params.Image }}
<figure style="margin: 0">
{{ if or (hasPrefix .Params.Image "/") (hasPrefix .Params.Image "http://") (hasPrefix .Params.Image "https://") }}
<img src="{{ .Params.Image }}" alt="{{ .Params.Alt }}" />
{{ else }}
<img src="{{ .Permalink }}/{{ .Params.Image }}" alt="{{ .Params.Alt }}" />
{{ end }}
{{ if .Params.ImageCaption }}
<figcaption>
<p>{{ .Params.ImageCaption | markdownify }}</p>
</figcaption>
{{ end }}
</figure>
{{ end }}
{{ if and (.Params.toc | default false) (not (.Site.Params.tocBeforeImage | default false)) }}
{{- partial "toc.html" . -}}
{{ end }}
<div>{{ .Content }}</div>
</article>
{{ if .Params.tags }}
{{ if not .Site.Params.paperCards }}<hr />{{ end }}
<p class="articleTagsContainer">
<span></span>
<strong>{{ i18n "tagsColumn" }}</strong>
{{ range sort .Params.tags }}
<a
{{ if site.Params.buttonTags | default false }}
class="buttonTag"
{{ end }}
href="/tags/{{ . | urlize }}">#{{ . }}</a>
{{ end }}
</p>
{{ end }}
{{- partial "inject/content-after.html" . -}}
{{ if .Params.showShare | default true }}
{{- partial "share_on_fediverse.html" . -}}
{{ end }}
{{- partial "commento.html" . -}}
{{- partial "cactus_chat.html" . -}}
{{- partial "related_articles.html" . -}}

0 comments on commit 7e9b020

Please sign in to comment.