Adds working config and some data
Creates a working configuration for the site. The writeups directory lists the different ctfs and each ctfs list every challenge inside of it. Also adds two ctfs to the writeups used to setup the site.
This commit is contained in:
28
layouts/writeups/chall.html
Normal file
28
layouts/writeups/chall.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{{ $page := . }}
|
||||
{{ $tag := index $page.Params.tags 0 }}
|
||||
{{ with $tag }}
|
||||
{{ $prefix := lower (substr . 0 3) }}
|
||||
{{ $colorMap := dict
|
||||
"rev" "#6366f1"
|
||||
"pwn" "#ef4444"
|
||||
"web" "#3b82f6"
|
||||
"cry" "#10b981"
|
||||
"mis" "#f59e0b"
|
||||
"for" "#8b5cf6"
|
||||
"bin" "#ec4899"
|
||||
"net" "#06b6d4"
|
||||
"ste" "#f472b6"
|
||||
"mob" "#a855f7"
|
||||
}}
|
||||
{{ $color := index $colorMap $prefix | default "#9ca3af" }} {{/* fallback: gray-400 */}}
|
||||
|
||||
<li style="margin-bottom: 0.75em;">
|
||||
<span style="background-color: {{ $color }}; padding: 0em 0.7em; border-radius: 0.3em; color: #fff; font-size: 0.85em; margin-right: 0.5em;">
|
||||
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}" style="color: inherit; text-decoration: none;">
|
||||
{{ . }}
|
||||
</a>
|
||||
</span>
|
||||
|
||||
<a class="title" href="{{ $page.Params.externalLink | default $page.RelPermalink }}">{{ $page.Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
4
layouts/writeups/li.html
Normal file
4
layouts/writeups/li.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<li>
|
||||
<span class="date">{{ .Date | time.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
|
||||
<a class="title" href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
29
layouts/writeups/list.html
Normal file
29
layouts/writeups/list.html
Normal file
@@ -0,0 +1,29 @@
|
||||
{{ define "title" }}
|
||||
{{ title (i18n (lower .Title)) | default .Title }} · {{ .Site.Title }}
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
<section class="container list">
|
||||
<header>
|
||||
<h1 class="title">
|
||||
<a class="title-link" href="{{ .Permalink | safeURL }}">
|
||||
{{ title (i18n (lower .Title)) | default .Title }}
|
||||
</a>
|
||||
</h1>
|
||||
</header>
|
||||
{{ .Content }}
|
||||
<ul>
|
||||
{{ if eq .File.Path "writeups/_index.md" }}
|
||||
{{- range .Sections -}}
|
||||
{{- .Render "li" -}}
|
||||
{{- end -}}
|
||||
{{ else }}
|
||||
<h2 class="title">Solved challenges</h2>
|
||||
{{- range .Paginator.Pages -}}
|
||||
{{- .Render "chall" -}}
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
</section>
|
||||
{{ end }}
|
||||
56
layouts/writeups/single.html
Normal file
56
layouts/writeups/single.html
Normal file
@@ -0,0 +1,56 @@
|
||||
{{ define "title" }}
|
||||
{{ .Title }} · {{ .Site.Title }}
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
<section class="container post">
|
||||
<article>
|
||||
<header>
|
||||
<div class="post-title">
|
||||
<h1 class="title">
|
||||
<a class="title-link" href="{{ .Permalink | safeURL }}">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="post-meta">
|
||||
<div class="date">
|
||||
<span class="posted-on">
|
||||
<i class="fa-solid fa-calendar" aria-hidden="true"></i>
|
||||
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
|
||||
{{ .Date | time.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}
|
||||
</time>
|
||||
</span>
|
||||
<span class="reading-time">
|
||||
<i class="fa-solid fa-clock" aria-hidden="true"></i>
|
||||
{{ i18n "reading_time" .ReadingTime }}
|
||||
</span>
|
||||
</div>
|
||||
{{ with .GetTerms "authors" }}{{ partial "taxonomy/authors.html" . }}{{ end }}
|
||||
{{ with .GetTerms "categories" }}{{ partial "taxonomy/categories.html" . }}{{ end }}
|
||||
{{ with .GetTerms "tags" }}{{ partial "taxonomy/tags.html" . }}{{ end }}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="post-content">
|
||||
{{ if .Params.featuredImage }}
|
||||
<img src="{{ .Params.featuredImage | relURL }}" alt="Featured image"/>
|
||||
{{ end }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
|
||||
<footer>
|
||||
{{ partial "posts/series.html" . }}
|
||||
{{ partial "posts/disqus.html" . }}
|
||||
{{ partial "posts/commento.html" . }}
|
||||
{{ partial "posts/utterances.html" . }}
|
||||
{{ partial "posts/giscus.html" . }}
|
||||
{{ partial "posts/mastodon.html" . }}
|
||||
{{ partial "posts/telegram.html" . }}
|
||||
{{ partial "posts/cusdis.html" . }}
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
{{ partial "posts/math.html" . }}
|
||||
</section>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user