feat: much cleaner theme override

This commit is contained in:
Hugo Poissonnet 2022-12-05 20:05:31 +01:00
parent 567cc42c9c
commit 7485ce2e04
6 changed files with 58 additions and 6 deletions

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "v2/themes/cupper-hugo-theme"]
path = v2/themes/cupper-hugo-theme
url = gitea@home.hugopoi.net:hugopoi/cupper-hugo-theme.git
url = https://github.com/zwbetz-gh/cupper-hugo-theme.git

View File

@ -0,0 +1,25 @@
<nav id="patterns-nav" class="patterns" role="navigation">
<h2 class="vh">{{ T "nav_main_navigation" }}</h2>
<button id="menu-button" aria-expanded="false">
<svg viewBox="0 0 50 50" aria-hidden="true" focusable="false">
<use href="#menu"></use>
</svg>
{{ T "nav_button_menu" }}
</button>
{{ $current := . }}
<ul id="patterns-list">
{{ range .Site.Menus.nav }}
<li class="pattern">
{{ $active := or ($current.IsMenuCurrent "nav" .) ($current.HasMenuCurrent "nav" .) }}
{{ $active = or $active (eq .URL $current.RelPermalink) }}
{{ $active = or $active (and (eq .Name "Tags") (eq $current.Section "tags")) }}
<a href="{{ .URL }}" {{ if $active }}aria-current="page"{{ end }}>
<svg class="bookmark-icon" aria-hidden="true" focusable="false" viewBox="0 0 40 50">
<use href="#bookmark"></use>
</svg>
<span class="text">{{ .Name }}</span>
</a>
</li>
{{ end }}
</ul>
</nav>

View File

@ -1,7 +1,3 @@
body {
font-size: calc(1em + 0.20vw);
}
.main-and-footer > div {
max-width: initial;
}

4
v2/static/css/prism.css Normal file
View File

@ -0,0 +1,4 @@
/* PrismJS 1.29.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+bash+c+csv+diff+docker+go+http+json+json5+markup-templating+nginx+php+python+ruby+rust+toml+typescript+yaml&plugins=line-numbers+file-highlight */
code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
pre[class*=language-].line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}

27
v2/static/js/prism.js Normal file

File diff suppressed because one or more lines are too long

@ -1 +1 @@
Subproject commit 2f7a0351f101684e7b0fdc1ec726499ae247f7a5
Subproject commit 2f388f66ea7f0b78cbbdbc9f7eec1ba0fd7cecdb