Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
hestiaHUGO: transformed debugger into a component
Browse files Browse the repository at this point in the history
Appearently, too much inline CSS codes can crush Google Chrome's
view-source capability and consumes too much memory. Hence, the only
viable option is to convert the entire thing as a debugger. Hence,
let's do this.

This patch transforms the built-in debugger into a component and
facilitates a configurable one in hestiaHUGO/ directory.

Signed-off-by: (Holloway) Chew, Kean Ho <kean.ho.chew@zoralab.com>
  • Loading branch information
hollowaykeanho committed May 7, 2023
1 parent 7af6e0f commit dbc3889
Show file tree
Hide file tree
Showing 12 changed files with 777 additions and 463 deletions.
12 changes: 12 additions & 0 deletions hestiaHUGO/data/Hestia/Debugger.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# HESTIA IN-PAGE DEBUGGER
# =======================
# All Hestia's in-page data debugger's configurations. Debugger is only being
# added by UI component data processor **in server mode only**. It is forseeable
# that folks may upstream and made different types of debugger in the future so
# a config panel is required.
#
# 1) Default.Type - Select the default debugger type. It must be a
# component in Hestia. Leaving it blank disables the
# debugger entirely.
[Default]
Type = 'zoralab_debugger'
2 changes: 1 addition & 1 deletion hestiaHUGO/layouts/partials/Hestia/functions/data/Page
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ specific language governing permissions and limitations under the License.


{{- /* BEGIN POST PROCESSING - Hestia data processing ended beyond this line */ -}}
{{- $dataList = partial "Hestia/functions/data/hugo/process/Content/Init" $dataList -}}
{{- $dataList = partial "Hestia/functions/data/hugo/process/LDJSON/Init" $dataList -}}
{{- $dataList = partial "Hestia/functions/data/hugo/process/Content/Init" $dataList -}}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ specific language governing permissions and limitations under the License.


{{- /* source config data */ -}}
{{- $dataList = slice -}}
{{- $dataList = $Page.Components -}}
{{- range $i, $v := $Local -}}
{{- $data = dict -}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,17 @@ specific language governing permissions and limitations under the License.



{{- /* check debugger type */ -}}
{{- if and .Site.Data.Hestia.Debugger.Default.Type .Site.IsServer -}}
{{- $dataList = append (dict
"Name" .Site.Data.Hestia.Debugger.Default.Type
"Include" true
"Variables" dict
) $dataList -}}
{{- end -}}




{{- /* render output */ -}}
{{- return dict "Components" $dataList -}}

0 comments on commit dbc3889

Please sign in to comment.