diff --git a/.gitignore b/.gitignore index 1516e93..b0a48ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ public resources/_gen +.DS_Store \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index dc19131..df27575 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "themes/zen"] path = themes/zen - url = https://github.com/frjo/hugo-theme-zen.git + url = https://git.hamburg.ccc.de/CCCHH/hackertours-theme.git + branch = hackertours-mobile-nav diff --git a/README.md b/README.md index 476cd85..4c6a557 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,26 @@ hugo server --buildFuture --buildDrafts Then open http://localhost:1313 +The header uses the logo dimensions in `hugo.yaml` in both languages, without +shrinking the logo to fit the text. With JavaScript enabled, screens up to 666px +wide use a flat, borderless full-width menu button at the bottom and a scrollable +panel above it. The language link spans the panel's content width, includes the +translation icon, and uses the same font size as the menu links. +The page reserves space for the button so it does not cover content. + +## Brand spelling check + +Hugo builds check content source lines for the name `Hackertours` in any other +casing and report the file and line as build errors for pages included in the +build. URLs, email addresses, social handles, Matrix room addresses and +Markdown link destinations are excluded. Commented-out content is checked too, +so it is ready to publish. + +For an intentional exception, add `` at the +end of a Markdown line, or `# hackertours-lint-ignore` at the end of a YAML +front matter line. This ignores that entire source line, so keep unrelated +occurrences on other lines. + ## Shortcode: Language badge Use the `lang` shortcode to mark whether a tour is in German, English or bilingual. It renders a small superscript badge next to the text, with details when hovered over or parsed by a screenreader. diff --git a/assets/css/_custom.css b/assets/css/_custom.css index 04fd621..f58cbc2 100644 --- a/assets/css/_custom.css +++ b/assets/css/_custom.css @@ -1,14 +1,144 @@ @import './_schedule.css'; @import './_gallery.css'; -.header__intro_headline { +.intro-text { + white-space: pre-line; +} + +.header__logo { + flex-shrink: 0; +} + +/* Header h1 styling - responsive sizing that grows with viewport */ +.header__site-name { + font-size: var(--fs-xxl); + margin-block-start: 0; + margin-block-end: 0; + flex-shrink: 1; + min-width: 0; +} + +/* Smaller on mobile only */ +@media (width <= 666px) { + .header__site-name { + font-size: var(--fs-l); + } +} + +/* Logo scaling - smaller on mobile */ +.header__logo-image { + width: 50px; + height: 50px; +} + +@media (width >= 667px) { + .header__logo-image { + width: 100px; + height: 100px; + } +} + +/* Reserve space for the mobile menu without changing the theme's colours or fonts. */ +:root { + --mobile-bar-h: 3.25rem; +} + +.layout__page:has(> .mobile-nav:not([hidden])) { + padding-block-end: calc(var(--mobile-bar-h) + env(safe-area-inset-bottom, 0px)); +} + +:root:has(.mobile-nav:not([hidden])) { + scroll-padding-block-end: calc(var(--mobile-bar-h) + 1rem); +} + +.mobile-nav { + position: fixed; + inset: 0; + width: auto; + height: auto; +} + +.mobile-nav__cover { + inset: 0; + width: auto; + height: auto; +} + +.mobile-nav__toggle.button { + position: fixed; + inset: auto 0 0; + justify-content: center; + gap: 0.6rem; + width: auto; + block-size: calc(var(--mobile-bar-h) + env(safe-area-inset-bottom, 0px)); + padding: 0 var(--gutters) env(safe-area-inset-bottom, 0px); + border: 0; + border-radius: 0; + background: var(--color-button); + + &:hover, + &:focus-visible, + &:active { + background: var(--color-button-hover); + box-shadow: none; + } + + &:focus-visible { + outline-offset: -4px; + } +} + +.mobile-nav__sheet { + position: absolute; + inset: auto 0 calc(var(--mobile-bar-h) + env(safe-area-inset-bottom, 0px)); + width: auto; + height: auto; + max-height: calc(100% - var(--mobile-bar-h) - env(safe-area-inset-bottom, 0px) - var(--spacing-l)); + overflow-y: auto; + padding: var(--spacing-m) var(--gutters); + transform: translateY(100%); + + [data-navopen] & { + transform: translateY(0); + } +} + +.mobile-nav__region .language-selector ul { + flex: 1; + flex-direction: column; +} + +.language-selector a { + display: flex; + align-items: center; + gap: 0.45em; +} + +.language-selector .language-icon { + inline-size: 1.1em; + block-size: 1.1em; + flex-shrink: 0; margin: 0; - font: bold var(--fs-xxl) "Arial"; - padding-bottom: 10px; + fill: currentcolor; } -.header__intro_text { - font-family: var(--ff-body) + +.mobile-nav__region .language-selector { + font-size: inherit; } + +.mobile-nav__region .language-selector a, +.mobile-nav__navbar a { + padding-block: 0.5rem; +} + +.mobile-nav__region .language-selector a { + justify-content: center; +} + +.mobile-nav__navbar a { + display: block; +} + table, th, td { border: 1px solid; } @@ -17,9 +147,9 @@ th, td { font-variant-numeric: tabular-nums; } -.title-post-date { - font-size: .7em; - margin-left: 2em; +.title-post-date { margin-left: 0em; + display: block; + font-size: 0.5em; } /* Zen v7 paints body with --color-body-bg and .page with --color-page-bg. */ @@ -45,27 +175,24 @@ th, td { --color-mobile-menu: #141414; } - nav ul li { - flex-grow: 1; - text-align: center; - } - .main-menu a:active { - text-decoration: none; - } - /* Links in text keep their underline: the link colour alone is too close to the text colour. */ - nav a, - .header a { - text-decoration: none; - } +} + +nav ul li { + flex-grow: 1; + text-align: center; +} +.main-menu a:active { + text-decoration: none; +} +/* Links in text keep their underline: the link colour alone is too close to the text colour. */ +nav a, +.header a { + text-decoration: none; } h2 a { margin-right: 2em; } - -.title-post-date { - margin-left: 0em; -} /* Visible when focused with the keyboard; the visually-hidden class hides it otherwise. */ .skip-link:focus { position: absolute; diff --git a/content/de/_index.md b/content/de/_index.md index 6deb6c3..623bfd4 100644 --- a/content/de/_index.md +++ b/content/de/_index.md @@ -1,5 +1,5 @@ --- -title: Hamburg Hackertours (de) +title: Willkommen bei Hamburg Hackertours! menus: main: name: Home @@ -7,9 +7,8 @@ weight: 1 params: headline: Willkommen bei Hamburg Hackertours! intro: | - Für den Congress und für das Easterhegg organisiert der CCC Hamburg Touren zu interessanten Orten in und um Hamburg. Hier findet ihr Informationen zu aktuellen und vergangenen Veranstaltungen! - logowidth: 500 - logoheight: 500 + Für den Congress und für das Easterhegg organisiert der CCC Hamburg Touren zu interessanten Orten in und um Hamburg. + Hier findet ihr Informationen zu aktuellen und vergangenen Veranstaltungen! cascade: params: intro: Wir von Hamburg Hackertours zeigen euch die Stadt! @@ -20,9 +19,9 @@ Wir bereiten Touren für den [40C3](https://events.ccc.de/category/40c3/) vor. I )\s*$` $line) -}} + {{- $text := replaceRE `\]\([^)]*\)` "]" $line -}} + {{- $text = replaceRE `(?i)(?:https?://|mailto:|www\.)[^\s<>"']+|[[:alnum:]._%+-]+@[[:alnum:]._-]+|@[[:alnum:]_]+|#[[:alnum:]_-]+:[[:alnum:]._-]+` "" $text -}} + {{- range findRE `(?i)\bhackertours\b` $text -}} + {{- if ne . "Hackertours" -}} + {{- errorf "%s:%d: %q should be \"Hackertours\" (different casing) - to ignore this, add a hackertours-lint-ignore comment on this line" $file.Filename (add $index 1) . -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} +{{- end -}} diff --git a/layouts/_partials/mobilemenu.html b/layouts/_partials/mobilemenu.html index af2cf49..e77bced 100644 --- a/layouts/_partials/mobilemenu.html +++ b/layouts/_partials/mobilemenu.html @@ -1,22 +1,38 @@ -