mirror of
https://github.com/loikein/hugo-tufte.git
synced 2024-11-16 21:36:56 +01:00
This commit is contained in:
parent
9d85328e76
commit
8049030489
4 changed files with 32 additions and 3 deletions
|
@ -3,8 +3,8 @@ $ht-code-border-radius: .4em;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
// border-radius: $ht-code-border-radius;
|
// border-radius: $ht-code-border-radius;
|
||||||
margin-top: 1em;
|
margin-top: 1.4em;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1.4em;
|
||||||
margin-right: 2.5%;
|
margin-right: 2.5%;
|
||||||
margin-left: 2.5%;
|
margin-left: 2.5%;
|
||||||
-ms-overflow-style: none;
|
-ms-overflow-style: none;
|
||||||
|
|
21
assets/scss/vendor/tufte.scss
vendored
21
assets/scss/vendor/tufte.scss
vendored
|
@ -147,6 +147,10 @@ p {
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
vertical-align: baseline;
|
vertical-align: baseline;
|
||||||
hyphens: auto;
|
hyphens: auto;
|
||||||
|
-webkit-hyphenate-limit-before: 3;
|
||||||
|
-webkit-hyphenate-limit-after: 4;
|
||||||
|
-ms-hyphenate-limit-chars: 10 3 4;
|
||||||
|
hyphenate-limit-chars: 10 3 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Chapter Epigraphs */
|
/* Chapter Epigraphs */
|
||||||
|
@ -405,6 +409,20 @@ label.marginnote-ind {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iframe.video {
|
||||||
|
width: 55%;
|
||||||
|
margin-top: 1.4em;
|
||||||
|
margin-bottom: 1.4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
iframe.video--16x9 {
|
||||||
|
aspect-ratio: 16/9;
|
||||||
|
}
|
||||||
|
|
||||||
|
iframe.video--4x3 {
|
||||||
|
aspect-ratio: 4/3;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 760px) {
|
@media (max-width: 760px) {
|
||||||
label.marginnote-ind {
|
label.marginnote-ind {
|
||||||
display: inline;
|
display: inline;
|
||||||
|
@ -451,4 +469,7 @@ label.marginnote-ind {
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
iframe.video {
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{{ $alt := .Get "alt" | default "Image" }}
|
{{ $alt := .Get "alt" | default "Image" }}
|
||||||
{{ $type := .Get "type" | default "normal" }}
|
{{ $type := .Get "type" | default "normal" }}
|
||||||
|
{{- $ind := .Get "ind" | default .Site.Params.marginNoteInd -}}
|
||||||
|
|
||||||
<!-- get a default label just in case -->
|
<!-- get a default label just in case -->
|
||||||
{{- $label := printf "%#v" (add .Ordinal 1) | printf "%s%s" "marginfig-" | printf "%s" -}}
|
{{- $label := printf "%#v" (add .Ordinal 1) | printf "%s%s" "marginfig-" | printf "%s" -}}
|
||||||
|
@ -25,7 +26,7 @@
|
||||||
{{- else -}}<!-- child for margin or normal (begin) -->
|
{{- else -}}<!-- child for margin or normal (begin) -->
|
||||||
|
|
||||||
{{- if or (or (.Get "caption") (.Get "attr")) (eq $type "margin") -}}<!-- begin marginnote -->
|
{{- if or (or (.Get "caption") (.Get "attr")) (eq $type "margin") -}}<!-- begin marginnote -->
|
||||||
<label for="{{ $label }}" class="margin-toggle marginnote-ind">{{ .Site.Params.marginNoteInd }}</label>
|
<label for="{{ $label }}" class="margin-toggle marginnote-ind">{{ $ind }}</label>
|
||||||
<input type="checkbox" id="{{ $label }}" class="margin-toggle"/>
|
<input type="checkbox" id="{{ $label }}" class="margin-toggle"/>
|
||||||
<span class="marginnote">
|
<span class="marginnote">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
7
layouts/shortcodes/youtube.html
Normal file
7
layouts/shortcodes/youtube.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{{ $id := .Get "id" | default (.Get 0) }}
|
||||||
|
{{ $4x3 := .Get "4x3" | default "false" }}
|
||||||
|
{{ $title := .Get "title" | default "YouTube Video" }}
|
||||||
|
|
||||||
|
<iframe
|
||||||
|
class="video {{ with $4x3 }}{{ if eq . "true" }}video--4x3{{ else }}video--16x9{{ end }}{{ end }}"
|
||||||
|
src="https://www.youtube-nocookie.com/embed/{{ $id }}?cc_load_policy=1&cc=1{{ with .Get "start" }}&start={{ . }}{{ end }}{{ with .Get "end" }}&end={{ . }}{{ end }}" allowfullscreen title="{{ $title }}" frameborder="0" sandbox="allow-same-origin allow-scripts" loading="lazy"></iframe>
|
Loading…
Reference in a new issue