Skip to content

Commit

Permalink
Merge branch 'looeee:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinZhang19870314 authored Oct 31, 2022
2 parents 4b9df2f + 826aa20 commit 1014cdc
Show file tree
Hide file tree
Showing 18 changed files with 13 additions and 44 deletions.
3 changes: 1 addition & 2 deletions layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@

TODO: if no .Title set title="{{ .Text }}""
*/}}

<a href="{{ .Destination | safeURL }}" {{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener noreferrer"{{ end }}>{{ .Text | safeHTML }}</a>
<a href="{{- .Destination | safeURL -}}" {{ with .Title }} title="{{- . -}}"{{- end -}}{{- if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener noreferrer"{{ end }}>{{- .Text | safeHTML -}}</a>
1 change: 0 additions & 1 deletion layouts/book/mainContentsPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
</main>
{{- partialCached "jumbo/footer.html" . -}}
</div>

{{- partialCached "fonts.html" . -}}
</body>
</html>
2 changes: 1 addition & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html dir="ltr" lang="{{ .Lang }}">
<head>
<title>{{ .Title }} | Discover three.js</title>
<title>Discover three.js!</title>
{{- partialCached "head/meta.html" . .Params.noFollow .Params.Title .Params.Description -}}
{{- partialCached "head/schema.html" . -}}
{{- partialCached "head/links.html" . .Permalink -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/index.zh.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html dir="ltr" lang="{{ .Lang }}">
<head>
<title>{{ .Title }} | 《探索three.js》</title>
<title>《探索three.js》</title>
{{- partialCached "head/meta.html" . .Params.noFollow .Params.Title .Params.Description -}}
{{- partialCached "head/schema.html" . -}}
{{- partialCached "head/links.html" . .Permalink -}}
Expand Down
6 changes: 0 additions & 6 deletions layouts/partials/langURL.html

This file was deleted.

5 changes: 3 additions & 2 deletions layouts/partials/mainLinks.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<ul class="links" style="justify-content: left">
<li><a href='/{{- partial "langURL.html" . -}}/book/'>Table Of Contents</a></li>
<li><a href='{{- if ne .Lang "en" -}}/{{- .Lang -}}/book/{{- else -}}/book/{{- end -}}'>Table Of Contents</a></li>
<li style="margin: auto">
<a href="#mailing-list-signup"
>Stay up to date - sign up to the mailing list!</a
Expand All @@ -9,4 +9,5 @@
<li>
{{- partial "language-switcher.html" . -}}
</li>
</ul>
</ul>

1 change: 0 additions & 1 deletion layouts/partials/topNav.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

<div class="icon-group center">
{{- partial "pagination.html" . -}}
</a>
</div>

<div class="icon-group right">
Expand Down
3 changes: 0 additions & 3 deletions layouts/shortcodes/aside.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
class = notice/success/warning
will give blue/green/red box
*/}}

{{ $_hugo_config := `{ "version": 1 }` }}
{{- $class := .Get 0 | default "notice" -}}

{{- $markdown := .Inner | markdownify -}}

<aside class="{{ $class }}">
{{ if not ( findRE "<[h|p][^>]*>" $markdown ) }}
<p>{{ $markdown }}</p>
Expand Down
1 change: 0 additions & 1 deletion layouts/shortcodes/clear.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
Use sparingly - it has to be carefully checked and tuned for mobile and usually required
paragraphs to be split up to work nicely.
*/}}

<p style="clear:both; margin: 0; padding: 0; line-height: 0;">&nbsp</p>
12 changes: 1 addition & 11 deletions layouts/shortcodes/code.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,21 @@
....
Note that white space is preserved.
*/}}

<!-- START: Get Options -->
{{- $inner := .Inner | default "" -}}

<!-- subtract one from $from to get correct array index -->
{{- $from := sub ( int ( .Get "from" | default 1 ) ) 1 -}}
{{- $to := int ( .Get "to" | default 9999 ) -}}
{{- $file := .Get "file" | default "" -}}

{{- $header := .Get "header" | default "" -}}
{{- $footer := .Get "footer" | default "" -}}
{{- $caption := .Get "caption" | default "" -}}

{{- $lang := .Get "lang" | default "js" -}}

{{- $hl_lines := replace (.Get "hl_lines" | default "") " " "," -}}

{{- $skip_lines := split (replace (.Get "skip_lines" | default "") "," " " ) " " -}}

{{- $linenos := .Get "linenos" | default "true" -}}

{{- $linenostart := .Get "linenostart" | default 1 -}}

<!-- END: Get Options -->

<section class="highlight-wrapper">
{{- if ne $caption "" -}}
<span class="caption">
Expand Down Expand Up @@ -109,4 +99,4 @@
{{- end -}}
</code>
</pre>
</section>
</section>
2 changes: 0 additions & 2 deletions layouts/shortcodes/figure.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@
This seems to work ok, I haven't noticed any jank. However, it can be overridden per image
by setting width or height when calling the shortcode
*/}}

{{- $src := .Get "src" -}}
{{- $caption := .Get "caption" | default "" -}}
{{- $alt := .Get "alt" | default $caption -}}
{{- $title := .Get "title" | default $alt -}}
{{- $class := .Get "class" | default "" -}}
{{- $height := .Get "height" | default "1" -}}
{{- $width := .Get "width" | default "1" -}}

<figure {{ if ne $class "" }}class="{{ $class }}"{{ end }}>
<noscript class="loading-lazy">
<img
Expand Down
1 change: 0 additions & 1 deletion layouts/shortcodes/filler.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{/*
Add vertical space to a page specified in any CSS units (rem preferred)
*/}}

<div class="filler" {{ with .Get "height" | default "0" }}style="height: {{ . }};"{{ end }}></div>
1 change: 0 additions & 1 deletion layouts/shortcodes/icon.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
A little tricky because partials can only be used in layouts and shortcodes
can only be used in markdown
*/}}

{{- partial ( printf "icons/%s.svg" (.Get 0) ) . -}}
3 changes: 0 additions & 3 deletions layouts/shortcodes/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
TODO: these should all be hosted locally to prevent upstream changes
causing breakage
*/}}

{{- $src := .Get "src" -}}
{{- $height := .Get "height" | default "500" -}}
{{- $title := .Get "title" | default "three.js scene" -}}
{{- $caption := .Get "caption" | default "" -}}

{{- $class := .Get "class" | default "" -}}

<figure class="{{ $class }}">
<noscript class="loading-lazy">
<iframe title="{{ $title }}" width="100%" height="{{ $height }}" src="{{ $src }}" importance="low" loading="lazy" sandbox="allow-scripts"></iframe>
Expand Down
5 changes: 0 additions & 5 deletions layouts/shortcodes/inlineScene.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,18 @@

{{< inlineScene entry="first-steps/birds-animated.js" class="round" captions="Animated 3D birds a-flyin" >}}
*/}}

{{ $_hugo_config := `{ "version": 1 }` }}
{{ $entry := (.Get "entry") }}
{{ $id := delimit (shuffle (seq 1 9)) "" }}
{{ $class := .Get "class" | default "" }}
{{- $caption := .Get "caption" | default "" -}}

{{ $baseDir := "/examples/worlds/inline-scenes/" }}

{{ $path := printf "%s%s" $baseDir $entry }}

<figure id="scene-{{ $id }}" class="inline-scene loading-dots {{ $class }}">
{{- if $caption -}}
<figcaption>{{ $caption | markdownify }}</figcaption>
{{- end -}}
</figure>

<script type="module">
import init from {{ $path }};
init("#scene-{{ $id }}");
Expand Down
1 change: 0 additions & 1 deletion layouts/shortcodes/note.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
You might be thinking, well, can't you just add a comment like this one?
No! Hugo only allows comments in layout files.
*/}}

{{ if .Inner }}{{ end }}
5 changes: 4 additions & 1 deletion markdown/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ date: 2018-04-02
weight: 100
available: true
excludeFromTOC: true
---
---

{{% note %}}
{{% /note %}}
3 changes: 2 additions & 1 deletion markdown/en/book/first-steps/animation-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,4 +558,5 @@ _Note: the position track will overwrite the `bird.position`, so the birds will
### Bonus

1. If you have been following along so far using the inline code editor, take the code from this chapter and make it run on locally on your computer. You'll need to set up [a development server]({{< relref "/book/introduction/prerequisites#a-web-server" >}} "a development server").
{{% /aside %}}

{{% /aside %}}

0 comments on commit 1014cdc

Please sign in to comment.