Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltlombardi committed Sep 8, 2021
0 parents commit 33863a0
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.md text eol=lf
*.html text eol=lf
*.yaml text eol=lf
*.js text eol=lf
*.scss text eol=lf
*.json text eol=lf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/resources/_gen
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2021 YOUR_NAME_HERE

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module github.com/platenio/hugo-platen

go 1.16

42 changes: 42 additions & 0 deletions layouts/shortcodes/art.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{- if .IsNamedParams -}}
{{- $.Scratch.Set "src" (.Get "src") -}}
{{- $.Scratch.Set "alt" (.Get "alt") -}}
{{- $.Scratch.Set "class" (.Get "class") -}}
{{- $.Scratch.Set "content_warning" (.Get "content_warning") -}}
{{- else -}}
{{- $.Scratch.Set "src" (.Get 0) -}}
{{- $.Scratch.Set "alt" (.Get 1) -}}
{{- $.Scratch.Set "class" (.Get 2) -}}
{{- $.Scratch.Set "content_warning" (.Get 3) -}}
{{- end -}}

{{- $src := $.Scratch.Get "src" -}}
{{- $alt := $.Scratch.Get "alt" | default nil -}}
{{- $class := $.Scratch.Get "class" | default "full" -}}
{{- $content_warning := $.Scratch.Get "content_warning" | default false -}}
{{- $caption := .Inner | default nil -}}

{{- if eq $alt nil -}}
{{- if $.Site.Params.warnOnMissingAltText -}}
{{- warnf (printf "Missing alt text for '%v'" $src) -}}
{{- else -}}
{{- errorf (printf "Missing alt text for '%v'" $src) -}}
{{- end -}}
{{- end -}}

{{ if $content_warning }}
<figure class="art {{ $class }}{{ if $content_warning }} content_warning{{ end }}">
<img src="{{ $src }}" alt="{{ $alt }}" class="content_warning">
{{- if ne $caption nil -}}
<figcaption>{{ $caption | markdownify }}</figcaption>
<button class="content_warning">{{ $content_warning }}</button>
{{- end -}}
</figure>
{{ else }}
<figure class="art {{ $class }}">
<img src="{{ $src }}" alt="{{ $alt }}">
{{- if ne $caption nil -}}
<figcaption>{{ $caption | markdownify }}</figcaption>
{{- end -}}
</figure>
{{ end }}
16 changes: 16 additions & 0 deletions layouts/shortcodes/detail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .IsNamedParams -}}
{{- $.Scratch.Set "class" (.Get "class") -}}
{{- $.Scratch.Set "title" (.Get "title") -}}
{{- else -}}
{{- $.Scratch.Set "class" (.Get 0) -}}
{{- $.Scratch.Set "title" (.Get 1) -}}
{{- end -}}

{{- $class := $.Scratch.Get "class" -}}
{{- $title := $.Scratch.Get "title" -}}
{{- $anchor := urlize $title -}}

<details class="{{ $class }}">
<summary id="{{ $anchor }}">{{ $title }}</summary>
{{ .Inner | markdownify }}
</details>
15 changes: 15 additions & 0 deletions theme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: hugo-platen
license: MIT
licenselink: https://github.com/platenio/hugo-platen/blob/main/LICENSE
description: 'Platen core theme for Hugo: build websites for digital tabletop games'
homepage: http://example.com/
tags: []
features: []
min_version: 0.87.0
author:
name: Platen Cooperative
homepage: https://platen.io
original:
name: 'hugo-book'
homepage: https://hugo-book-demo.netlify.app
repo: https://github.com/alex-shpak/hugo-book

0 comments on commit 33863a0

Please sign in to comment.