update
This commit is contained in:
24
layouts/_default/_markup/render-image.html
Normal file
24
layouts/_default/_markup/render-image.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{{ $src := .Destination }}
|
||||
{{ $alt := .Text | default "image" }}
|
||||
{{ $title := .Title }}
|
||||
{{ $isRemote := strings.HasPrefix $src "http" }}
|
||||
|
||||
{{ if $isRemote }}
|
||||
{{ with resources.GetRemote $src }}
|
||||
{{ if eq .MediaType.SubType "svg" }}
|
||||
<img src="{{ $src }}" alt="{{ $alt }}" {{ if $title }}title="{{ $title }}"{{ end }} loading="lazy">
|
||||
{{ else }}
|
||||
{{ $webp := .Resize "800x webp" | fingerprint }}
|
||||
<img src="{{ $webp.RelPermalink }}" alt="{{ $alt }}" {{ if $title }}title="{{ $title }}"{{ end }} loading="lazy">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ with resources.Get $src }}
|
||||
{{ if eq .MediaType.SubType "svg" }}
|
||||
<img src="{{ $src }}" alt="{{ $alt }}" {{ if $title }}title="{{ $title }}"{{ end }} loading="lazy">
|
||||
{{ else }}
|
||||
{{ $resized := .Resize "800x webp" }}
|
||||
<img src="{{ $resized.RelPermalink }}" alt="{{ $alt }}" {{ if $title }}title="{{ $title }}"{{ end }} loading="lazy">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -3,7 +3,12 @@
|
||||
{{ partial "common/head.html" . }}
|
||||
<body>
|
||||
{{ partial "UI/navbar.html" . }}
|
||||
|
||||
<!-- <div class="mobile-searchbar" id="search"></div> -->
|
||||
<main>{{ block "main" . }} {{ end }}</main>
|
||||
{{ partial "UI/modal.html" . }} {{ partial "common/scripts.html" . }}
|
||||
|
||||
{{ partial "common/footer.html" . }} {{ partial
|
||||
"UI/create-story-dialog.html" . }} {{ partial "UI/modal.html" . }} {{
|
||||
partial "common/scripts.html" . }}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,51 +1,5 @@
|
||||
{{ define "main" }}
|
||||
<section class="hero">
|
||||
<div class="">
|
||||
<h1 class="" data-pagefind-meta="title">{{T "hero.heading"}}</h1>
|
||||
<p class="" data-pagefind-meta="description">{{T "hero.description"}}</p>
|
||||
</div>
|
||||
<div class="tags_categories">
|
||||
<div class="category_list">
|
||||
|
||||
<h3 class="">
|
||||
<img src="/icons/categories.svg" alt="" class="">
|
||||
{{T "categories"}}
|
||||
</h3>
|
||||
<ul>
|
||||
{{ range $name, $taxonomy := .Site.Taxonomies.categories }}
|
||||
<li class="chip">
|
||||
<a href="{{site.BaseURL}}{{"categories/"| relLangURL}}{{ $name | urlize }}/">{{ $name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="tags_list">
|
||||
|
||||
<h3 class="">
|
||||
<img src="/icons/hastag.svg" alt="" class="">
|
||||
{{T "tags"}}
|
||||
</h3>
|
||||
<ul>
|
||||
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
|
||||
<li class="chip">
|
||||
<a href="{{site.BaseURL}}{{"tags/"| relLangURL}}{{ $name | urlize }}/">{{ $name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<button class="story-btn" id="createStoryBtn">{{T "submitButtonLabelText"}}</button>
|
||||
<dialog class="story_dialog">
|
||||
<button id="closeStoryModal" autofocus>Close</button>
|
||||
<iframe src="https://ai.odoo4projects.com/form/345c0f2c-8764-4094-8a5d-1be9c2ed86ef" frameborder="1"></iframe>
|
||||
</dialog>
|
||||
{{ define "main" }} {{ partial "sections/hero.html" . }}
|
||||
|
||||
<!-- stories -->
|
||||
<section class="story__grid">
|
||||
{{ range site.RegularPages }}
|
||||
{{ partial "UI/article-card.html" . }} {{end}}
|
||||
</section>
|
||||
{{ end }}
|
||||
<div class="space">{{ partial "sections/story-grid.html" . }}</div>
|
||||
{{ end }}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{{ define "main" }}
|
||||
<!-- stories -->
|
||||
<section class="story__grid">
|
||||
{{ range .Pages }} {{ partial "UI/article-card.html" . }} {{end}}
|
||||
</section>
|
||||
|
||||
{{ end }}
|
||||
|
||||
@@ -1,3 +1,39 @@
|
||||
{{ define "main" }}
|
||||
<section class="single-page">{{.Content}}</section>
|
||||
<section class="single-page">
|
||||
<div class="article__content">
|
||||
<header class="article__header">
|
||||
<h1 class="article__heading">{{ .Title }}</h1>
|
||||
|
||||
<div class="">
|
||||
<a href="">
|
||||
<h4 class="author__name">{{ .Params.author }}</h4>
|
||||
</a>
|
||||
|
||||
<p class="publish__date">posted on {{ .PublishDate |time.Format ":date_medium" }}</p>
|
||||
<div class="article__tags_categories">
|
||||
<ul>
|
||||
{{ range .Params.categories }}
|
||||
|
||||
<a href="{{site.BaseURL}}{{"categories/"| relLangURL}}{{ . | urlize }}/">
|
||||
<li class="article__category">{{.}}</li>
|
||||
</a>
|
||||
{{ end }}
|
||||
</ul>
|
||||
<ul>
|
||||
{{ range .Params.tags }}
|
||||
|
||||
<a href="{{site.BaseURL}}{{"tags/"| relLangURL}}{{ . | urlize }}/">
|
||||
<li class="article__tag">{{.}}</li></a>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="article__toc mobile_toc">{{ .TableOfContents }}</div>
|
||||
</header>
|
||||
<article>{{.Content}}</article>
|
||||
</div>
|
||||
|
||||
<div class="article__toc desktop_toc">{{ .TableOfContents }}</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{ define "main" }}
|
||||
<!-- stories -->
|
||||
<section class="story__grid">
|
||||
<section class="story__grid_2">
|
||||
{{ range .Pages }} {{ partial "UI/article-card.html" . }} {{end}}
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user