diff --git a/exampleSite/README.md b/exampleSite/README.md index b68338b9c2..9acc177df8 100644 --- a/exampleSite/README.md +++ b/exampleSite/README.md @@ -1,10 +1,11 @@ -- sticky bar -> TODO - récriture doc -> TODO - créer une section Showcase -- refaire la possibilité d'overrider le style/script/etc -> TODO - créer des jolis thèmes de base (avec des noms) -> TODO - ajouter les attachments -> TODO +- ajouter les childs -> TODO +- refaire la possibilité d'overrider le style/script/etc -> OK +- sticky bar -> OK - ajouter Travis pour tester le thème quotidiennement avec les nouvelles versions de Hugo -> OK - #54 -> OK - corriger slider menu qui ne fonctionne plus -> OK diff --git a/exampleSite/content/cont/shortcodes.files/BachGavotteShort.mp3 b/exampleSite/content/cont/shortcodes.files/BachGavotteShort.mp3 new file mode 100644 index 0000000000..94e3d0e539 Binary files /dev/null and b/exampleSite/content/cont/shortcodes.files/BachGavotteShort.mp3 differ diff --git a/exampleSite/content/cont/shortcodes.files/Carroll_AliceAuPaysDesMerveilles.pdf b/exampleSite/content/cont/shortcodes.files/Carroll_AliceAuPaysDesMerveilles.pdf new file mode 100644 index 0000000000..97377e99b1 Binary files /dev/null and b/exampleSite/content/cont/shortcodes.files/Carroll_AliceAuPaysDesMerveilles.pdf differ diff --git a/exampleSite/content/cont/shortcodes.files/adivorciarsetoca00cape.pdf b/exampleSite/content/cont/shortcodes.files/adivorciarsetoca00cape.pdf new file mode 100644 index 0000000000..e589c73e97 Binary files /dev/null and b/exampleSite/content/cont/shortcodes.files/adivorciarsetoca00cape.pdf differ diff --git a/exampleSite/content/cont/shortcodes.files/hugo.png b/exampleSite/content/cont/shortcodes.files/hugo.png new file mode 100644 index 0000000000..48acf346c9 Binary files /dev/null and b/exampleSite/content/cont/shortcodes.files/hugo.png differ diff --git a/exampleSite/content/cont/shortcodes.files/movieselectricsheep-flock-244-32500-2.mp4 b/exampleSite/content/cont/shortcodes.files/movieselectricsheep-flock-244-32500-2.mp4 new file mode 100644 index 0000000000..9f1fe56456 Binary files /dev/null and b/exampleSite/content/cont/shortcodes.files/movieselectricsheep-flock-244-32500-2.mp4 differ diff --git a/exampleSite/content/cont/shortcodes.md b/exampleSite/content/cont/shortcodes.md index 18309e8ada..9cd67f696a 100644 --- a/exampleSite/content/cont/shortcodes.md +++ b/exampleSite/content/cont/shortcodes.md @@ -12,6 +12,14 @@ To avoid this limitations, Hugo created [shortcodes](https://gohugo.io/extras/sh **Hugo-theme-learn** provides multiple shortcodes on top of existing ones. +## Attachments + +{{% attachments style="info" /%}} +{{% attachments style="warning" /%}} +{{% attachments style="note" /%}} +{{% attachments style="tip" /%}} +{{% attachments /%}} + ## Notice The notice shortcode shows 4 types of disclaimers to help you structure your page. diff --git a/layouts/404.html b/layouts/404.html index c27d4d0ba2..17c4aca7ce 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -4,7 +4,6 @@ {{ partial "meta.html" . }} {{ partial "favicon.html" . }} {{ .Scratch.Add "title" "" }}{{ if eq .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}} {{ .Scratch.Get "title" }} - {{ partial "style.html" . }} @@ -27,7 +26,8 @@ ul { list-style-type: none; } - + +{{ partial "custom-header.html" . }} diff --git a/layouts/partials/custom-footer.html b/layouts/partials/custom-footer.html new file mode 100644 index 0000000000..11b8334937 --- /dev/null +++ b/layouts/partials/custom-footer.html @@ -0,0 +1 @@ + diff --git a/layouts/partials/custom-header.html b/layouts/partials/custom-header.html new file mode 100644 index 0000000000..bafd3f2f45 --- /dev/null +++ b/layouts/partials/custom-header.html @@ -0,0 +1 @@ + diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 4b7e66dd4a..65bd3756d2 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -69,5 +69,8 @@ + diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 35af4673ad..4a0ef8a3f8 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -28,7 +28,7 @@ } {{ end }} - {{ partial "style.html" . }} + {{ partial "custom-header.html" . }} {{ partial "menu.html" . }} diff --git a/layouts/partials/script.html b/layouts/partials/script.html deleted file mode 100644 index 0eb04ed50f..0000000000 --- a/layouts/partials/script.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/layouts/partials/style.html b/layouts/partials/style.html deleted file mode 100644 index b40f427255..0000000000 --- a/layouts/partials/style.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/layouts/shortcodes/attachments.html b/layouts/shortcodes/attachments.html index 3940d287f2..42780d0190 100644 --- a/layouts/shortcodes/attachments.html +++ b/layouts/shortcodes/attachments.html @@ -1,6 +1,6 @@ -
+
{{if eq .Page.File.BaseFileName "index"}} @@ -8,6 +8,7 @@ {{else}} {{$.Scratch.Add "filesName" (printf "%s.files" .Page.File.BaseFileName)}} {{end}} +
{{ range (readDir (printf "./content/%s%s" .Page.File.Dir ($.Scratch.Get "filesName")) ) }} {{ $fileDir := replace $.Page.File.Dir "\\" "/" }} {{if ($.Get "pattern")}} @@ -28,6 +29,7 @@ {{end}} {{end}} +
+ {{.Inner}}
-{{.Inner}} \ No newline at end of file diff --git a/static/css/theme.css b/static/css/theme.css index 29948b0684..04aa5cb81f 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -529,6 +529,65 @@ div.notices.tip p { div.notices.tip p:first-child:after { content: 'Tip'; } + +section.attachments { + margin: 2rem 0; + position: relative; +} + +section.attachments label { + font-weight: 400; + padding-left: 0.5em; + padding-top: 0.2em; + padding-bottom: 0.2em; + margin: 0; +} + +section.attachments .attachments-files { + padding: 15px; + display: block; + font-size: 1rem; + margin-top: 0rem; + margin-bottom: 0rem; + color: #666; +} + +section.attachments.info label { + color: #fff; + background: #F0B37E; +} + +section.attachments.info .attachments-files { + background: #FFF2DB; +} + +section.attachments.tip label { + color: #fff; + background: rgba(92, 184, 92, 0.8); +} + +section.attachments.tip .attachments-files { + background: #E6F9E6; +} + +section.attachments.warning label { + color: #fff; + background: rgba(217, 83, 79, 0.8); +} + +section.attachments.warning .attachments-files { + background: #FAE2E2; +} + +section.attachments.note label { + color: #fff; + background: #6AB0DE; +} + +section.attachments.note .attachments-files { + background: #E7F2FA; +} + code, kbd, pre, samp { font-family: "Consolas", menlo, monospace; font-size: 92%;