Compare commits
5 Commits
60041d1d37
...
6921dbbd08
Author | SHA1 | Date | |
---|---|---|---|
6921dbbd08 | |||
a622d4d77c | |||
1a9d9f33cf | |||
7e8a89ccd2 | |||
7b3ef86744 |
|
@ -150,7 +150,7 @@ a {
|
|||
transition: color 0.25s;
|
||||
}
|
||||
|
||||
&.external-link {
|
||||
&.external-link, &.same-page-link {
|
||||
.feather {
|
||||
fill: none;
|
||||
margin-left: 0.25rem;
|
||||
|
@ -253,6 +253,7 @@ ul.post-list {
|
|||
|
||||
figure {
|
||||
img {
|
||||
border: $standard-border;
|
||||
border-radius: 0.5rem;
|
||||
max-width: 70%;
|
||||
display: block;
|
||||
|
@ -282,6 +283,11 @@ figure {
|
|||
&.medium img {
|
||||
max-height: 30rem;
|
||||
}
|
||||
|
||||
&.fullwide {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.twitter-tweet {
|
||||
|
|
4
layouts/_default/_markup/render-heading.html
Normal file
4
layouts/_default/_markup/render-heading.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{- .Page.Scratch.SetInMap "definedSections" (printf "#%s" .Anchor) true -}}
|
||||
<h{{ .Level }} id="{{ .Anchor }}">
|
||||
{{- .Text | safeHTML -}}
|
||||
</h{{ .Level }}>
|
|
@ -1,13 +1,31 @@
|
|||
{{- $scratch := newScratch -}}
|
||||
{{- $absoluteDest := absLangURL .Destination -}}
|
||||
{{- $siteRootUrl := absLangURL "" -}}
|
||||
{{- $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 }}"
|
||||
{{- with .Title }} title="{{ . }}"{{ end -}}
|
||||
{{- with $scratch.Get "class" -}}
|
||||
class="{{ . }}"
|
||||
{{- end -}}
|
||||
{{- if $isExternal -}}
|
||||
class="external-link" target="_blank" rel="noopener noreferrer"
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
{{- end -}}
|
||||
>
|
||||
{{- with .Text | safeHTML }}{{ . }}{{ end -}}
|
||||
{{- if $isExternal -}}{{- partial "icon.html" "external-link" -}}{{- end -}}
|
||||
{{- with $scratch.Get "icon" -}}{{- partial "icon.html" . -}}{{- end -}}
|
||||
</a>
|
||||
{{- /* chomp trailing newline */ -}}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<h2>{{ .Title }}</h2>
|
||||
<div class="post-subscript">
|
||||
<p>
|
||||
{{- range .Params.tags }}
|
||||
<a class="button" href="{{ $.Site.BaseURL }}/tags/{{ . | urlize }}">{{ . }}</a>
|
||||
{{- range (.GetTerms "tags") -}}
|
||||
<a class="button" href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
{{ end -}}
|
||||
</p>
|
||||
<p>{{ i18n "postedOn" (.Date.Format "January 2, 2006") }}.</p>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{ define "main" }}
|
||||
<h2>{{ .Title }} </h2>
|
||||
<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>
|
||||
#graph-container {
|
||||
width: 100%;
|
||||
|
|
|
@ -3,18 +3,18 @@
|
|||
</div>
|
||||
<nav>
|
||||
<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>
|
||||
{{ with .Site.Params.githubUsername }}
|
||||
<a href="https://github.com/{{ . }}">GitHub</a>
|
||||
{{ end }}
|
||||
{{ if .Site.Params.resumeStaticFile }}
|
||||
<a href="{{ .Site.BaseURL }}/{{ .Site.Params.resumeStaticFile }}">{{ i18n "resume" }}</a>
|
||||
<a href="{{ absLangURL .Site.Params.resumeStaticFile }}">{{ i18n "resume" }}</a>
|
||||
{{ end }}
|
||||
<a href="{{ .Site.BaseURL }}/tags">{{ i18n "tags" }}</a>
|
||||
<a href="{{ .Site.BaseURL }}/series">{{ i18n "series" }}</a>
|
||||
<a href="{{ .Site.BaseURL }}/favorites">{{ i18n "favorites" }}</a>
|
||||
<a href="{{ .Site.BaseURL }}/search">{{ i18n "search" }}</a>
|
||||
<a href="{{ site.Taxonomies.tags.Page.Permalink }}">{{ i18n "tags" }}</a>
|
||||
<a href="{{ site.Taxonomies.series.Page.Permalink }}">{{ i18n "series" }}</a>
|
||||
<a href="{{ relref . "favorites" }}">{{ i18n "favorites" }}</a>
|
||||
<a href="{{ relref . "search" }}">{{ i18n "search" }}</a>
|
||||
<a href="{{ relref . "blog" }}">{{ i18n "allPosts" }}</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
Loading…
Reference in New Issue
Block a user