diff options
| -rw-r--r-- | assets/js/ed.js | 21 | ||||
| -rw-r--r-- | assets/sass/_customize.scss | 7 | ||||
| -rw-r--r-- | assets/sass/_ed.scss | 27 | ||||
| -rw-r--r-- | assets/sass/_syntax.scss | 2 | ||||
| -rw-r--r-- | assets/sass/style.scss | 8 | ||||
| -rw-r--r-- | go.mod | 4 | ||||
| -rw-r--r-- | go.sum | 2 | ||||
| -rw-r--r-- | google68c3edfdb3673ddb.html | 1 | ||||
| -rw-r--r-- | i18n/en.toml | 5 | ||||
| -rw-r--r-- | i18n/ru.toml | 3 | ||||
| -rw-r--r-- | layouts/partials/hypothesis.html | 3 | ||||
| -rw-r--r-- | layouts/partials/mini-toc.html | 6 | ||||
| -rw-r--r-- | layouts/partials/post-toc-summary.html | 17 | ||||
| -rw-r--r-- | layouts/partials/sidebar-toc.html | 5 | ||||
| -rw-r--r-- | layouts/partials/sidebar.html | 4 | ||||
| -rw-r--r-- | netlify-preview.js | 18 | ||||
| -rw-r--r-- | netlify.toml | 10 |
17 files changed, 68 insertions, 75 deletions
diff --git a/assets/js/ed.js b/assets/js/ed.js index b4ba4d6..639a774 100644 --- a/assets/js/ed.js +++ b/assets/js/ed.js @@ -13,27 +13,6 @@ function setupBackToTop() { } } -// Annotation support -function setupHypothes() { - const hypothesisContainer = document.querySelector('.hypothesis-container'); - if (hypothesisContainer !== null) { - hypothesisContainer.addEventListener('click', e => { - e.preventDefault(); - - let script = document.createElement('script'); - script.setAttribute('src', 'https://cdn.hypothes.is/hypothesis'); - script.type = 'text/javascript'; - document.getElementsByTagName('head')[0].appendChild(script); - }); - } - - const hypothesisLink = document.querySelector('#hypothesis-link'); - if (hypothesisLink !== null) { - hypothesisContainer.addEventListener('click', e => e.preventDefault()); - } -} - document.addEventListener('DOMContentLoaded', () => { setupBackToTop(); - setupHypothes(); }); diff --git a/assets/sass/_customize.scss b/assets/sass/_customize.scss index ca681cd..f741708 100644 --- a/assets/sass/_customize.scss +++ b/assets/sass/_customize.scss @@ -83,7 +83,8 @@ template { color: $text-light-color; } -.post .byline { +.post .byline, +.project .byline { font-style: italic; font-weight: normal; letter-spacing: 0; @@ -286,7 +287,3 @@ ul.tags-cloud { .screen-reader-text { @include visually-hidden(); } - -.hypothesis-container { - cursor: pointer; -} diff --git a/assets/sass/_ed.scss b/assets/sass/_ed.scss index 5173f6d..2bdc796 100644 --- a/assets/sass/_ed.scss +++ b/assets/sass/_ed.scss @@ -789,3 +789,30 @@ li.prose-indent { .theme-base-brown .related-posts li a:hover { color: #8f5536; } + +.posts-table { + border: none; + width: 100%; + background-color: transparent; +} + +.posts-tr { + border: none; + background-color: transparent; +} + +.posts-td-time { + border: none; + background-color: transparent !important; + width: 1%; + white-space: nowrap; + padding:0 5px 0 0; + vertical-align: top; +} + +.posts-td-link { + border: none; + background-color: transparent !important; + padding:0 0 0 0; + vertical-align:top; +} diff --git a/assets/sass/_syntax.scss b/assets/sass/_syntax.scss index 05a61c7..9d77d76 100644 --- a/assets/sass/_syntax.scss +++ b/assets/sass/_syntax.scss @@ -23,7 +23,7 @@ pre { white-space: pre-wrap; word-break: break-all; word-wrap: break-word; - background-color: #f9f9f9; + background-color: #e5e4e2; } pre code { padding: 0; diff --git a/assets/sass/style.scss b/assets/sass/style.scss index ea708ce..8fac225 100644 --- a/assets/sass/style.scss +++ b/assets/sass/style.scss @@ -7,7 +7,7 @@ /* Fonts */ $main-font: "Palatino Linotype", "Book Antiqua", Palatino, serif; $heading-font: sans-serif; -$regular-font-size: 1.25em; /* 20px / 16px = 1.25em; support text resizing in all browsers */ +$regular-font-size: 1.1em; /* 20px / 16px = 1.25em; support text resizing in all browsers */ /* @@ -26,3 +26,9 @@ $link-color: #841212; @import "form-elements"; @import "customize"; @import "themes"; + +/* Code */ +pre { + max-height: 400px; + overflow-y: auto; +} @@ -1,8 +1,8 @@ -module github.com/sergeyklay/gohugo-theme-ed +module github.com/smadurange/gohugo-theme-ed go 1.18 require ( - github.com/MihaiValentin/lunr-languages v0.0.0-20220731202355-707574c524a6 // indirect + github.com/MihaiValentin/lunr-languages v0.0.0-20250309185944-190ad03ed756 // indirect github.com/olivernn/lunr.js v2.3.9+incompatible // indirect ) @@ -1,4 +1,6 @@ github.com/MihaiValentin/lunr-languages v0.0.0-20220731202355-707574c524a6 h1:zneQRMcYb0EA5ZT4W6EOcs9CxZtDZhAFEq0lIk0GYUM= github.com/MihaiValentin/lunr-languages v0.0.0-20220731202355-707574c524a6/go.mod h1:9u5XeCq3kYXZEJvSRP8Pz2qBAsNsmIM9ssN2fE1MnPw= +github.com/MihaiValentin/lunr-languages v0.0.0-20250309185944-190ad03ed756 h1:DknA9ZOx7KoZ/07g2Ismhg+r1JsBAjc4ZAGb3p8VDdQ= +github.com/MihaiValentin/lunr-languages v0.0.0-20250309185944-190ad03ed756/go.mod h1:9u5XeCq3kYXZEJvSRP8Pz2qBAsNsmIM9ssN2fE1MnPw= github.com/olivernn/lunr.js v2.3.9+incompatible h1:eH8iBnjlR4mwlYDdNuqy9PCNLjp2bEs6aoNnTSaccx0= github.com/olivernn/lunr.js v2.3.9+incompatible/go.mod h1:yEkQ1DUSMtNsn8n2CqvQXZd0ErWPEG8g9QRmblR+KS8= diff --git a/google68c3edfdb3673ddb.html b/google68c3edfdb3673ddb.html deleted file mode 100644 index 7479799..0000000 --- a/google68c3edfdb3673ddb.html +++ /dev/null @@ -1 +0,0 @@ -google-site-verification: google68c3edfdb3673ddb.html
\ No newline at end of file diff --git a/i18n/en.toml b/i18n/en.toml index 2f44e07..70aa406 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -11,7 +11,7 @@ other = 'Updated on' [latest_publications] - other = 'Latest publications' + other = 'Latest posts' [your_name] other = 'Your name' @@ -69,6 +69,3 @@ [back_to_top_label] other = 'Back to top of the page' - -[annotate] - other = 'Annotate me' diff --git a/i18n/ru.toml b/i18n/ru.toml index 6a782ef..1920721 100644 --- a/i18n/ru.toml +++ b/i18n/ru.toml @@ -69,6 +69,3 @@ [back_to_top_label] other = 'Вернуться в начало страницы' - -[annotate] - other = 'Добавить аннотацию' diff --git a/layouts/partials/hypothesis.html b/layouts/partials/hypothesis.html deleted file mode 100644 index 1417ea3..0000000 --- a/layouts/partials/hypothesis.html +++ /dev/null @@ -1,3 +0,0 @@ -<span class="hypothesis-container"> - <a class="sidebar-nav-item" id="hypothesis-link" href="#">{{ i18n "annotate" }}</a> -</span> diff --git a/layouts/partials/mini-toc.html b/layouts/partials/mini-toc.html index 0d52866..20a8fb2 100644 --- a/layouts/partials/mini-toc.html +++ b/layouts/partials/mini-toc.html @@ -13,12 +13,12 @@ <div class="toc" role="navigation"> <h2>{{ i18n "latest_publications" }}</h2> - <ul class="texts"> + <table class="texts posts-table"> {{/* Range through the first $maxPosts items of the $section */}} {{ range (first $maxPosts $section) }} - <li class="text-title"> + <tr class="text-title posts-tr"> {{ partial "post-toc-summary" . }} - </li> + </tr> {{ end }} </ul> </div> diff --git a/layouts/partials/post-toc-summary.html b/layouts/partials/post-toc-summary.html index 371a6f1..a96cb29 100644 --- a/layouts/partials/post-toc-summary.html +++ b/layouts/partials/post-toc-summary.html @@ -1,7 +1,10 @@ -<span class="post-meta"> - <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}"> - {{- .Date | time.Format (site.Params.dateFormatToc | default "2006.01.02") }} - </time> -</span> - -<a href="{{ .Permalink }}">{{ .Title }} </a> +<td class="posts-td-time"> + <span class="post-meta"> + <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}"> + {{- .Date | time.Format (site.Params.dateFormatToc | default "2006.01.02") }} + </time> + </span> +</td> +<td class="posts-td-link"> + <a href="{{ .Permalink }}">{{ .Title }} </a> +</td> diff --git a/layouts/partials/sidebar-toc.html b/layouts/partials/sidebar-toc.html index 5f4ff7e..0e9f1fb 100644 --- a/layouts/partials/sidebar-toc.html +++ b/layouts/partials/sidebar-toc.html @@ -13,11 +13,6 @@ {{ $toc = $toc | replaceRE "(<[/]?ul>|<[/]?ol>|<[/]?li>)" "" | safeHTML }} {{ $toc = $toc | replaceRE `<a href="(.*)">(.*)</a>` `<a class="sidebar-nav-item sidebar-nav-item-toc" href="$1">$2</a>` | safeHTML }} - {{ if ne .Params.annotations false }} - {{ $annotation := (partial "hypothesis.html" .) }} - {{ $toc = $toc | replaceRE `<nav class="sidebar-nav">` (printf `<nav class="sidebar-nav">%s` $annotation) | safeHTML }} - {{ end }} - {{ $home := printf `<a class="sidebar-nav-item" href="%s">%s</a>` site.Home.RelPermalink (i18n "home") | safeHTML }} {{ $toc = $toc | replaceRE `<nav class="sidebar-nav">` (printf `<nav class="sidebar-nav">%s` $home) | safeHTML }} diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 59d2360..0f7e19d 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -22,10 +22,6 @@ </a> {{- end }} - {{- if ne .Params.annotations false }} - {{ partial "hypothesis.html" . }} - {{- end }} - {{- with site.Menus.feeds }} <div class="sidebar-nav-item"> {{- range $i, $ := site.Menus.feeds }} diff --git a/netlify-preview.js b/netlify-preview.js index 5400d48..3b6a3a0 100644 --- a/netlify-preview.js +++ b/netlify-preview.js @@ -21,22 +21,22 @@ fs.readFile(path.resolve(__dirname, netlifyConfig), 'utf8', (err, data) => { // <- default-src 'self' blob:; line = line.replace(/(default-src) ('self')(;)/, '$1 $2 blob:$3'); - // -> style-src 'self' cdn.hypothes.is giscus.app; - // <- style-src 'self' 'unsafe-inline' cdn.hypothes.is giscus.app; - line = line.replace(/(style-src) ('self') (cdn\.hypothes\.is giscus\.app)(;)/, '$1 $2 $3 \'unsafe-inline\'$4'); + // -> style-src 'self' giscus.app; + // <- style-src 'self' 'unsafe-inline' giscus.app; + line = line.replace(/(style-src) ('self') (giscus\.app)(;)/, '$1 $2 $3 \'unsafe-inline\'$4'); // -> media-src 'self'; // <- media-src 'self' blob: https://app.netlify.com; line = line.replace(/(media-src) ('self')(;)/, '$1 $2 blob: https://app.netlify.com$3'); - // -> frame-src hypothes.is giscus.app; - // <- frame-src hypothes.is giscus.app app.netlify.com; - line = line.replace(/(frame-src) (hypothes\.is giscus\.app)(;)/, '$1 $2 app.netlify.com$3'); + // -> frame-src giscus.app; + // <- frame-src giscus.app app.netlify.com; + line = line.replace(/(frame-src) (giscus\.app)(;)/, '$1 $2 app.netlify.com$3'); - // -> script-src 'self' www.googletagmanager.com hypothes.is cdn.hypothes.is giscus.app; - // <- script-src 'self' www.googletagmanager.com hypothes.is cdn.hypothes.is giscus.app netlify-cdp-loader.netlify.app; + // -> script-src 'self' www.googletagmanager.com giscus.app; + // <- script-src 'self' www.googletagmanager.com giscus.app netlify-cdp-loader.netlify.app; line = line.replace( - /(script-src) ('self' www\.googletagmanager\.com hypothes\.is cdn\.hypothes\.is giscus\.app)(;)/, + /(script-src) ('self' www\.googletagmanager\.com giscus\.app)(;)/, '$1 $2 netlify-cdp-loader.netlify.app$3' ); diff --git a/netlify.toml b/netlify.toml index 3323bf6..d030639 100644 --- a/netlify.toml +++ b/netlify.toml @@ -18,7 +18,7 @@ # here, but we recommend using the Netlify UI for sensitive # values to keep them out of your source repository. [context.production] - command = 'hugo --source=exampleSite --baseURL ${URL} --destination ../public --minify; cp google68c3edfdb3673ddb.html ./public' + command = 'hugo --source=exampleSite --baseURL ${URL} --destination ../public --minify;' [context.production.environment] HUGO_ENV = 'production' @@ -88,14 +88,12 @@ # (including inline scripts and event-handling HTML attributes). Content-Security-Policy = """ default-src 'self'; - script-src 'self' www.googletagmanager.com hypothes.is cdn.hypothes.is giscus.app; - style-src 'self' cdn.hypothes.is giscus.app; - img-src 'self' data: *.google-analytics.com www.googletagmanager.com www.gstatic.com stats.g.doubleclick.net; + script-src 'self' giscus.app; + style-src 'self' giscus.app; font-src 'self'; - connect-src 'self' *.google-analytics.com *.analytics.google.com analytics.google.com www.googletagmanager.com stats.g.doubleclick.net; media-src 'self'; object-src 'self'; - frame-src hypothes.is giscus.app; + frame-src giscus.app; worker-src 'self'; frame-ancestors 'none'; form-action 'self' submit-form.com; |
