diff --git a/README.md b/README.md index 89f8edd..1eec749 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ TODO link RealFaviconGenerator and give steps ## Shortcodes -TODO list em +TODO link to demo post ## Credits diff --git a/archetypes/default.md b/archetypes/default.md index aebfa09..d677d28 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,5 +1,6 @@ -+++ -title = "The Name Of This Project/Site" -+++ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +tags: [] +--- -This is your homepage. These are the contents of the `index.md` file, found in your `content` folder. diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 0a0955d..3d1a5c1 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -5,7 +5,6 @@ title = "Cupper" theme = "cupper-hugo-theme" googleAnalytics = "UA-123456789-1" -# Uncomment below to enable syntax highlighting # For more styles see https://xyproto.github.io/splash/docs/all.html pygmentsCodefences = true pygmentsStyle = "algol" @@ -20,11 +19,11 @@ pygmentsStyle = "algol" quality = 99 [params] - # description = "An accessibility-friendly Hugo theme, ported from the [original Cupper](https://github.com/ThePacielloGroup/cupper) project." + description = "An accessibility-friendly Hugo theme, ported from the [original Cupper](https://github.com/ThePacielloGroup/cupper) project." footer = "Made with [Hugo](https://gohugo.io/). Themed by [Cupper](https://github.com/zwbetz-gh/cupper-hugo-theme). Deployed to [Netlify](https://www.netlify.com/)." # For more date formats see https://gohugo.io/functions/format/ dateFormat = "Jan 2, 2006" - codePenUser = "TODO" + codePenUser = "someUser" [menu] [[menu.nav]] diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index 35ebd29..526c1a8 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -8,7 +8,7 @@ Welcome to **Cupper**: An accessibility-friendly Hugo theme, ported from the [or {{% ticks %}} * Screen reader and keyboard accessible * Responsive -* Shortcodes for figures, notes, warnings, file trees, and expandable sections -- just to name a few +* Numerous shortcodes * Toggleable dark theme * Toggleable table of contents per blog post {{% /ticks %}} diff --git a/exampleSite/content/post/cupper-shortcodes/index.md b/exampleSite/content/post/cupper-shortcodes/index.md new file mode 100644 index 0000000..5565e78 --- /dev/null +++ b/exampleSite/content/post/cupper-shortcodes/index.md @@ -0,0 +1,213 @@ +--- +title: "Cupper shortcodes" +date: 2019-02-12T23:39:06-06:00 +tags: [hugo] +--- + +## blockquote + +``` +{{%/* blockquote author="Carl Jung" */%}} +Even a happy life cannot be without a measure of darkness, and the word happy would lose its meaning if it were not balanced by sadness. It is far better to take things as they come along with patience and equanimity. +{{%/* /blockquote */%}} +``` + +{{% blockquote author="Carl Jung" %}} +Even a happy life cannot be without a measure of darkness, and the word happy would lose its meaning if it were not balanced by sadness. It is far better to take things as they come along with patience and equanimity. +{{% /blockquote %}} + +## cmd + +``` +{{}} +hugo server --gc +{{}} +``` + +{{< cmd >}} +hugo server --gc +{{< /cmd >}} + +## code + +``` +{{}} +
+ +

Confirmation

+

Press Okay to confirm or Cancel

+ + +
+{{}} + +1. The dialog is only announced as a dialog if it takes the `dialog` ARIA role +2. The `aria-labelledby` relationship attribute makes the element carrying the `id` it points to its label +3. The close button uses `aria-label` to provide the text label "close", overriding the text content +4. The heading is used as the dialog's label. The `aria-labelledby` attribute points to its `id` +``` + +{{< code numbered="true" >}} +
+ +

Confirmation

+

Press Okay to confirm or Cancel

+ + +
+{{< /code >}} + +1. The dialog is only announced as a dialog if it takes the `dialog` ARIA role +2. The `aria-labelledby` relationship attribute makes the element carrying the `id` it points to its label +3. The close button uses `aria-label` to provide the text label "close", overriding the text content +4. The heading is used as the dialog's label. The `aria-labelledby` attribute points to its `id` + +## codePen + +``` +{{%/* codePen VpVNKW */%}} +``` + +{{% codePen VpVNKW %}} + +## colors + +``` +{{%/* colors "#111111, #cccccc, #ffffff" */%}} +``` + +{{% colors "#111111, #cccccc, #ffffff" %}} + +## expandable + +``` +{{%/* expandable label="A section of dummy text" level="2" */%}} +Here is some markdown including [a link](https://twitter.com/heydonworks). Donec erat est, feugiat a est sed, aliquet pharetra ipsum. Vivamus in arcu leo. Praesent feugiat, purus a molestie ultrices, libero massa iaculis ante, sit amet accumsan leo eros vel ligula. +{{%/* /expandable */%}} +``` + +{{% expandable label="A section of dummy text" level="2" %}} +Here is some markdown including [a link](https://twitter.com/heydonworks). Donec erat est, feugiat a est sed, aliquet pharetra ipsum. Vivamus in arcu leo. Praesent feugiat, purus a molestie ultrices, libero massa iaculis ante, sit amet accumsan leo eros vel ligula. +{{% /expandable %}} + +## figure + +``` +{{}} +``` + +{{< figure +img="sun.jpg" +caption="The Sun is the star at the center of the Solar System. It is a nearly perfect sphere of hot plasma, with internal convective motion that generates a magnetic field via a dynamo process. It is by far the most important source of energy for life on Earth. [Credits](https://images.nasa.gov/details-GSFC_20171208_Archive_e000393.html)." +command="Resize" +options="700x" >}} + +## fileTree + +``` +{{%/* fileTree */%}} +* Level 1 folder + * Level 2 file + * Level 2 folder + * Level 3 file + * Level 3 folder + * Level 4 file + * Level 3 folder + * Level 4 file + * Level 4 file + * Level 3 file + * Level 2 folder + * Level 3 file + * Level 3 file + * Level 3 file + * Level 2 file +* Level 1 file +{{%/* /fileTree */%}} +``` + +{{% fileTree %}} +* Level 1 folder + * Level 2 file + * Level 2 folder + * Level 3 file + * Level 3 folder + * Level 4 file + * Level 3 folder + * Level 4 file + * Level 4 file + * Level 3 file + * Level 2 folder + * Level 3 file + * Level 3 file + * Level 3 file + * Level 2 file +* Level 1 file +{{% /fileTree %}} + +## note + +``` +{{%/* note */%}} +This is a note! It's something the reader may like to know about but is supplementary to the main content. Use notes when something may be interesting but not critical. +{{%/* /note */%}} +``` + +{{% note %}} +This is a note! It's something the reader may like to know about but is supplementary to the main content. Use notes when something may be interesting but not critical. +{{% /note %}} + +## principles + +``` +{{%/* principles include="Add value, Be consistent" descriptions="true" */%}} +``` + +{{% principles include="Add value, Be consistent" descriptions="true" %}} + +## tested + +``` +{{%/* tested using="Firefox + JAWS, Chrome, Safari iOS + Voiceover, Edge" */%}} +``` + +{{% tested using="Firefox + JAWS, Chrome, Safari iOS + Voiceover, Edge" %}} + +## ticks + +``` +{{%/* ticks */%}} +* Selling point one +* Selling point two +* Selling point three +{{%/* /ticks */%}} +``` + +{{% ticks %}} +* Selling point one +* Selling point two +* Selling point three +{{% /ticks %}} + +## warning + +``` +{{%/* warning */%}} +This is a warning! It's about something the reader should be careful to do or to avoid doing. Use warnings when something could go wrong. +{{%/* /warning */%}} +``` + +{{% warning %}} +This is a warning! It's about something the reader should be careful to do or to avoid doing. Use warnings when something could go wrong. +{{% /warning %}} + +## wcag + +``` +{{%/* wcag include="1.2.1, 1.3.1, 4.1.2" */%}} +``` + +{{% wcag include="1.2.1, 1.3.1, 4.1.2" %}} diff --git a/exampleSite/content/post/cupper-shortcodes/sun.jpg b/exampleSite/content/post/cupper-shortcodes/sun.jpg new file mode 100644 index 0000000..0faeb53 Binary files /dev/null and b/exampleSite/content/post/cupper-shortcodes/sun.jpg differ diff --git a/exampleSite/resources/_gen/images/cupper-shortcodes/sun_huc3d26fbb16c0f70400041133778c1446_3118921_700x0_resize_q99_box.jpg b/exampleSite/resources/_gen/images/cupper-shortcodes/sun_huc3d26fbb16c0f70400041133778c1446_3118921_700x0_resize_q99_box.jpg new file mode 100644 index 0000000..00087f8 Binary files /dev/null and b/exampleSite/resources/_gen/images/cupper-shortcodes/sun_huc3d26fbb16c0f70400041133778c1446_3118921_700x0_resize_q99_box.jpg differ diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 6141206..262b68e 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -14,5 +14,6 @@ {{ partial "script.html" . }} + {{ partial "google-analytics-async.html" . }} diff --git a/layouts/partials/google-analytics-async.html b/layouts/partials/google-analytics-async.html new file mode 100644 index 0000000..ecc2767 --- /dev/null +++ b/layouts/partials/google-analytics-async.html @@ -0,0 +1,10 @@ +{{ if not .Site.IsServer }} + {{ with .Site.GoogleAnalytics }} + + + {{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/codeBlock.html b/layouts/shortcodes/codeBlock.html deleted file mode 100644 index a2b030a..0000000 --- a/layouts/shortcodes/codeBlock.html +++ /dev/null @@ -1 +0,0 @@ -
{{ .Inner }}
diff --git a/layouts/shortcodes/demo.html b/layouts/shortcodes/demo.html deleted file mode 100644 index d0d223d..0000000 --- a/layouts/shortcodes/demo.html +++ /dev/null @@ -1,65 +0,0 @@ -{{ $uniq := .Inner | htmlEscape | md5 | lower }} -
- {{ if .Get "caption" }} -
- {{ end }} -
-
- -
- {{ if .Get "caption" }} -
{{ .Get "caption" | markdownify }}
- {{ end }} - {{ if .Get "caption" }} -
- {{ end }} - - -
diff --git a/layouts/shortcodes/html.html b/layouts/shortcodes/html.html deleted file mode 100644 index 5c7cce2..0000000 --- a/layouts/shortcodes/html.html +++ /dev/null @@ -1,5 +0,0 @@ -{{ $html := .Inner | htmlEscape }} -{{ $html := replace $html "((" "" }} -{{ $html := replace $html "))" "" }} -{{ $numbered := .Get "numbered" }} -
{{ $html | safeHTML }}
diff --git a/layouts/shortcodes/jsBin.html b/layouts/shortcodes/jsBin.html deleted file mode 100644 index c0b8874..0000000 --- a/layouts/shortcodes/jsBin.html +++ /dev/null @@ -1,5 +0,0 @@ -{{ if .IsNamedParams }} - -{{ else }} - -{{ end }} diff --git a/layouts/shortcodes/pattern.html b/layouts/shortcodes/pattern.html deleted file mode 100644 index e1b5141..0000000 --- a/layouts/shortcodes/pattern.html +++ /dev/null @@ -1 +0,0 @@ -{{ $title := .Get 0 }}{{ range .Site.Pages }}{{ if eq .Title $title }}{{ .Title }}{{ end }}{{ end -}} diff --git a/theme.toml b/theme.toml index f4fb4e8..980fbea 100644 --- a/theme.toml +++ b/theme.toml @@ -3,8 +3,8 @@ license = "MIT" licenselink = "https://github.com/zwbetz-gh/cupper-hugo-theme/blob/master/LICENSE" description = "An accessibility-friendly Hugo theme, ported from the original Cupper project." homepage = "https://github.com/zwbetz-gh/cupper-hugo-theme" -tags = ["accessible", "blog", "documentation"] -features = ["accessible", "blog", "documentation"] +tags = ["accessible", "blog", "documentation", "dark"] +features = ["accessible", "blog", "documentation", "dark"] min_version = "0.48" [author]