-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #303 from dillonzq/develop
- Loading branch information
Showing
42 changed files
with
184 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{{- with .Title -}} | ||
<figure> | ||
{{- partial "plugin/image.html" (dict "src" $.Destination "alt" $.Text "caption" . "linked" true) -}} | ||
{{- dict "src" $.Destination "alt" $.Text "caption" . "linked" true | partial "plugin/image.html" -}} | ||
<figcaption class="image-caption"> | ||
{{- . | safeHTML -}} | ||
</figcaption> | ||
</figure> | ||
{{- else -}} | ||
{{- partial "plugin/image.html" (dict "src" .Destination "alt" .Text) -}} | ||
{{- dict "src" .Destination "alt" .Text | partial "plugin/image.html" -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,46 @@ | ||
{{- $index := slice -}} | ||
{{- $pages := .Site.RegularPages -}} | ||
{{- if .Site.Params.page.hiddenFromSearch -}} | ||
{{- $pages = where $pages "Params.hiddenfromsearch" false -}} | ||
{{- else -}} | ||
{{- $pages = where $pages "Params.hiddenfromsearch" "!=" true -}} | ||
{{- end -}} | ||
{{- range $pages -}} | ||
{{- $uri := .RelPermalink -}} | ||
{{- $meta := dict "uri" $uri "title" .Title "tags" .Params.tags "categories" .Params.categories -}} | ||
{{- $meta = .PublishDate.Format ($.Site.Params.dateFormat | default "2006-01-02") | dict "date" | merge $meta -}} | ||
{{- with .Description -}} | ||
{{- $index = $index | append (dict "content" . "objectID" $uri | merge $meta) -}} | ||
{{- if .Site.Params.search -}} | ||
{{- $index := slice -}} | ||
{{- $pages := .Site.RegularPages -}} | ||
{{- if .Site.Params.page.hiddenFromSearch -}} | ||
{{- $pages = where $pages "Params.hiddenfromsearch" false -}} | ||
{{- else -}} | ||
{{- $pages = where $pages "Params.hiddenfromsearch" "!=" true -}} | ||
{{- end -}} | ||
{{- $params := .Params | merge $.Site.Params.page -}} | ||
{{/* Extended Markdown syntax */}} | ||
{{- $content := dict "content" .Content "ruby" $params.ruby "fraction" $params.fraction "fontawesome" $params.fontawesome | partial "function/content.html" -}} | ||
{{/* Remove line number for code */}} | ||
{{- $content = $content | replaceRE `<span class="lnt?"> *\d*\n?</span>` "" -}} | ||
{{- range $i, $contenti := split $content "<h2 id=" -}} | ||
{{- if gt $i 0 -}} | ||
{{- $contenti = printf "<h2 id=%s" $contenti -}} | ||
{{- range $pages -}} | ||
{{- $uri := .RelPermalink -}} | ||
{{- if $.Site.Params.search.absoluteURL -}} | ||
{{- $uri = .Permalink -}} | ||
{{- end -}} | ||
{{- range $j, $contentj := split $contenti "<h3 id=" -}} | ||
{{- if gt $j 0 -}} | ||
{{- $contentj = printf "<h3 id=%s" $contentj -}} | ||
{{- end -}} | ||
{{/* Plainify, unescape and remove (\n, \t) */}} | ||
{{- $contentj = $contentj | plainify | htmlUnescape | replaceRE `[\n\t ]+` " " -}} | ||
{{- if gt $.Site.Params.search.contentLength 0 -}} | ||
{{- $contentj = substr $contentj 0 $.Site.Params.search.contentLength -}} | ||
{{- $meta := dict "uri" $uri "title" .Title "tags" .Params.tags "categories" .Params.categories -}} | ||
{{- $meta = .PublishDate.Format ($.Site.Params.dateFormat | default "2006-01-02") | dict "date" | merge $meta -}} | ||
{{- with .Description -}} | ||
{{- $index = $index | append (dict "content" . "objectID" $uri | merge $meta) -}} | ||
{{- end -}} | ||
{{- $params := .Params | merge $.Site.Params.page -}} | ||
{{/* Extended Markdown syntax */}} | ||
{{- $content := dict "content" .Content "ruby" $params.ruby "fraction" $params.fraction "fontawesome" $params.fontawesome | partial "function/content.html" -}} | ||
{{/* Remove line number for code */}} | ||
{{- $content = $content | replaceRE `<span class="lnt?"> *\d*\n?</span>` "" -}} | ||
{{- range $i, $contenti := split $content "<h2 id=" -}} | ||
{{- if gt $i 0 -}} | ||
{{- $contenti = printf "<h2 id=%s" $contenti -}} | ||
{{- end -}} | ||
{{- if $contentj | and (ne $contentj " ") -}} | ||
{{- $one := printf "%s:%d:%d" $uri $i $j | dict "content" $contentj "objectID" | merge $meta -}} | ||
{{- $index = $index | append $one -}} | ||
{{- range $j, $contentj := split $contenti "<h3 id=" -}} | ||
{{- if gt $j 0 -}} | ||
{{- $contentj = printf "<h3 id=%s" $contentj -}} | ||
{{- end -}} | ||
{{/* Plainify, unescape and remove (\n, \t) */}} | ||
{{- $contentj = $contentj | plainify | htmlUnescape | replaceRE `[\n\t ]+` " " -}} | ||
{{- if gt $.Site.Params.search.contentLength 0 -}} | ||
{{- $contentj = substr $contentj 0 $.Site.Params.search.contentLength -}} | ||
{{- end -}} | ||
{{- if $contentj | and (ne $contentj " ") -}} | ||
{{- $one := printf "%s:%d:%d" $uri $i $j | dict "content" $contentj "objectID" | merge $meta -}} | ||
{{- $index = $index | append $one -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- $index | jsonify | safeJS -}} | ||
{{- $index | jsonify | safeJS -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.