diff --git a/assets/scss/_header.scss b/assets/scss/_header.scss index 3167a78..3c78b80 100644 --- a/assets/scss/_header.scss +++ b/assets/scss/_header.scss @@ -20,7 +20,11 @@ flex-direction: column; ul { - align-self: center; + align-self: left; + + li { + padding-left: 0; + } } a { diff --git a/assets/scss/_lists.scss b/assets/scss/_lists.scss index 760d877..a75a253 100644 --- a/assets/scss/_lists.scss +++ b/assets/scss/_lists.scss @@ -24,15 +24,22 @@ border-bottom: var(--pico-muted-border-color) solid var(--pico-border-width); article { - display: inline-block; - } - - article:not(:last-child) { - &::after { - content: ' / '; - white-space: pre; + // display: inline-block; + .home-posts-list-infos { + font-size: small; } } + + // article::before { + // content: ">> "; + // } + + // article:not(:last-child) { + // &::after { + // content: ' / '; + // white-space: pre; + // } + // } } /* Lists of the main page, for contact */ diff --git a/assets/scss/_stream.scss b/assets/scss/_stream.scss new file mode 100644 index 0000000..d2dc9e1 --- /dev/null +++ b/assets/scss/_stream.scss @@ -0,0 +1,43 @@ +// The following rules are styling the stream player +// that I'm using on top of live section pages. +// It doesn't belong to the theme, but to my website +// so it is here. + +@use "@picocss/pico/scss/colors/index" as *; + +.stream { + .status-player { + display: flex; + + audio { + border-radius: 0 var(--pico-border-radius) var(--pico-border-radius) 0; + } + } +} + +// Rules used by the off and on classes below +@mixin status { + display: flex; + border-radius: var(--pico-border-radius) 0 0 var(--pico-border-radius); + flex-grow: 1; + flex-direction: column; + justify-content: space-around; + text-transform: uppercase; + font-weight: bold; + text-align: center; + padding: 0 calc(var(--pico-spacing)/2); + margin: 0; + color: $grey-50; +} + +.off { + @include status; + background-color: $red-500; +} + +.on { + @include status; + background-color: $green-500; +} + +// End of the stream section diff --git a/assets/scss/main.scss b/assets/scss/main.scss index a1b3481..91bd665 100644 --- a/assets/scss/main.scss +++ b/assets/scss/main.scss @@ -12,4 +12,5 @@ @use "footer"; @use "lists"; /* Lists, post-infos, posts-lists */ @use "medias"; /* Audio, streams, figures, post-images */ +@use "stream"; /* Specific to the stream player */ @use "texts"; diff --git a/i18n/en.toml b/i18n/en.toml index 2116ee7..e2ec1bd 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -1,4 +1,6 @@ address = "Address" +announcedLive = "Announce of the next live!" +announce = "Announce!" audioDownload = "Your browser does not support the audio tag, you can access the file directly with" categories = "Categories" contactsPriv = "Personal contacts" diff --git a/i18n/fr.toml b/i18n/fr.toml index 00e040d..a7288d5 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -1,4 +1,6 @@ address = "Adresse" +announcedLive = "Annonce du prochain live !" +announce = "Annonce !" audioDownload = "Ton navigateur ne supporte pas la balise audio, tu peux télécharger le fichier avec" categories = "Catégories " contactsPriv = "Contacts personnels" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index a04c2ca..8d6279f 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -9,4 +9,9 @@ {{- partial "footer.html" . -}} + + {{ if .Params.local_include }} + + {{ end }} diff --git a/layouts/_default/home.html b/layouts/_default/home.html index 02875bc..513d9db 100644 --- a/layouts/_default/home.html +++ b/layouts/_default/home.html @@ -7,14 +7,5 @@ {{.Content}} - {{ if .Site.Params.online }} - {{ partial "online" . }} - {{ end }} - {{ if .Site.Params.contactsPriv }} - {{ partial "perso" .}} - {{ end }} - {{ if .Site.Params.contactsPro }} - {{ partial "pro" . }} - {{ end }} {{ end }} diff --git a/layouts/_default/section.html b/layouts/_default/section.html index 611b812..42b0721 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -11,17 +11,24 @@
{{ range .Pages.ByPublishDate.Reverse }} -
- - {{.Title}} - - {{ partial "lists-footer.html" . }} -
+
+ {{ if .Params.Announce }} + + {{- .Title -}} + {{ i18n "announce" }} + {{ else }} + + {{- .Title -}} + {{ end }} + {{ partial "lists-footer.html" . }} +
+ {{ end }}
{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 0b53320..35c14f7 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,14 +1,6 @@ {{ define "main" }}

{{ .Title }}

- - {{- if ne .Layout "static" }} - {{- partial "post-info.html" . -}} - {{ end }}
+ {{- if ne .Layout "static" }} + {{- partial "post-info.html" . -}} + {{ end }} + {{ end -}} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 6e0d3c1..2fa456e 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,31 +1,40 @@ {{ $currentPage := . -}} {{ $siteSources := .Site.Params.siteSources }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 933bf2b..cbb8512 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,54 +1,10 @@ -
- +
+ +

{{ .Site.Title }}

+
+ {{ if .Params.local_include }} + {{ partial "stream.html" }} + {{ end }}
diff --git a/layouts/partials/home_post_list.html b/layouts/partials/home_post_list.html index cbc45c5..7699428 100644 --- a/layouts/partials/home_post_list.html +++ b/layouts/partials/home_post_list.html @@ -1,14 +1,24 @@
-

{{ i18n "lastPosts" }}

- - {{ range first 5 .Site.RegularPages.ByPublishDate.Reverse }} - + + + {{ range first 5 .Site.RegularPages.ByPublishDate.Reverse }} + + {{ end }}
diff --git a/layouts/partials/stream.html b/layouts/partials/stream.html new file mode 100644 index 0000000..7c54f00 --- /dev/null +++ b/layouts/partials/stream.html @@ -0,0 +1,18 @@ +
+
+

+ +
+
+

+ Écouter le flux (s'il est « on »). + Pour utiliser ton propre client : + OGG + MP3 +

+
+
diff --git a/layouts/shortcodes/abbr.html b/layouts/shortcodes/abbr.html new file mode 100644 index 0000000..79fbfde --- /dev/null +++ b/layouts/shortcodes/abbr.html @@ -0,0 +1,4 @@ + + + +{{ .Get "text" }} diff --git a/layouts/shortcodes/blockquote.html b/layouts/shortcodes/blockquote.html new file mode 100644 index 0000000..3ec66f5 --- /dev/null +++ b/layouts/shortcodes/blockquote.html @@ -0,0 +1,80 @@ + + + + + + +{{ $.Scratch.Set "bl_lang" false }} +{{ $.Scratch.Set "bl_author" false }} +{{ $.Scratch.Set "bl_source" false }} +{{ $.Scratch.Set "bl_link" false }} +{{ $.Scratch.Set "bl_title" false }} + +{{ if .IsNamedParams }} + {{ $.Scratch.Set "bl_lang" (.Get "lang") }} + {{ $.Scratch.Set "bl_author" (.Get "author") }} + {{ $.Scratch.Set "bl_source" (.Get "source") }} + {{ $.Scratch.Set "bl_link" (.Get "link") }} + {{ $.Scratch.Set "bl_title" (.Get "title") }} +{{ else }} + +{{ end }} + + + +{{ with $.Scratch.Get "bl_title" }} + +{{ else }} + {{ with $.Scratch.Get "bl_link" }} + {{ range last 1 (split ($.Scratch.Get "bl_link" ) "://") }} + {{ $.Scratch.Set "title_without_protocol" . }} + {{ end }} + {{ range last 1 (split ($.Scratch.Get "title_without_protocol" ) "www.") }} + {{ $.Scratch.Set "title_without_protocol" . }} + {{ end }} + {{ $.Scratch.Set "bl_title" ($.Scratch.Get "title_without_protocol") }} + + + {{ if (gt (len ($.Scratch.Get "title_without_protocol") ) 32) }} + {{ $title := (slicestr ($.Scratch.Get "title_without_protocol") 0 32) }} + {{ $split_by_fw_slash := split $title "/" }} + {{ $count := (sub (len $split_by_fw_slash) 1) }} + + {{ $.Scratch.Set "tempstring" "" }} + {{ range first $count $split_by_fw_slash }} + {{ $.Scratch.Set "tempstring" ( . | printf "%s%s/" ($.Scratch.Get "tempstring") | printf "%s" ) }} + {{ end }} + {{ $.Scratch.Set "bl_title" ( printf "%s..." ($.Scratch.Get "tempstring") | printf "%s" ) }} + {{ end }} + {{ end }} +{{ end }} +
+
+ {{ .Inner | markdownify | safeHTML -}} + {{ with $.Scratch.Get "bl_author" -}} +
+ {{ with $.Scratch.Get "bl_author" -}}{{ . }}{{ end }} + {{ with $.Scratch.Get "bl_source" }} + — {{ . }} + {{ else }} + {{ with $.Scratch.Get "bl_link" }} + — + {{ $.Scratch.Get "bl_title" }} + + {{ else }} + {{ with $.Scratch.Get "bl_title" }} + — + {{ $.Scratch.Get "bl_title" }} + + {{ end }} + {{ end }} + {{ end }} +
+ {{- end -}} +
+
diff --git a/layouts/shortcodes/contact-email.html b/layouts/shortcodes/contact-email.html new file mode 100644 index 0000000..0958db8 --- /dev/null +++ b/layouts/shortcodes/contact-email.html @@ -0,0 +1 @@ +{{ .Site.Params.author.email }} diff --git a/static/js/on_fiber.js b/static/js/on_fiber.js new file mode 100644 index 0000000..ccd5a61 --- /dev/null +++ b/static/js/on_fiber.js @@ -0,0 +1,16 @@ +const url = 'https://id-libre.org/live/status-json.xsl'; +const statusElement = document.getElementById('on'); + +async function status() { + const response = await fetch(url); + const data = await response.json(); + const status = data.icestats.source ? 'on' : 'off' + + statusElement.innerHTML = status; + statusElement.classList.remove("on", "off"); + statusElement.classList.add(status); +} + +status(); + +setInterval(() => status(), 2000); diff --git a/yarn.lock b/yarn.lock index 626380a..559279f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4,37 +4,36 @@ "@picocss/pico@^2.0.6": version "2.1.1" - resolved "https://registry.npmjs.org/@picocss/pico/-/pico-2.1.1.tgz" + resolved "https://registry.yarnpkg.com/@picocss/pico/-/pico-2.1.1.tgz#f2c4573b0332758b6d9c3caf4ee8b24cf3819f8e" integrity sha512-kIDugA7Ps4U+2BHxiNHmvgPIQDWPDU4IeU6TNRdvXQM1uZX+FibqDQT2xUOnnO2yq/LUHcwnGlu1hvf4KfXnMg== auto-changelog@^2.0.0: - version "2.5.0" - resolved "https://registry.npmjs.org/auto-changelog/-/auto-changelog-2.5.0.tgz" - integrity sha512-UTnLjT7I9U2U/xkCUH5buDlp8C7g0SGChfib+iDrJkamcj5kaMqNKHNfbKJw1kthJUq8sUo3i3q2S6FzO/l/wA== + version "2.6.0" + resolved "https://registry.yarnpkg.com/auto-changelog/-/auto-changelog-2.6.0.tgz#30f7ad70fba7f76927320ad8de40dac1311751d5" + integrity sha512-jJgUkuWXQ7fPLPXOMQk/XSSmy7KvzpzhjJa6w660dq1KTEez/GW2CPckBra3jMMMMpcwxp84bOslo29qRCewzA== dependencies: commander "^7.2.0" - handlebars "^4.7.7" + handlebars "^4.7.9" import-cwd "^3.0.0" - node-fetch "^2.6.1" - parse-github-url "^1.0.3" - semver "^7.3.5" + parse-github-url "^1.0.4" + semver "^7.8.1" commander@^7.2.0: version "7.2.0" - resolved "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== gutenberg-css@0.7.0: version "0.7.0" - resolved "https://registry.npmjs.org/gutenberg-css/-/gutenberg-css-0.7.0.tgz" + resolved "https://registry.yarnpkg.com/gutenberg-css/-/gutenberg-css-0.7.0.tgz#d43a59c40dbf6e11a10d004669f99b671c39267e" integrity sha512-M8o1BVkO8h1YOl1nVv7/ZVYZt8zed4Y3nzmvJbEPu15u/sGllcjITBowTESqd51bXUl3qVbeSnNqSdmjVl5/1g== dependencies: normalize.css "^8.0.1" -handlebars@^4.7.7: - version "4.7.8" - resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz" - integrity sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ== +handlebars@^4.7.9: + version "4.7.9" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.9.tgz#6f139082ab58dc4e5a0e51efe7db5ae890d56a0f" + integrity sha512-4E71E0rpOaQuJR2A3xDZ+GM1HyWYv1clR58tC8emQNeQe3RH7MAzSbat+V0wG78LQBo6m6bzSG/L4pBuCsgnUQ== dependencies: minimist "^1.2.5" neo-async "^2.6.2" @@ -45,84 +44,59 @@ handlebars@^4.7.7: import-cwd@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/import-cwd/-/import-cwd-3.0.0.tgz" + resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-3.0.0.tgz#20845547718015126ea9b3676b7592fb8bd4cf92" integrity sha512-4pnzH16plW+hgvRECbDWpQl3cqtvSofHWh44met7ESfZ8UZOWWddm8hEyDTqREJ9RbYHY8gi8DqmaelApoOGMg== dependencies: import-from "^3.0.0" import-from@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/import-from/-/import-from-3.0.0.tgz" + resolved "https://registry.yarnpkg.com/import-from/-/import-from-3.0.0.tgz#055cfec38cd5a27d8057ca51376d7d3bf0891966" integrity sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ== dependencies: resolve-from "^5.0.0" minimist@^1.2.5: version "1.2.8" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== neo-async@^2.6.2: version "2.6.2" - resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -node-fetch@^2.6.1: - version "2.7.0" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz" - integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== - dependencies: - whatwg-url "^5.0.0" - normalize.css@^8.0.1: version "8.0.1" - resolved "https://registry.npmjs.org/normalize.css/-/normalize.css-8.0.1.tgz" + resolved "https://registry.yarnpkg.com/normalize.css/-/normalize.css-8.0.1.tgz#9b98a208738b9cc2634caacbc42d131c97487bf3" integrity sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg== -parse-github-url@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.3.tgz" - integrity sha512-tfalY5/4SqGaV/GIGzWyHnFjlpTPTNpENR9Ea2lLldSJ8EWXMsvacWucqY3m3I4YPtas15IxTLQVQ5NSYXPrww== +parse-github-url@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/parse-github-url/-/parse-github-url-1.0.4.tgz#4b08752d219b4168a5502366cc459fe48fa8aa9f" + integrity sha512-CEtCOt55fHmd6DpBc/N7H5NC4vJpcquhzzs9Iw2mRj8bVxo1O5TQI5MXKOMO7+yBOqD+5dKCCRK4Kj1KskZc6Q== resolve-from@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -semver@^7.3.5: - version "7.7.1" - resolved "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz" - integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA== +semver@^7.8.1: + version "7.8.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.8.4.tgz#c73eceebae0616934be8dff28a7fd70757c8e696" + integrity sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA== source-map@^0.6.1: version "0.6.1" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - uglify-js@^3.1.4: version "3.19.3" - resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.19.3.tgz#82315e9bbc6f2b25888858acd1fff8441035b77f" integrity sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ== -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - wordwrap@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==