Compare commits

...

3 Commits

Author SHA1 Message Date
stereobooster 44d012a785
Merge 759982fd4a into f31082dec8 2023-09-12 09:48:05 +00:00
stereobooster 759982fd4a Picture + webp 2023-09-12 11:47:56 +02:00
James Panther f31082dec8
🚸 Remove env check in robots.txt generation
Fixes: #620
2023-09-12 11:37:25 +10:00
4 changed files with 45 additions and 24 deletions

View File

@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Changed ### Changed
- ⚠️ Renamed the `params.rtl` language parameter to `languageDirection` as this is now supported by Hugo ([#583](https://github.com/jpanther/congo/issues/583)) - ⚠️ Renamed the `params.rtl` language parameter to `languageDirection` as this is now supported by Hugo ([#583](https://github.com/jpanther/congo/issues/583))
- Robots.txt file now allows all by default without concern for whether the environment is set to production ([#620](https://github.com/jpanther/congo/pull/620))
- Upgrade to Mermaid v10.4.0 ([#577](https://github.com/jpanther/congo/pull/577), [#582](https://github.com/jpanther/congo/pull/582), [#626](https://github.com/jpanther/congo/pull/626), [#638](https://github.com/jpanther/congo/pull/638)) - Upgrade to Mermaid v10.4.0 ([#577](https://github.com/jpanther/congo/pull/577), [#582](https://github.com/jpanther/congo/pull/582), [#626](https://github.com/jpanther/congo/pull/626), [#638](https://github.com/jpanther/congo/pull/638))
- Upgrade to KaTeX v0.16.8 ([#590](https://github.com/jpanther/congo/pull/590)) - Upgrade to KaTeX v0.16.8 ([#590](https://github.com/jpanther/congo/pull/590))
- Upgrade to Tailwind v3.3.3 ([#602](https://github.com/jpanther/congo/pull/602)) - Upgrade to Tailwind v3.3.3 ([#602](https://github.com/jpanther/congo/pull/602))

View File

@ -9,6 +9,10 @@ This article offers a sample of basic Markdown formatting that can be used in Co
<!--more--> <!--more-->
## Image
![sample image](thumb-surendran-mp-IhWYiwSxm8g-unsplash.jpg)
## Headings ## Headings
The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest. The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.

View File

@ -23,29 +23,49 @@
{{ end }} {{ end }}
{{ with $resource }} {{ with $resource }}
<figure> <figure>
<img <picture>
class="mx-auto my-0 rounded-md" {{ if ne .MediaType.SubType "svg" }}
{{ if eq .MediaType.SubType "svg" }} <source
src="{{ .RelPermalink }}" {{ if lt .Width 660 }}
{{ else }} {{ with .Resize (printf "%dx%d webp" .Width .Height) }}
width="{{ .Width }}" src="{{ .RelPermalink }}"
height="{{ .Height }}" {{ end }}
{{ if lt .Width 660 }} {{ else }}
srcset="
{{- (.Resize "330x webp").RelPermalink }} 330w,
{{- (.Resize "660x webp").RelPermalink }} 660w,
{{- (.Resize "1024x webp").RelPermalink }} 1024w,
{{- (.Resize "1320x webp").RelPermalink }} 2x"
src="{{ (.Resize "660x webp").RelPermalink }}"
{{ end }}
type="image/webp"
/>
{{ end }}
<img
class="mx-auto my-0 rounded-md"
{{ if eq .MediaType.SubType "svg" }}
src="{{ .RelPermalink }}" src="{{ .RelPermalink }}"
{{ else }} {{ else }}
srcset=" width="{{ .Width }}"
{{- (.Resize "330x").RelPermalink }} 330w, height="{{ .Height }}"
{{- (.Resize "660x").RelPermalink }} 660w, decoding="async"
{{- (.Resize "1024x").RelPermalink }} 1024w, {{ if lt .Width 660 }}
{{- (.Resize "1320x").RelPermalink }} 2x" src="{{ .RelPermalink }}"
src="{{ (.Resize "660x").RelPermalink }}" {{ else }}
srcset="
{{- (.Resize "330x").RelPermalink }} 330w,
{{- (.Resize "660x").RelPermalink }} 660w,
{{- (.Resize "1024x").RelPermalink }} 1024w,
{{- (.Resize "1320x").RelPermalink }} 2x"
src="{{ (.Resize "660x").RelPermalink }}"
{{ end }}
{{ end }} {{ end }}
{{ end }} alt="{{ $altText }}"
alt="{{ $altText }}" {{ if $lazyLoad }}
{{ if $lazyLoad }} loading="lazy"
loading="lazy" {{ end }}
{{ end }} />
/> </picture>
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }} {{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
</figure> </figure>
{{ else }} {{ else }}

View File

@ -1,7 +1,3 @@
User-agent: * User-agent: *
{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }}
Allow: / Allow: /
{{- else }}
Disallow: /
{{- end }}
Sitemap: {{ "sitemap.xml" | absURL }} Sitemap: {{ "sitemap.xml" | absURL }}