Skip to content

Commit

Permalink
feat: recursive repoEditURL
Browse files Browse the repository at this point in the history
BREAKING CHANGES: Param 'repoURL' in params.yaml is deprecated.
  • Loading branch information
wangchucheng committed Apr 21, 2021
1 parent 1762613 commit 285eb0f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion data/eureka.yaml
@@ -1 +1 @@
version: 0.7.1-dev
version: 0.8.0
14 changes: 7 additions & 7 deletions exampleSite/config/_default/params.yaml
Expand Up @@ -57,13 +57,13 @@ comment:
# # If self-hosting, please enter the url (e.g. https://commento.example.com) here. Otherwise leave empty.
# url:

valine:
# Browse https://valine.js.org/configuration.html to see the options available.
# You can list the key and value you want as below.
# Because Hugo's config params are case-insensitive, you need to add `-` or `_` before the uppercase letters.
# For example, `appId` should be written as `app-Id` or other acceptable formats.
app-Id:
app-Key:
# valine:
# # Browse https://valine.js.org/en/configuration.html to see the options available.
# # You can list the key and value you want as below.
# # Because Hugo's config params are case-insensitive, you need to add `-` or `_` before the uppercase letters.
# # For example, `appId` should be written as `app-Id` or other acceptable formats.
# app-Id:
# app-Key:

diagram:
handler: mermaid
Expand Down
2 changes: 1 addition & 1 deletion layouts/docs/doc_list.html
@@ -1,6 +1,6 @@
{{/* Deprecation warning(v1.0.0) starts */}}
{{ define "main" }}
{{ warnf "Value 'doc_list' of layout param in %q is deprecated and will be removed in Eureka v1.0.0. Use 'doc-list' instead." .File.Path }}
{{ warnf "Value 'doc_list' of layout param in %q is deprecated and will be removed in Eureka v1.0.0. Please use 'doc-list' instead." .File.Path }}
{{ partial "components/doc-list" . }}
{{ end }}
{{/* Deprecation warning(v1.0.0) ends */}}
2 changes: 1 addition & 1 deletion layouts/partials/components/post-edit.html
Expand Up @@ -21,7 +21,7 @@
</div>
{{/* Deprecation warning(v1.0.0) starts */}}
{{- else if .Site.Params.repoURL }}
{{ warnf "Param 'repoURL' in params.yaml is deprecated and will be removed in Eureka v1.0.0. See https://www.wangchucheng.com/en/docs/hugo-eureka/customization/" }}
{{ warnf "Param 'repoURL' in params.yaml is deprecated and will be removed in Eureka v1.0.0. See https://www.wangchucheng.com/en/docs/hugo-eureka/customization/#params-config-file" }}
<div class="flex md:justify-end my-4">
{{- $repoEditURL := path.Join .Site.Params.repoURL "/blob/master/" }}
{{ $contentDir := cond .Site.IsMultiLingual .Site.Params.contentDir "/content/" }}
Expand Down
19 changes: 12 additions & 7 deletions layouts/partials/head.html
Expand Up @@ -82,13 +82,18 @@

{{- $enableMath := false }}
{{- if .Site.Params.math.handler }}
{{- $bundles := partial "utils/get-bundles" . }}
{{- $enableMath = true }}
{{- range $bundles.Reverse }}
{{- if and (ne .Params.math nil) (ne .Params.math "") }}
{{- $enableMath = .Params.math }}
{{- end }}
{{- end }}
{{- $bundles := partial "utils/get-bundles" . }}
{{- $enableMath = true }}
{{- range $bundles.Reverse }}
{{- if and (ne .Params.enableMath nil) (ne .Params.enableMath "") }}
{{- $enableMath = .Params.enableMath }}
{{/* Deprecation warning(v1.0.0) starts */}}
{{- else if and (ne .Params.math nil) (ne .Params.math "") }}
{{ warnf "Param 'math' in %q is deprecated and will be removed in Eureka v1.0.0. Please use 'enableMath' instead." .File.Path }}
{{- $enableMath = .Params.math }}
{{/* Deprecation warning(v1.0.0) ends */}}
{{- end }}
{{- end }}
{{- end }}

{{ define "partials/camelize" }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/widgets/about.html
Expand Up @@ -36,7 +36,7 @@
{{ range $brand }}
{{/* Deprecation warning(v1.0.0) starts */}}
{{ if .icon_pack }}
{{ warnf "Param 'icon_pack' in %q is deprecated and will be removed in Eureka v1.0.0. Use 'iconPack' instead." $.File.Path }}
{{ warnf "Param 'icon_pack' in %q is deprecated and will be removed in Eureka v1.0.0. Please use 'iconPack' instead." $.File.Path }}
{{ end }}
{{ $iconPack := .iconPack | default .icon_pack }}
{{/* Deprecation warning(v1.0.0) ends */}}
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "hugo-eureka",
"version": "0.7.1-dev",
"version": "0.8.0",
"description": "Eureka is a feature-rich and highly customizable Hugo theme.",
"repository": "https://github.com/wangchucheng/hugo-eureka",
"author": "C. Wang <me@wangchucheng.com>",
Expand Down

0 comments on commit 285eb0f

Please sign in to comment.