Skip to content

Commit

Permalink
graphic fixes + theme upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
domysh committed Jan 16, 2024
1 parent 34bf02c commit adeb106
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 27 deletions.
15 changes: 8 additions & 7 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<!DOCTYPE html>
<!doctype html>

{{ $.Scratch.Delete "bg_color" }}<!---->
{{ $.Scratch.Delete "social_list" }}<!---->
{{ $.Scratch.Delete "avatar_url" }}<!---->

<!-- bg_color -->
{{ $color_map := dict "linen" "#faf6f1" "wheat" "#f1efe1" "gray" "#fbfbfb"
{{ $color_map := dict "linen" "#faf8f1" "wheat" "#f8f5d7" "gray" "#fbfbfb"
"light" "#fff" }}<!---->
{{ $.Scratch.Set "bg_color" (index $color_map (site.Params.color | default
(print "linen"))) }}<!---->
{{ $bg_color := $.Scratch.Get "bg_color" }}<!---->

<!-- social_list -->
{{ $social_params := slice "twitter" "github" "instagram" "mastodon" "discord" "rss" }}<!---->
{{ $social_params := slice "twitter" "github" "instagram" "linkedin" "discord" "mastodon" "rss" }}<!---->
{{ range $social_params }}<!---->
{{ if isset site.Params . }}<!---->
{{ $.Scratch.Add "social_list" (slice .) }}<!---->
Expand All @@ -32,16 +33,16 @@
{{ end }}<!---->

<html
class="not-ready text-sm lg:text-base"
style="--bg: {{ $.Scratch.Get `bg_color` }}"
lang="{{ site.LanguageCode }}"
class="not-ready lg:text-base"
style="--bg: {{ $bg_color }}"
lang="{{ or site.LanguageCode site.Language.Lang }}"
>
{{ partial "head.html" . }}
<body class="text-black duration-200 ease-out dark:text-white">
{{ partial "header.html" . }}

<main
class="prose prose-neutral relative mx-auto min-h-[calc(100%-10rem)] max-w-3xl px-8 pt-16 dark:prose-invert"
class="prose prose-neutral relative mx-auto min-h-[calc(100%-9rem)] max-w-3xl px-8 pb-16 pt-12 dark:prose-invert"
>
{{ block "main" . }}{{ end }}
</main>
Expand Down
15 changes: 9 additions & 6 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{{ define "main" }}

<!-- Tag Title -->
<h1>{{ .Title }}</h1>
{{ if not $.IsHome }}<!---->
<h1>{{ .Title }}</h1>
{{ end }}

{{ .Content }}

<!-- $pages -->
Expand All @@ -19,10 +22,10 @@ <h1>{{ .Title }}</h1>

{{ $avatar_url := $.Scratch.Get "avatar_url" }}<!---->
{{ if or $avatar_url site.Params.name }}
<div class="-mt-2 mb-20 flex items-center">
<div class="-mt-2 mb-16 flex items-center">
{{ if $avatar_url }}
<div
class="mr-5 shrink-0 rounded-full border-[0.5px] border-black/10 bg-white/50 p-3 shadow-xl dark:bg-white/80"
class="mr-5 shrink-0 rounded-full border-[0.5px] border-black/10 bg-white/50 p-3 shadow-xl dark:bg-white/[15%]"
>
<img
class="my-0 aspect-square w-16 rounded-full !bg-black/5 hover:animate-spin dark:!bg-black/80"
Expand All @@ -33,7 +36,7 @@ <h1>{{ .Title }}</h1>
{{ end }}<!---->
{{ if site.Params.name }}
<div>
<h1 class="my-2.5 text-3xl font-bold">{{ site.Params.name }}</h1>
<h1 class="mb-2 mt-3 text-[2rem] font-bold">{{ site.Params.name }}</h1>
<div class="break-words">
{{ site.Params.bio | default (print `A personal blog by `
site.Params.name) }}
Expand All @@ -42,7 +45,7 @@ <h1 class="my-2.5 text-3xl font-bold">{{ site.Params.name }}</h1>
{{ end }}
</div>
{{ end }}<!---->
<hr style="margin-top: -30px">
<hr>
<h2>Hi there! We are Pwnzer0tt1!</h2>
We are the CTF team of Polytechnic of Bari, Italy 🇮🇹.
Our group is composed by students who like playing CTFs and are interested in the field of cybersecurity 💾.
Expand Down Expand Up @@ -73,7 +76,7 @@ <h2 class="!my-0 pb-1 !leading-none cursor-pointer transparency-onhover">{{ .Tit

<!-- Main Nav -->
{{ if gt $paginator.TotalPages 1 }}
<nav class="mt-24 flex">
<nav class="mt-16 flex">
{{ if $paginator.HasPrev }}
<a class="btn" href="{{ $paginator.Prev.URL }}">← {{ i18n "prev_page" }}</a>
{{ end }}<!---->
Expand Down
35 changes: 31 additions & 4 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h1 class="!my-0 pb-2.5">{{ .Title }}</h1>
{{ end }}

{{ if ne .Type "page" }}
<div class="text-sm opacity-60">
<div class="text-sm antialiased opacity-60">
{{ if .Date }}
<time>{{ .Date | time.Format ":date_medium" }}</time>
{{ end }}<!---->
Expand Down Expand Up @@ -41,7 +41,7 @@ <h1 class="!my-0 pb-2.5">{{ .Title }}</h1>
<footer class="mt-12 flex flex-wrap">
{{ range .Params.tags }} {{ $href := print (absURL "tags/") (urlize .) }}
<a
class="mr-1.5 mb-1.5 rounded-lg bg-black/[3%] px-5 py-2 no-underline dark:bg-white/[8%]"
class="mb-1.5 mr-1.5 rounded-lg bg-black/[3%] px-5 py-1.5 no-underline dark:bg-white/[8%]"
href="{{ $href }}"
>{{ . }}</a
>
Expand All @@ -50,24 +50,26 @@ <h1 class="!my-0 pb-2.5">{{ .Title }}</h1>
{{ end }}

<!-- Post Nav -->
{{ if not site.Params.disablePostNavigation }}<!---->
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}<!---->
{{ if and (gt (len $pages) 1) (in $pages . ) }}
<nav class="mt-24 flex rounded-lg bg-black/[3%] text-lg dark:bg-white/[8%]">
{{ with $pages.Next . }}
<a
class="flex w-1/2 items-center rounded-l-md p-6 pr-3 no-underline hover:bg-black/[2%] dark:hover:bg-white/[3%]"
class="flex w-1/2 items-center rounded-l-md p-6 pr-3 font-semibold no-underline hover:bg-black/[2%] dark:hover:bg-white/[3%]"
href="{{ .Permalink }}"
><span class="mr-1.5"></span><span>{{ .Name }}</span></a
>
{{ end }}<!---->
{{ with $pages.Prev . }}
<a
class="ml-auto flex w-1/2 items-center justify-end rounded-r-md p-6 pl-3 no-underline hover:bg-black/[2%] dark:hover:bg-white/[3%]"
class="ml-auto flex w-1/2 items-center justify-end rounded-r-md p-6 pl-3 font-semibold no-underline hover:bg-black/[2%] dark:hover:bg-white/[3%]"
href="{{ .Permalink }}"
><span>{{ .Name }}</span><span class="ml-1.5"></span></a
>
{{ end }}
</nav>
{{ end }}<!---->
{{ end }}

<!-- Disqus -->
Expand Down Expand Up @@ -113,6 +115,31 @@ <h1 class="!my-0 pb-2.5">{{ .Title }}</h1>
})();
</script>
{{ end }}

<!-- mermaid -->
{{- partial "mermaid.html" . -}}

<!-- giscus comment -->
{{ if and site.Params.giscus.repo (not (eq .Params.comments false)) }}
<div class="giscus mt-24"></div>
<script src="https://giscus.app/client.js"
data-repo="{{ site.Params.giscus.repo }}"
data-repo-id="{{ site.Params.giscus.repoId }}"
data-category="{{ site.Params.giscus.category }}"
data-category-id="{{ site.Params.giscus.categoryId }}"
data-mapping="{{ site.Params.giscus.mapping | default (print `pathname`) }}"
data-strict="{{ site.Params.giscus.strict | default (print `1`) }}"
data-reactions-enabled="{{ site.Params.giscus.reactionsEnabled | default (print `0`) }}"
data-emit-metadata="{{ site.Params.giscus.emitMetadata | default (print `0`) }}"
data-input-position="{{ site.Params.giscus.inputPosition | default (print `top`) }}"
data-theme="{{ site.Params.giscus.theme | default (print `light`) }}"
data-lang="{{ site.Params.giscus.lang | default (print `en`) }}"
data-loading="{{ site.Params.giscus.loading | default (print `lazy`) }}"
crossorigin="anonymous"
async>
</script>
{{ end }}

</article>

{{ end }}
5 changes: 3 additions & 2 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<footer
class="opaco mx-auto flex h-[5rem] max-w-3xl items-center px-8 text-[0.9em] opacity-80"
class="opaco mx-auto flex h-[4.5rem] max-w-3xl items-center px-8 text-[0.9em] opacity-80"
style="padding-bottom: 50px"
>
<div class="mr-auto">
&copy; {{ now.Year }}
<a class="link" href="{{ `` | absURL }}">{{ site.Title }}</a>
</div>
<span class="mx-6">
<span class="mx-6" style="text-align: right">
Created with ❤️ by Pwnzer0tt1 at <a class="link" href="https://www.poliba.it/" rel="noopener" target="_blank">@poliba</a>
</span>
</footer>
16 changes: 8 additions & 8 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<header class="mx-auto flex h-[5rem] max-w-3xl px-8 lg:justify-center">
<header class="mx-auto flex h-[4.5rem] max-w-3xl px-8 lg:justify-center" >
<div class="relative z-50 mr-auto flex items-center">
<a
class="-translate-x-[1px] -translate-y-0.5 text-3xl font-bold"
class="-translate-x-[1px] -translate-y-[1px] text-2xl font-semibold"
href="{{ `/` | absURL }}"
>{{ site.Title }}</a
>
<div
class="btn-dark text-[0] ml-6 h-6 w-6 shrink-0 cursor-pointer {{ if site.Params.monoDarkIcon }}[background:url(./theme.svg)_left_center/cover_no-repeat] dark:invert{{ else }}[background:url(./theme.png)_left_center/_auto_theme('spacing.6')_no-repeat] [transition:_background-position_0.4s_steps(5)]{{ end }} dark:[background-position:right]"
class="btn-dark text-[0] ml-4 h-6 w-6 shrink-0 cursor-pointer {{ if site.Params.monoDarkIcon }}[background:url(./theme.svg)_left_center/cover_no-repeat] dark:invert{{ else }}[background:url(./theme.png)_left_center/_auto_theme('spacing.6')_no-repeat] [transition:_background-position_0.4s_steps(5)]{{ end }} dark:[background-position:right]"
role="button"
aria-label="Dark"
></div>
</div>

<div
class="btn-menu relative z-50 -mr-8 flex h-[5rem] w-[5rem] shrink-0 cursor-pointer flex-col items-center justify-center gap-2.5 lg:hidden"
class="btn-menu relative z-50 flex h-[4.5rem] shrink-0 cursor-pointer flex-col items-center justify-center gap-2.5 lg:hidden"
role="button"
aria-label="Menu"
></div>

{{ $bg_color := $.Scratch.Get "bg_color" }}
{{ $bg_color := $.Scratch.Get "bg_color" }}<!---->
<script>
// base
const htmlClass = document.documentElement.classList;
Expand All @@ -34,7 +34,7 @@

// dark theme
const metaTheme = document.querySelector('meta[name="theme-color"]');
const lightBg = `{{ $.Scratch.Get "bg_color" }}`.replace(/"/g, '');
const lightBg = '{{ $bg_color }}'.replace(/"/g, '');
const setDark = (isDark) => {
metaTheme.setAttribute('content', isDark ? '#000' : lightBg);
htmlClass[isDark ? 'add' : 'remove']('dark');
Expand Down Expand Up @@ -80,13 +80,13 @@

{{ with $.Scratch.Get "social_list" }}
<nav
class="mt-12 flex justify-center space-x-10 dark:invert lg:mt-0 lg:ml-12 lg:items-center lg:space-x-6"
class="mt-12 flex justify-center space-x-10 dark:invert lg:ml-12 lg:mt-0 lg:items-center lg:space-x-6"
>
{{ range . }}<!---->
<a
class="h-8 w-8 text-[0] [background:var(--url)_center_center/cover_no-repeat] lg:h-6 lg:w-6"
style="--url: url(./{{ . }}.svg)"
href="{{ if eq . `rss` }}{{ `index.xml` | absURL }}{{ else if eq . `mastodon` }}{{ site.Params.Get . }}{{ else }}{{ site.Params.Get . }}{{ end }}"
href="{{ if eq . `rss` }}{{ `index.xml` | absURL }}{{ else if eq . `mastodon` }}{{ index site.Params . }}{{ else }}https://{{ . }}.com/{{ if eq . `linkedin` }}in/{{ end }}{{ index site.Params . }}{{ end }}"
target="_blank"
rel="{{ if eq . `rss` }}alternate{{ else }}me{{ end }}"
>
Expand Down

0 comments on commit adeb106

Please sign in to comment.