-
-
Notifications
You must be signed in to change notification settings - Fork 137
Add content utilities and helpers partials #953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2835e7e
Add content utilities and helpers partials
MuhammadAashirAslam 86ed8d0
Consolidate utility partials
MuhammadAashirAslam 9f827db
Remove unused utility partials
MuhammadAashirAslam b787fb0
Update news banner template
MuhammadAashirAslam f58fe6a
Remove unused utility partials
MuhammadAashirAslam 73a70af
Add configurable news banner template
MuhammadAashirAslam 29064f0
Rename edit metadata partial
MuhammadAashirAslam 5e5fccc
Move utility sources to Hugo paths
MuhammadAashirAslam 8c4ac4f
Merge latest hugo into partials-utilities
MuhammadAashirAslam bf23dd7
Merge branch 'hugo' into partials-utilities
MakisH 6532c4c
Update layouts/partials/news_banner.html
MuhammadAashirAslam 001a0f9
Merge branch 'hugo' into partials-utilities
MakisH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains hidden or 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,44 @@ | ||
| {{- if ne (.Param "editme") false -}} | ||
| {{- $filePath := "" -}} | ||
| {{- $sourcePath := "" -}} | ||
| {{- with .File -}} | ||
| {{- $filePath = .Path -}} | ||
| {{- $filename := replace .Filename "\\" "/" -}} | ||
| {{- $sourcePath = replaceRE `^.*/(content|imported)/` `$1/` $filename -}} | ||
| {{- $sourcePath = replaceRE `^.*/pkg/mod/(github\.com/[^/]+/[^/@]+)(@[^/]+)?/(.*)$` `$1/$3` $sourcePath -}} | ||
| {{- if eq $sourcePath $filename -}} | ||
| {{- $sourcePath = replaceRE `^.*/([^/]+\.[^/.]+)$` `$1` $filename -}} | ||
| {{- end -}} | ||
| {{- if eq $sourcePath "" -}} | ||
| {{- $sourcePath = $filePath -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
| {{- $editBase := site.Params.github_editme_path -}} | ||
| {{- $editPath := $sourcePath -}} | ||
|
|
||
| {{- range $prefix, $base := site.Params.github_editme_paths -}} | ||
| {{- if hasPrefix $sourcePath (printf "%s/" $prefix) -}} | ||
| {{- $editBase = $base -}} | ||
| {{- if ne $prefix "content" -}} | ||
| {{- $editPath = strings.TrimPrefix (printf "%s/" $prefix) $sourcePath -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{- with .Params.github_editme_path -}} | ||
| {{- $editBase = . -}} | ||
| {{- end -}} | ||
|
|
||
| {{- if and $editBase $editPath -}} | ||
| <aside> | ||
| <div class="text-end"> | ||
| <a target="_blank" rel="noopener" href="{{ printf "%s%s" $editBase $editPath | safeURL }}" class="btn btn-outline-secondary githubEditButton" role="button"><i class="fab fa-github fa-lg"></i> Edit me</a> | ||
| </div> | ||
| {{- if ne (.Lastmod.Format "2006") "0001" }} | ||
| <div class="text-end"> | ||
| <small>Updated {{ .Lastmod.Format "02 Jan 06" }}</small> | ||
| </div> | ||
| {{- end }} | ||
| </aside> | ||
| {{- end -}} | ||
| {{- end -}} |
This file contains hidden or 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,25 @@ | ||
| <div class="row gy-3"> | ||
| {{- range hugo.Data.funding }} | ||
| <div class="col-md-6 d-flex flex-column"> | ||
| <div class="card h-100"> | ||
| <div class="card-body"> | ||
| <a href="{{ .url }}" target="_blank" rel="noopener" class="no-icon card-title"> | ||
| <strong>{{ .title }}</strong> | ||
| </a> | ||
| <div class="row align-items-center"> | ||
| <div class="col-sm-4"> | ||
| <a href="{{ .url }}" target="_blank" rel="noopener" class="no-icon"> | ||
| <img src="{{ .img | relURL }}" alt="{{ .alt | default "Logo" }}" class="img-fluid"> | ||
| </a> | ||
| </div> | ||
| <div class="col-sm-8"> | ||
| {{- with .description }}<p><small>{{ . }}</small></p>{{ end }} | ||
| {{- with .number }}<p>Funding number: {{ . }}</p>{{ end }} | ||
| {{- with .period }}<p>Years running: {{ . }}</p>{{ end }} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {{- end }} | ||
| </div> |
This file contains hidden or 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,20 @@ | ||
| {{/* | ||
| News banner template, disabled by default. To publish a banner, change `false` | ||
| below to `true` and edit only the announcement text and link below. The base | ||
| layout already calls this partial, and the existing classes should be kept for | ||
| consistent styling. To hide the banner from the front page, wrap the banner | ||
| block with `{{ if not .onlanding }}` and `{{ end }}`; without that condition, | ||
| it appears on every page. | ||
|
MuhammadAashirAslam marked this conversation as resolved.
Outdated
|
||
| */}} | ||
|
|
||
| {{ if false }} | ||
| <aside role="banner" class="background-light banner-container"> | ||
| <div class="container"> | ||
| <div class="row m-0"> | ||
| <div class="col-lg-12 news-banner"> | ||
| <p class="m-0">This is a site-wide news banner. Learn more about preCICE on the <a href="{{ "about.html" | relURL }}">About page</a>.</p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </aside> | ||
| {{ end }} | ||
File renamed without changes.
This file contains hidden or 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 @@ | ||
| {{- $raw := readFile "assets/xmlreference.md" -}} | ||
| {{- .RenderString $raw -}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.