-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7688e25
commit 8edaf9e
Showing
8 changed files
with
72 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
> 0.0001% | ||
not dead |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
|
||
# Change these settings to your own preference | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
# editorconfig-tools is unable to ignore longs strings or urls | ||
max_line_length = null | ||
|
||
[Makefile] | ||
indent_style = tab |
Submodule content
updated
17 files
Submodule original-content
updated
106 files
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
4 changes: 3 additions & 1 deletion
4
revamp/preprocessors/src/helpers/render_html/templates/div.tmpl
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 +1,3 @@ | ||
<div class="{{.Class}}">{{if .InnerHtml}}{{.InnerHtml}}{{else}}{{.Text}}{{end}}</div> | ||
<div class="{{.Class}}" | ||
{{ range $key, $value := .Data }} data-{{ $key }}="{{ $value }}"{{ end }} | ||
>{{if .InnerHtml}}{{.InnerHtml}}{{else}}{{.Text}}{{end}}</div> |
39 changes: 39 additions & 0 deletions
39
revamp/preprocessors/src/run-macros/macros/compat/compat.go
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package compat | ||
|
||
import ( | ||
"errors" | ||
"html/template" | ||
"strings" | ||
renderhtml "webdoky3/revamp/preprocessors/src/helpers/render_html" | ||
"webdoky3/revamp/preprocessors/src/run-macros/environment" | ||
"webdoky3/revamp/preprocessors/src/run-macros/registry" | ||
) | ||
|
||
func Compat(env *environment.Environment, reg *registry.Registry, args string) (string, error) { | ||
compatItems := []string{} | ||
queries := env.Frontmatter.BrowserCompat | ||
if len(queries) == 0 { | ||
return "", errors.New("no browser compatibility queries found in frontmatter") | ||
} | ||
for _, query := range env.Frontmatter.BrowserCompat { | ||
isMultiple := len(queries) > 1 | ||
multiple := "" | ||
if isMultiple { | ||
multiple = "multiple" | ||
} | ||
queryElement, err := renderhtml.RenderDiv(&renderhtml.DivParams{ | ||
Class: "bc-data", | ||
Data: map[string]template.HTMLAttr{ | ||
"multiple": template.HTMLAttr(multiple), | ||
"query": template.HTMLAttr(query), | ||
"depth": template.HTMLAttr("1"), | ||
}, | ||
Text: "If you're able to see this, something went wrong on this page.", | ||
}) | ||
if err != nil { | ||
return "", err | ||
} | ||
compatItems = append(compatItems, queryElement) | ||
} | ||
return strings.Join(compatItems, "\n"), nil | ||
} |
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