Compare commits
5 Commits
c5c57405b0
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 952502e690 | |||
| 388a4f1589 | |||
| 806d3a318f | |||
| b06b695653 | |||
| 4ff04221b0 |
@@ -247,7 +247,7 @@ ul.post-list {
|
|||||||
|
|
||||||
p.post-wordcount, p.post-status {
|
p.post-wordcount, p.post-status {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 0.6rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.series-link {
|
.series-link {
|
||||||
@@ -330,8 +330,7 @@ figure {
|
|||||||
That's because firefox reader mode doesn't play nice with them, and
|
That's because firefox reader mode doesn't play nice with them, and
|
||||||
it seems to ignore all styles in <head>. Then, the inline style
|
it seems to ignore all styles in <head>. Then, the inline style
|
||||||
in <head> uses !important to restore the display of icons, but provides
|
in <head> uses !important to restore the display of icons, but provides
|
||||||
limited styling. Here, we finally apply the full extent of the feather
|
limited styling. Here, we finally apply the full extent of the feather styles.
|
||||||
styles.
|
|
||||||
*/
|
*/
|
||||||
.feather {
|
.feather {
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
@@ -402,7 +401,6 @@ figure {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
a, .ongoing-placeholder {
|
a, .ongoing-placeholder {
|
||||||
@include bordered-block;
|
@include bordered-block;
|
||||||
padding: 0.5em 1em 0.5em 1em;
|
padding: 0.5em 1em 0.5em 1em;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ $target-background-color-dark: #55511c;
|
|||||||
|
|
||||||
$code-color: #f0f0f0;
|
$code-color: #f0f0f0;
|
||||||
$code-color-dark: lighten($background-color-dark, 10%);
|
$code-color-dark: lighten($background-color-dark, 10%);
|
||||||
$code-token-color: black;
|
$code-token-color: darken($primary-color, 25%);
|
||||||
$code-token-color-dark: $primary-color;
|
$code-token-color-dark: $primary-color;
|
||||||
$code-highlight-color: #fffd99;
|
$code-highlight-color: #fffd99;
|
||||||
$code-highlight-color-dark: #555538;
|
$code-highlight-color-dark: #555538;
|
||||||
|
|||||||
9
layouts/_default/_markup/render-blockquote.html
Normal file
9
layouts/_default/_markup/render-blockquote.html
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{{ if and (eq .Type "alert") (eq .AlertType "todo") -}}
|
||||||
|
<div style="background-color: tomato; color: white; padding: 10px;">
|
||||||
|
<em>TODO: </em>{{- .Text | plainify -}}
|
||||||
|
</div>
|
||||||
|
{{- else -}}
|
||||||
|
<blockquote {{- with .Attributes.id }} id="{{ . }}"{{ end }}>
|
||||||
|
{{ .Text -}}
|
||||||
|
</blockquote>
|
||||||
|
{{- end }}
|
||||||
@@ -1,24 +1,25 @@
|
|||||||
{{- $scratch := newScratch -}}
|
{{- $class := "" -}}
|
||||||
|
{{- $icon := "" -}}
|
||||||
{{- $absoluteDest := absLangURL .Destination -}}
|
{{- $absoluteDest := absLangURL .Destination -}}
|
||||||
{{- $siteRootUrl := absLangURL "" -}}
|
{{- $siteRootUrl := absLangURL "" -}}
|
||||||
{{- $isExternal := not (hasPrefix $absoluteDest $siteRootUrl) -}}
|
{{- $isExternal := not (hasPrefix $absoluteDest $siteRootUrl) -}}
|
||||||
{{- $isSamePage := hasPrefix .Destination "#" -}}
|
{{- $isSamePage := hasPrefix .Destination "#" -}}
|
||||||
|
|
||||||
{{- if $isSamePage -}}
|
{{- if $isSamePage -}}
|
||||||
{{- $scratch.Set "class" "same-page-link" -}}
|
{{- $class = "same-page-link" -}}
|
||||||
{{- if index (.Page.Scratch.Get "definedSections") .Destination -}}
|
{{- if index (.Page.Scratch.Get "definedSections") .Destination -}}
|
||||||
{{- $scratch.Set "icon" "arrow-up" -}}
|
{{- $icon = "arrow-up" -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- /* Do not render "down" links because don't know how to distinguish unseen titles from paragraph links. */ -}}
|
{{- /* Do not render "down" links because don't know how to distinguish unseen titles from paragraph links. */ -}}
|
||||||
{{- /* $scratch.Set "icon" "arrow-down" */ -}}
|
{{- /* $icon = "arrow-down" */ -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- else if $isExternal -}}
|
{{- else if $isExternal -}}
|
||||||
{{- $scratch.Set "class" "external-link" -}}
|
{{- $class = "external-link" -}}
|
||||||
{{- $scratch.Set "icon" "external-link" -}}
|
{{- $icon = "external-link" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<a href="{{ .Destination | safeURL }}"
|
<a href="{{ .Destination | safeURL }}"
|
||||||
{{- with .Title }} title="{{ . }}"{{ end -}}
|
{{- with .Title }} title="{{ . }}"{{ end -}}
|
||||||
{{- with $scratch.Get "class" -}}
|
{{- with $class -}}
|
||||||
class="{{ . }}"
|
class="{{ . }}"
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if (and site.Params.externalLinksInNewTab $isExternal) -}}
|
{{- if (and site.Params.externalLinksInNewTab $isExternal) -}}
|
||||||
@@ -26,6 +27,6 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
>
|
>
|
||||||
{{- with .Text | safeHTML }}{{ . }}{{ end -}}
|
{{- with .Text | safeHTML }}{{ . }}{{ end -}}
|
||||||
{{- with $scratch.Get "icon" -}}{{- partial "icon.html" . -}}{{- end -}}
|
{{- with $icon -}}{{- partial "icon.html" . -}}{{- end -}}
|
||||||
</a>
|
</a>
|
||||||
{{- /* chomp trailing newline */ -}}
|
{{- /* chomp trailing newline */ -}}
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
{{- $scratch := newScratch -}}
|
{{- $highlightGroupAttrs := (printf "data-base-path=\"%s\" data-file-path=\"%v\"" .basePath .path) -}}
|
||||||
{{- $scratch.Set "highlightGroupAttrs" (printf "data-base-path=\"%s\" data-file-path=\"%v\"" .basePath .path) -}}
|
|
||||||
{{- if (or .firstLine .lastLine) -}}
|
{{- if (or .firstLine .lastLine) -}}
|
||||||
{{- $scratch.Add "highlightGroupAttrs" (printf " data-first-line=\"%v\" data-last-line=\"%v\"" .firstLine .lastLine) -}}
|
{{- $highlightGroupAttrs = add $highlightGroupAttrs (printf " data-first-line=\"%v\" data-last-line=\"%v\"" .firstLine .lastLine) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if eq (lower .language) "agda" -}}
|
{{- if eq (lower .language) "agda" -}}
|
||||||
{{- $scratch.Add "highlightGroupAttrs" " data-agda-block" -}}
|
{{- $highlightGroupAttrs = add $highlightGroupAttrs " data-agda-block" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- with .offset -}}
|
{{- with .offset -}}
|
||||||
{{- $scratch.Add "highlightGroupAttrs" (printf " data-source-offset=\"%v\"" .) -}}
|
{{- $highlightGroupAttrs = add $highlightGroupAttrs (printf " data-source-offset=\"%v\"" .) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{ partial "group.html" (dict "url" .url "path" .path "comment" .comment "content" (highlight .code .language .opts) "attrs" ($scratch.Get "highlightGroupAttrs")) }}
|
{{ partial "group.html" (dict "url" .url "path" .path "comment" .comment "content" (highlight .code .language .opts) "attrs" $highlightGroupAttrs) }}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
{{ partial "seriesstatus.html" .page.Params.status }}
|
{{ partial "seriesstatus.html" .page.Params.status }}
|
||||||
</p>
|
</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<p class="post-preview">{{ .page.Summary }} {{ if .page.Truncated }}...{{ end }}</p>
|
<p class="post-preview">{{ partial "summary" .page }}</p>
|
||||||
{{- if .linkSeries -}}
|
{{- if .linkSeries -}}
|
||||||
{{- $term := index (.page.GetTerms "series") 0 -}}
|
{{- $term := index (.page.GetTerms "series") 0 -}}
|
||||||
{{- with $term -}}
|
{{- with $term -}}
|
||||||
|
|||||||
5
layouts/partials/summary.html
Normal file
5
layouts/partials/summary.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{{- if .Params.summary -}}
|
||||||
|
{{ .Params.summary }}
|
||||||
|
{{- else -}}
|
||||||
|
{{ .Summary | plainify | truncate 180 }}
|
||||||
|
{{- end -}}
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
<p>{{ partial "seriesstatus.html" .Params.status }}</p>
|
<p>{{ partial "seriesstatus.html" .Params.status }}</p>
|
||||||
<p>{{ i18n "postsFromTo" (dict "from" $startYear "to" $endYear) }}</p>
|
<p>{{ i18n "postsFromTo" (dict "from" $startYear "to" $endYear) }}</p>
|
||||||
</div>
|
</div>
|
||||||
<p>{{ .Summary }}</p>
|
<p>{{ partial "summary" . }}</p>
|
||||||
|
|
||||||
<ul class="post-list">
|
<ul class="post-list">
|
||||||
{{ range $pages }}
|
{{ range $pages }}
|
||||||
|
|||||||
@@ -1,39 +1,38 @@
|
|||||||
{{- $source := (readFile (printf "code/%s" (.Get 1))) -}}
|
{{- $source := (readFile (printf "code/%s" (.Get 1))) -}}
|
||||||
{{- $allLines := split $source "\n" -}}
|
{{- $allLines := split $source "\n" -}}
|
||||||
{{- $scratch := newScratch -}}
|
{{- $scratch := newScratch -}}
|
||||||
|
{{- $remLines := $allLines -}}
|
||||||
{{- if not (eq (int (.Get 2)) 1) -}}
|
{{- if not (eq (int (.Get 2)) 1) -}}
|
||||||
{{- $scratch.Set "remLines" (after (sub (int (.Get 2)) 1) $allLines) -}}
|
{{- $remLines = after (sub (int (.Get 2)) 1) $allLines -}}
|
||||||
{{- else -}}
|
|
||||||
{{- $scratch.Set "remLines" $allLines -}}
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $lines := first (add (sub (int (.Get 3)) (int (.Get 2))) 1) ($scratch.Get "remLines") -}}
|
{{- $lines := first (add (sub (int (.Get 3)) (int (.Get 2))) 1) $remLines -}}
|
||||||
|
|
||||||
|
{{- $opts := "" -}}
|
||||||
{{- if (.Get 4) -}}
|
{{- if (.Get 4) -}}
|
||||||
{{- $scratch.Set "opts" (printf ",%s" (.Get 4)) -}}
|
{{- $opts = printf ",%s" (.Get 4) -}}
|
||||||
{{- else -}}
|
|
||||||
{{- $scratch.Set "opts" "" -}}
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if (.Get 5) -}}
|
{{- if (.Get 5) -}}
|
||||||
{{- $scratch.Set "hidden" (.Get 5) -}}
|
{{- $scratch.Set "hidden" (.Get 5) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $prefixLength := "" -}}
|
||||||
|
{{- $joinedLines := "" -}}
|
||||||
{{- if or (.Page.Params.left_align_code) (.Get 6) -}}
|
{{- if or (.Page.Params.left_align_code) (.Get 6) -}}
|
||||||
{{- $scratch.Set "prefixLength" -1 -}}
|
{{- $prefixLength = -1 -}}
|
||||||
{{- range $line := $lines -}}
|
{{- range $line := $lines -}}
|
||||||
{{- $leading := sub (len $line) (len (strings.TrimLeft " " $line)) -}}
|
{{- $leading := sub (len $line) (len (strings.TrimLeft " " $line)) -}}
|
||||||
{{- if and (ne $line "") (or (eq ($scratch.Get "prefixLength") -1) (le $leading ($scratch.Get "prefixLength"))) -}}
|
{{- if and (ne $line "") (or (eq $prefixLength -1) (le $leading $prefixLength)) -}}
|
||||||
{{- $scratch.Set "prefixLength" $leading -}}
|
{{- $prefixLength = $leading -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- $scratch.Set "joinedLines" "" -}}
|
|
||||||
{{- range $line := $lines -}}
|
{{- range $line := $lines -}}
|
||||||
{{- $scratch.Add "joinedLines" (substr $line ($scratch.Get "prefixLength")) -}}
|
{{- $joinedLines = add $joinedLines (substr $line $prefixLength) -}}
|
||||||
{{- $scratch.Add "joinedLines" "\n" -}}
|
{{- $joinedLines = add $joinedLines "\n" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $scratch.Set "joinedLines" (delimit $lines "\n") -}}
|
{{- $joinedLines = delimit $lines "\n" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- partial "geturl.html" (dict "scratch" $scratch "path" (.Get 1) "lines" (slice (.Get 2) (.Get 3))) -}}
|
{{- partial "geturl.html" (dict "scratch" $scratch "path" (.Get 1) "lines" (slice (.Get 2) (.Get 3))) -}}
|
||||||
@@ -47,12 +46,12 @@
|
|||||||
"basePath" ($scratch.Get "bestPath")
|
"basePath" ($scratch.Get "bestPath")
|
||||||
"path" (.Get 1)
|
"path" (.Get 1)
|
||||||
"comment" ($scratch.Get "comment")
|
"comment" ($scratch.Get "comment")
|
||||||
"code" ($scratch.Get "joinedLines")
|
"code" $joinedLines
|
||||||
"firstLine" (int (.Get 2))
|
"firstLine" (int (.Get 2))
|
||||||
"lastLine" (int (.Get 3))
|
"lastLine" (int (.Get 3))
|
||||||
"language" (.Get 0)
|
"language" (.Get 0)
|
||||||
"offset" ($scratch.Get "prefixLength")
|
"offset" $prefixLength
|
||||||
"opts" (printf "linenos=table,linenostart=%d%s" (.Get 2) ($scratch.Get "opts"))
|
"opts" (printf "linenos=table,linenostart=%d%s" (.Get 2) $opts)
|
||||||
-}}
|
-}}
|
||||||
{{- partial "highlightgroup.html" $groupconfig -}}
|
{{- partial "highlightgroup.html" $groupconfig -}}
|
||||||
{{- with ($scratch.Get "hidden") -}}
|
{{- with ($scratch.Get "hidden") -}}
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
<div style="background-color: tomato; color: white; padding: 10px;">
|
|
||||||
<em>TODO: </em>{{- .Inner -}}
|
|
||||||
</div>
|
|
||||||
Reference in New Issue
Block a user