Skip to content

Commit

Permalink
chore(formatting): add .editorconfigs (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinawoo authored Oct 30, 2020
1 parent 62f8ebb commit 1626488
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 79 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# https://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
trim_trailing_whitespace = true

[*.go]
indent_size = 8
indent_style = tab

[*.js]
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
46 changes: 23 additions & 23 deletions .github/workflows/mlc_config.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"ignorePatterns": [
{
"pattern": "/^images/(*.*)"
},
{
"pattern": "/^Images/(*.*)"
},
{
"pattern": "^http://localhost:9000"
},
{
"pattern": "^http://gate.org.com:8084"
},
{
"pattern": "^http://demo.armory.io"
},
{
"pattern": "^https://github.com/organizations/your_org_here/settings/hooks"
},
{
"pattern": "^http://opa.opaserver:8181"
}
]
"ignorePatterns": [
{
"pattern": "/^images/(*.*)"
},
{
"pattern": "/^Images/(*.*)"
},
{
"pattern": "^http://localhost:9000"
},
{
"pattern": "^http://gate.org.com:8084"
},
{
"pattern": "^http://demo.armory.io"
},
{
"pattern": "^https://github.com/organizations/your_org_here/settings/hooks"
},
{
"pattern": "^http://opa.opaserver:8181"
}
]
}
22 changes: 11 additions & 11 deletions layouts/docs/release-notes-archive.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{{ define "main" }}
<div class="td-content">
<h1>{{ .Title }}</h1>
<h1>{{ .Title }}</h1>
{{ with .Params.description }}<div class="lead">{{ . | markdownify }}</div>{{ end }}
{{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) }}
{{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) }}
{{ partial "reading-time.html" . }}
{{ end }}
{{ .Content }}
{{ .Content }}
{{ partial "list-archived-release-notes.html" . }}
{{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }}
{{ partial "feedback.html" .Site.Params.ui.feedback }}
<br />
{{ end }}
{{ if (.Site.DisqusShortname) }}
<br />
{{ partial "disqus-comment.html" . }}
{{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }}
{{ partial "feedback.html" .Site.Params.ui.feedback }}
<br />
{{ end }}
{{ if (.Site.DisqusShortname) }}
<br />
{{ partial "disqus-comment.html" . }}
{{ end }}
<div class="text-muted mt-5 pt-3 border-top">{{ partial "page-meta-lastmod.html" . }}</div>
<div class="text-muted mt-5 pt-3 border-top">{{ partial "page-meta-lastmod.html" . }}</div>
</div>
{{ end }}
14 changes: 7 additions & 7 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
</div>
<div class="col-12 col-sm-4 text-center py-2 order-sm-2">
{{ with .Site.Params.copyright }}<small class="text-white">&copy; {{ now.Year}} {{ .}} {{ T "footer_all_rights_reserved" }}</small>{{ end }}
<br>
<br>

{{ with .Site.Params.terms_and_conditions }}<small class="ml-1"><a href="{{ . }}" target="_blank">{{ T "footer_terms_and_conditions" }}</a></small>{{ end }}
{{ with .Site.Params.terms_and_conditions }}<small class="ml-1"><a href="{{ . }}" target="_blank">{{ T "footer_terms_and_conditions" }}</a></small>{{ end }}

{{ with .Site.Params.terms_of_service }}<small class="ml-1"><a href="{{ . }}" target="_blank">{{ T "footer_terms_of_service" }}</a></small>{{ end }}
{{ with .Site.Params.terms_of_service }}<small class="ml-1"><a href="{{ . }}" target="_blank">{{ T "footer_terms_of_service" }}</a></small>{{ end }}

{{ with .Site.Params.privacy_policy }}<small class="ml-1"><a href="{{ . }}" target="_blank">{{ T "footer_privacy_policy" }}</a></small>{{ end }}
{{ with .Site.Params.privacy_policy }}<small class="ml-1"><a href="{{ . }}" target="_blank">{{ T "footer_privacy_policy" }}</a></small>{{ end }}

{{ if not .Site.Params.ui.footer_about_disable }}
{{ with .Site.GetPage "about" }}<p class="mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>{{ end }}
{{ end }}
{{ if not .Site.Params.ui.footer_about_disable }}
{{ with .Site.GetPage "about" }}<p class="mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>{{ end }}
{{ end }}
</div>
</div>
</div>
Expand Down
48 changes: 23 additions & 25 deletions layouts/partials/list-archived-release-notes.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
<div class="section-index">
{{ $pages := (where .Site.Pages "Section" .Section).ByWeight }}
{{ $pagesReverse := (where .Site.Pages "Section" .Section).ByWeight.Reverse }}
{{ $parent := .Page }}
{{ $pages := (where .Site.Pages "Section" .Section).ByWeight }}
{{ $pagesReverse := (where .Site.Pages "Section" .Section).ByWeight.Reverse }}
{{ $parent := .Page }}

<ul>
{{$displayedMinorVersions := 0}}
{{$currentMajor := 1000}}
{{$currentMinor := 1000}}
{{$displayedMinorVersions := 0}}
{{$currentMajor := 1000}}
{{$currentMinor := 1000}}

{{ range $pagesReverse }}
{{/*this will pickout the first {major}.{minor}.{patch} numbers*/}}
{{ $semverSlice := findRE "[0-9]+" .Title }}
{{ range $pagesReverse }}
{{/*this will pickout the first {major}.{minor}.{patch} numbers*/}}
{{ $semverSlice := findRE "[0-9]+" .Title }}

{{ if and (ge (len $semverSlice) 3) (eq .Page.Parent $parent.Parent) }}
{{ if and (ge (len $semverSlice) 3) (eq .Page.Parent $parent.Parent) }}
{{if lt (index $semverSlice 0) $currentMajor }}
{{$currentMajor = (index $semverSlice 0)}}
{{$currentMinor = (index $semverSlice 1)}}
{{end }}

{{if lt (index $semverSlice 0) $currentMajor }}
{{$currentMajor = (index $semverSlice 0)}}
{{$currentMinor = (index $semverSlice 1)}}
{{end }}
{{ if lt (index $semverSlice 1) $currentMinor}}
{{$currentMinor = (index $semverSlice 1)}}
{{$displayedMinorVersions = add $displayedMinorVersions 1}}
{{end}}

{{ if lt (index $semverSlice 1) $currentMinor}}
{{$currentMinor = (index $semverSlice 1)}}
{{$displayedMinorVersions = add $displayedMinorVersions 1}}
{{end}}

{{if gt $displayedMinorVersions 2}}
<li><a href="{{ .RelPermalink }}">{{- .Title -}}</a></li>
{{end}}
{{end}}
{{if gt $displayedMinorVersions 2}}
<li><a href="{{ .RelPermalink }}">{{- .Title -}}</a></li>
{{end}}
{{end}}
</ul>

{{end}}
</ul>
</div>
26 changes: 13 additions & 13 deletions layouts/partials/section-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@
{{/* If no_list is true we don't show a list of subpages */}}
{{ else if $parent.Params.simple_list }}
{{/* If simple_list is true we show a bulleted list of subpages */}}
<ul>
<ul>
{{ range $pages }}
{{ if eq .Parent $parent }}
<li><a href="{{ .RelPermalink }}">{{- .Title -}}</a></li>
<li><a href="{{ .RelPermalink }}">{{- .Title -}}</a></li>
{{ end }}
{{ end }}
</ul>
</ul>
{{ else if $parent.Params.simple_list_reverse }}
<ul>
<ul>
{{ range $pagesReverse }}
{{ if eq .Parent $parent }}
<li><a href="{{ .RelPermalink }}">{{- .Title -}}</a></li>
<li><a href="{{ .RelPermalink }}">{{- .Title -}}</a></li>
{{ end }}
{{ end }}
</ul>
</ul>
{{ else }}
{{/* Otherwise we show a nice formatted list of subpages with page descriptions */}}
<hr class="panel-line">
<hr class="panel-line">
{{ range $pages }}
{{ if eq .Parent $parent }}
<div class="entry">
<h5>
<a href="{{ .RelPermalink }}">{{- .Title -}}</a>
</h5>
<p>{{ .Description | markdownify }}</p>
</div>
<div class="entry">
<h5>
<a href="{{ .RelPermalink }}">{{- .Title -}}</a>
</h5>
<p>{{ .Description | markdownify }}</p>
</div>
{{ end }}
{{ end }}
{{ end }}
Expand Down

0 comments on commit 1626488

Please sign in to comment.