Skip to content

Commit

Permalink
fix semantic html errors #120
Browse files Browse the repository at this point in the history
  • Loading branch information
onweru committed Jan 13, 2024
1 parent b5a9b40 commit 20909d2
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 35 deletions.
38 changes: 20 additions & 18 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
{{ $config := site.Params }}
{{ $context := . }}
{{- $config := site.Params }}
{{- $context := . }}
{{- $item_type := "http://schema.org/WebPage" }}
{{- $lang := site.Language.Lang }}
{{- $is_dark := $config.enableDarkMode }}
{{- $default_mode := $config.defaultLightingMode -}}
<!doctype html>
<html lang="{{ site.Language.Lang }}"{{ with $config.enableDarkMode }} class="dark"{{ end }}{{ with $config.defaultLightingMode }}
data-mode="{{ . }}"
{{ end }}>
<html lang={{ $lang }}{{ with $is_dark }} class=dark{{ end }}{{ with $default_mode }} data-mode={{ . }}{{ end }} itemscope itemtype={{ $item_type }}>
<head>
{{- partial "head/index" . }}
</head>
<body class="page-{{ .Kind }}" id="pagetop">
<header class="nav_header">
{{- partial "nav" . }}
</header>
{{ if or (eq .Section $config.blogDir) (eq .Type "search" ) }}
{{- if or (eq .Section $config.blogDir) (eq .Type "search" ) }}
{{- block "main" . }}{{ end }}
{{ else }}
{{- else }}
<div class="main wrap pt-4">
{{ $docSections := $config.docSections }}
{{- $docSections := $config.docSections }}
{{- with $docSections }}{{- else }}
{{- $docSections = "docs" }}
{{- end }}
{{ $uniqueHomepage := .IsHome }}
{{ if $config.uniqueHomepage }}
{{ if .IsHome }}
{{ $uniqueHomepage = true }}
{{ end }}
{{ else }}
{{ $uniqueHomepage = false }}
{{ end }}
{{- $uniqueHomepage := .IsHome }}
{{- if $config.uniqueHomepage }}
{{- if .IsHome }}
{{- $uniqueHomepage = true }}
{{- end }}
{{- else }}
{{- $uniqueHomepage = false }}
{{- end }}
{{- if and (in $docSections .Section) (ne $uniqueHomepage true) }}
{{- partial "document" . }}
{{- else }}
Expand All @@ -35,11 +37,11 @@
</div>
{{- end -}}
</div>
{{ end }}
{{- end }}
{{- partial "scripts/translations" . -}}
{{- partialCached "footer" . -}}
{{- partialCached "sprites" . -}}
{{- partial "scripts/bundle" . -}}
{{- partial "scripts/mermaid" . -}}
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion layouts/_default/term.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<a href="{{ $value.Permalink }}" {{ if eq $index 0 }} class=grid-reverse {{ end }}>
<div class="article_thumb" style="background-image: url({{ $bg }})"></div>
<div class="article_meta {{ if eq $index 0 }} center_y {{ end }}">
<time class="post_date">{{ dateFormat "January 02, 2006" $value.Date }}</time>
<div class="post_date">{{ dateFormat "January 02, 2006" $value.Date }}</div>
<h3 class="article_title">{{ $value.Title }}</h3>
<div class="article_excerpt {{ if eq $index 0 }} visible {{ end }}">
<p>{{ $value.Summary | truncate 100 }}</p>
Expand Down
2 changes: 1 addition & 1 deletion layouts/blog/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<a href="{{ $value.Permalink }}" {{ if eq $index 0 }} class="grid-reverse" {{ end }}>
<div class="article_thumb" style="background-image: url({{ $bg }});"></div>
<div class="article_meta {{ if eq $index 0 }} center_y {{ end }}">
<time class="post_date">{{ dateFormat "January 02, 2006" $value.Date }}</time>
<div class="post_date">{{ dateFormat "January 02, 2006" $value.Date }}</div>
<h3 class="article_title">{{ $value.Title }}</h3>
<div class="article_excerpt {{ if eq $index 0 }} visible {{ end }}">
<p>{{ truncate 100 $value.Summary }}</p>
Expand Down
26 changes: 13 additions & 13 deletions layouts/partials/head/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@
{{- end }}
<title>{{ if and $t (ne (trim (lower $s) "") (trim (lower $t) "")) }}{{ $t }} | {{ end }}{{ $s }}</title>

{{- partial "opengraph" . }}
{{- partial "opengraph" . -}}

{{- $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") -}}
{{- $styles := resources.Get "sass/main.sass" | resources.ExecuteAsTemplate "main.sass" . | resources.ToCSS $options | resources.Fingerprint "sha512" }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}">

{{- $sp := site.Params }}
{{- with $sp.customCSS }}
{{- $config := site.Params }}
{{- with $config.customCSS }}
{{- range . -}}
<link rel="stylesheet" href="{{ . }}">
{{- end }}
{{- end }}

{{ with $sp.metaThemeColor }}
<meta name="theme-color" content="{{.}}">
{{ end }}
{{- with $config.metaThemeColor }}
<meta name="theme-color" content="{{ . }}">
{{- end }}

{{ if .Description }}
{{- if .Description }}
<meta name="description" content="{{ .Description }}">
{{ else if .IsPage }}
<meta name="description" content="{{ .Summary | plainify }}">
{{ else if $sp.Description }}
<meta name="descripion" content="{{ $sp.Description }}">
{{ end }}
{{- else if .IsPage }}
<meta name="description" content="{{ plainify .Summary }}">
{{- else if $config.Description }}
<meta name="descripion" content="{{ $config.Description }}">
{{- end }}
{{- partial "head/liteyoutube" . }}
{{- partialCached "hooks/head" . }}
{{- partialCached "hooks/head" . -}}
4 changes: 2 additions & 2 deletions layouts/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<picture data-lit="{{ $litPath }}" data-dark="{{ $darkPath }}">
<img src="{{ $litPath }}" alt="{{ site.Title }} Logo">
</picture>
<label class="nav_toggle toggle" title='{{ T "site_menu" }}' role="button">
<div class="nav_toggle toggle" title='{{ T "site_menu" }}'>
{{ partial "sprite" (dict "icon" "harmburger") }}
</label>
</div>
</a>
<ul class="nav_body">
<li class="nav-item">
Expand Down

0 comments on commit 20909d2

Please sign in to comment.