Compare commits

..

5 Commits

Author SHA1 Message Date
6921dbbd08 Disable down link icons since they're buggy
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-06-23 17:24:28 -07:00
a622d4d77c Add a border around images in figures
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-06-23 17:24:14 -07:00
1a9d9f33cf Use proper link concatenation
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-06-23 14:17:15 -07:00
7e8a89ccd2 Make fullwide images actually fullwide
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-06-23 13:54:08 -07:00
7b3ef86744 Write up and down arrows on internal links to headings
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-06-23 13:52:43 -07:00
6 changed files with 40 additions and 12 deletions

View File

@ -150,7 +150,7 @@ a {
transition: color 0.25s; transition: color 0.25s;
} }
&.external-link { &.external-link, &.same-page-link {
.feather { .feather {
fill: none; fill: none;
margin-left: 0.25rem; margin-left: 0.25rem;
@ -253,6 +253,7 @@ ul.post-list {
figure { figure {
img { img {
border: $standard-border;
border-radius: 0.5rem; border-radius: 0.5rem;
max-width: 70%; max-width: 70%;
display: block; display: block;
@ -282,6 +283,11 @@ figure {
&.medium img { &.medium img {
max-height: 30rem; max-height: 30rem;
} }
&.fullwide {
margin-left: 0;
margin-right: 0;
}
} }
.twitter-tweet { .twitter-tweet {

View File

@ -0,0 +1,4 @@
{{- .Page.Scratch.SetInMap "definedSections" (printf "#%s" .Anchor) true -}}
<h{{ .Level }} id="{{ .Anchor }}">
{{- .Text | safeHTML -}}
</h{{ .Level }}>

View File

@ -1,13 +1,31 @@
{{- $scratch := newScratch -}}
{{- $absoluteDest := absLangURL .Destination -}} {{- $absoluteDest := absLangURL .Destination -}}
{{- $siteRootUrl := absLangURL "" -}} {{- $siteRootUrl := absLangURL "" -}}
{{- $isExternal := not (hasPrefix $absoluteDest $siteRootUrl) -}} {{- $isExternal := not (hasPrefix $absoluteDest $siteRootUrl) -}}
{{- $isSamePage := hasPrefix .Destination "#" -}}
{{- if $isSamePage -}}
{{- $scratch.Set "class" "same-page-link" -}}
{{- if index (.Page.Scratch.Get "definedSections") .Destination -}}
{{- $scratch.Set "icon" "arrow-up" -}}
{{- else -}}
{{- /* Do not render "down" links because don't know how to distinguish unseen titles from paragraph links. */ -}}
{{- /* $scratch.Set "icon" "arrow-down" */ -}}
{{- end -}}
{{- else if $isExternal -}}
{{- $scratch.Set "class" "external-link" -}}
{{- $scratch.Set "icon" "external-link" -}}
{{- end -}}
<a href="{{ .Destination | safeURL }}" <a href="{{ .Destination | safeURL }}"
{{- with .Title }} title="{{ . }}"{{ end -}} {{- with .Title }} title="{{ . }}"{{ end -}}
{{- with $scratch.Get "class" -}}
class="{{ . }}"
{{- end -}}
{{- if $isExternal -}} {{- if $isExternal -}}
class="external-link" target="_blank" rel="noopener noreferrer" target="_blank" rel="noopener noreferrer"
{{- end -}} {{- end -}}
> >
{{- with .Text | safeHTML }}{{ . }}{{ end -}} {{- with .Text | safeHTML }}{{ . }}{{ end -}}
{{- if $isExternal -}}{{- partial "icon.html" "external-link" -}}{{- end -}} {{- with $scratch.Get "icon" -}}{{- partial "icon.html" . -}}{{- end -}}
</a> </a>
{{- /* chomp trailing newline */ -}} {{- /* chomp trailing newline */ -}}

View File

@ -2,8 +2,8 @@
<h2>{{ .Title }}</h2> <h2>{{ .Title }}</h2>
<div class="post-subscript"> <div class="post-subscript">
<p> <p>
{{- range .Params.tags }} {{- range (.GetTerms "tags") -}}
<a class="button" href="{{ $.Site.BaseURL }}/tags/{{ . | urlize }}">{{ . }}</a> <a class="button" href="{{ .Permalink }}">{{ .Title }}</a>
{{ end -}} {{ end -}}
</p> </p>
<p>{{ i18n "postedOn" (.Date.Format "January 2, 2006") }}.</p> <p>{{ i18n "postedOn" (.Date.Format "January 2, 2006") }}.</p>

View File

@ -1,7 +1,7 @@
{{ define "main" }} {{ define "main" }}
<h2>{{ .Title }} </h2> <h2>{{ .Title }} </h2>
<script src="{{ .Site.Params.visNetworkJsUrl }}"></script> <script src="{{ .Site.Params.visNetworkJsUrl }}"></script>
<script type="module" src="{{ .Site.BaseURL }}/graph/graph.js"></script> <script type="module" src="{{ absLangURL "graph/graph.js" }}"></script>
<style> <style>
#graph-container { #graph-container {
width: 100%; width: 100%;

View File

@ -3,18 +3,18 @@
</div> </div>
<nav> <nav>
<div class="container"> <div class="container">
<a href="{{ .Site.BaseURL }}">{{ i18n "home" }}</a> <a href="{{ .Site.Home.Permalink }}">{{ i18n "home" }}</a>
<a href="{{ relref . "about" }}">{{ i18n "about" }}</a> <a href="{{ relref . "about" }}">{{ i18n "about" }}</a>
{{ with .Site.Params.githubUsername }} {{ with .Site.Params.githubUsername }}
<a href="https://github.com/{{ . }}">GitHub</a> <a href="https://github.com/{{ . }}">GitHub</a>
{{ end }} {{ end }}
{{ if .Site.Params.resumeStaticFile }} {{ if .Site.Params.resumeStaticFile }}
<a href="{{ .Site.BaseURL }}/{{ .Site.Params.resumeStaticFile }}">{{ i18n "resume" }}</a> <a href="{{ absLangURL .Site.Params.resumeStaticFile }}">{{ i18n "resume" }}</a>
{{ end }} {{ end }}
<a href="{{ .Site.BaseURL }}/tags">{{ i18n "tags" }}</a> <a href="{{ site.Taxonomies.tags.Page.Permalink }}">{{ i18n "tags" }}</a>
<a href="{{ .Site.BaseURL }}/series">{{ i18n "series" }}</a> <a href="{{ site.Taxonomies.series.Page.Permalink }}">{{ i18n "series" }}</a>
<a href="{{ .Site.BaseURL }}/favorites">{{ i18n "favorites" }}</a> <a href="{{ relref . "favorites" }}">{{ i18n "favorites" }}</a>
<a href="{{ .Site.BaseURL }}/search">{{ i18n "search" }}</a> <a href="{{ relref . "search" }}">{{ i18n "search" }}</a>
<a href="{{ relref . "blog" }}">{{ i18n "allPosts" }}</a> <a href="{{ relref . "blog" }}">{{ i18n "allPosts" }}</a>
</div> </div>
</nav> </nav>