Skip to content

Commit

Permalink
feat: replace all the remaining fontawesome icons
Browse files Browse the repository at this point in the history
  • Loading branch information
HEIGE-PCloud committed Mar 28, 2024
1 parent 0236dbe commit 2eb89db
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
6 changes: 4 additions & 2 deletions layouts/_default/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ <h1 class="single-title">
{{- $categories := slice -}}
{{- range .Params.categories -}}
{{- $category := partialCached "function/path.html" . . | printf "/categories/%v" | $.Site.GetPage -}}
{{- $categories = $categories | append (printf `<a href="%v"><i class="far fa-folder fa-fw"></i>%v</a>` $category.RelPermalink $category.Title) -}}
{{- $icon := partial "plugin/fontawesome.html" (dict "Style" "regular" "Icon" "folder") -}}
{{- $categories = $categories | append (printf `<a href="%v">%v%v</a>` $category.RelPermalink $icon $category.Title) -}}
{{- end -}}
{{- with delimit $categories "&nbsp;" -}}
&nbsp;<span class="post-category">
Expand All @@ -54,7 +55,8 @@ <h1 class="single-title">
{{- $series := slice -}}
{{- range .Params.series -}}
{{- $singleSeries := partialCached "function/path.html" . . | printf "/series/%v" | $.Site.GetPage -}}
{{- $series = $series | append (printf `<a href="%v"><i class="far fa-list-alt fa-fw"></i>%v</a>` $singleSeries.RelPermalink $singleSeries.Title) -}}
{{- $icon := partial "plugin/fontawesome.html" (dict "Style" "regular" "Icon" "list-alt") -}}
{{- $series = $series | append (printf `<a href="%v">%v%v</a>` $singleSeries.RelPermalink $icon $singleSeries.Title) -}}
{{- end -}}
{{- with delimit $series "&nbsp;" -}}
&nbsp;<span class="post-series">
Expand Down
3 changes: 2 additions & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
{{- $post_info = $post_info | append $e -}}
{{- end -}}
{{- if ne .Site.Params.footer.hugo false -}}
{{- $theme := .Scratch.Get "version" | printf `<a href="https://github.com/HEIGE-PCloud/DoIt" target="_blank" rel="noopener noreferrer" title="DoIt %v"><i class="far fa-edit fa-fw"></i> DoIt</a>` -}}
{{- $icon := partial "plugin/fontawesome.html" (dict "Style" "regular" "Icon" "edit") -}}
{{- $theme := printf `<a href="https://github.com/HEIGE-PCloud/DoIt" target="_blank" rel="noopener noreferrer" title="DoIt %v">%v DoIt</a>` (.Scratch.Get "version") $icon -}}
{{- $e := dict "Theme" $theme | T "theme" -}}
{{- $post_info = $post_info | append $e -}}
{{- end -}}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/function/checkbox.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- /* Checkbox unchecked */ -}}
{{- $old := `<input disabled="" type="checkbox">` -}}
{{- $new := `<i class="far fa-square fa-fw"></i>` -}}
{{- $new := partial "plugin/fontawesome.html" (dict "Style" "regular" "Icon" "square") -}}
{{- $content := replace . $old $new -}}

{{- /* Checkbox checked */ -}}
{{- $old = `<input checked="" disabled="" type="checkbox">` -}}
{{- $new = `<i class="far fa-check-square fa-fw"></i>` -}}
{{- $new := partial "plugin/fontawesome.html" (dict "Style" "regular" "Icon" "check-square") -}}
{{- return replace $content $old $new -}}
6 changes: 4 additions & 2 deletions layouts/posts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ <h2 class="single-subtitle">{{ . }}</h2>
{{- $categories := slice -}}
{{- range .Params.categories -}}
{{- $category := partialCached "function/path.html" . . | printf "/categories/%v" | $.Site.GetPage -}}
{{- $categories = $categories | append (printf `<a href="%v"><i class="far fa-folder fa-fw"></i>%v</a>` $category.RelPermalink $category.Title) -}}
{{- $icon := partial "plugin/fontawesome.html" (dict "Style" "regular" "Icon" "folder") -}}
{{- $categories = $categories | append (printf `<a href="%v">%v%v</a>` $category.RelPermalink $icon $category.Title) -}}
{{- end -}}
{{- with delimit $categories "&nbsp;" -}}
&nbsp;<span class="post-category">
Expand All @@ -72,7 +73,8 @@ <h2 class="single-subtitle">{{ . }}</h2>
{{- $series := slice -}}
{{- range .Params.series -}}
{{- $singleSeries := partialCached "function/path.html" . . | printf "/series/%v" | $.Site.GetPage -}}
{{- $series = $series | append (printf `<a href="%v"><i class="far fa-list-alt fa-fw"></i>%v</a>` $singleSeries.RelPermalink $singleSeries.Title) -}}
{{- $icon := partial "plugin/fontawesome.html" (dict "Style" "regular" "Icon" "list-alt") -}}
{{- $series = $series | append (printf `<a href="%v">%v%v</a>` $singleSeries.RelPermalink $icon $singleSeries.Title) -}}
{{- end -}}
{{- with delimit $series "&nbsp;" -}}
&nbsp;<span class="post-series">
Expand Down

0 comments on commit 2eb89db

Please sign in to comment.