Welcome to Ned Flander's Leftorium (The Simpsons / Matt Groening)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ $u := "https://example.org/images/a.jpg" }} | |
{{ with resources.GetRemote $u }} | |
{{ with .Err }} | |
{{ errorf "%s" . }} | |
{{ else }} | |
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}"> | |
{{ end }} | |
{{ else }} | |
{{ errorf "Unable to get remote resource %q" $u }} | |
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ with .GetTerms "tags" }} | |
<ul> | |
{{ range . }} | |
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li> | |
{{ end }} | |
</ul> | |
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{- $currentPage := . }} | |
{{- with .Ancestors.Reverse }} | |
<nav class="breadcrumbs"> | |
{{- range $k, $_ := . | append $currentPage }} | |
{{- if $k }} | |
<span class="breadcrumb-separator">»</span> | |
{{- end }} | |
{{- if $currentPage.Eq . }} | |
<a aria-current="page" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> | |
{{- else }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ with .AllTranslations }} | |
<nav class="language-switcher"> | |
{{ range . }} | |
{{ if eq .Language.Lang $.Language.Lang }} | |
<a class="active" aria-current="page" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a> | |
{{ else }} | |
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a> | |
{{ end }} | |
{{ end }} | |
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ with site.RegularPages.Related . }} | |
<p>Related content:</p> | |
<ul> | |
{{ range . }} | |
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li> | |
{{ end }} | |
</ul> | |
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ with resources.Get "sass/main.scss" }} | |
{{ $opts := dict "targetPath" "css/main.css" }} | |
{{ with . | toCSS $opts }} | |
{{ if eq hugo.Environment "development" }} | |
<link rel="stylesheet" href="{{ .RelPermalink }}"> | |
{{ else }} | |
{{ with . | minify | fingerprint }} | |
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"> | |
{{ end }} | |
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ with resources.Get "js/main.js" }} | |
{{ if eq hugo.Environment "development" }} | |
{{ with . | js.Build }} | |
<script src="{{ .RelPermalink }}"></script> | |
{{ end }} | |
{{ else }} | |
{{ $opts := dict "minify" true }} | |
{{ with . | js.Build $opts | fingerprint }} | |
<script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script> | |
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ define "main" }} | |
<h1>{{ .Title }}</h1> | |
{{ .Content }} | |
{{ range .Pages }} | |
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2> | |
{{ end }} | |
{{ end }} |
OlderNewer