Skip to content

Commit 93c9027

Browse files
MoritzWeber0lenderomtherobrob
authored
feat: Show image and other news on news pages (#166)
On news pages, show the image and other news pages. On mobile devices, only the image is displayed. While changing some parts, I refactored some code to use pure SCSS instead of bootstrap. Resolves #144 --------- Co-authored-by: Lennart Rommeiss <[email protected]> Co-authored-by: Robert Schuster <[email protected]>
1 parent 1b4a45e commit 93c9027

File tree

20 files changed

+179
-104
lines changed

20 files changed

+179
-104
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You can find the instructions in the official [Hugo documentation](https://gohug
2020

2121
Validate the installation by running `hugo version` in the command line.
2222

23-
In addition, we use some node packages, for example bootstrap as UI toolkit. To install the packages,
23+
In addition, we use some node packages, for example pagefind for the search. To install the packages,
2424
install the node package manager `npm` on your machine. Instructions are available in the [official documentation](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
2525

2626
Validate the installation by running `npm --version` in the command line.

assets/sass/_variables.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
$breakpoint-sm: 576px;
2+
$breakpoint-md: 768px;
3+
$breakpoint-lg: 992px;
4+
$breakpoint-xl: 1200px;
5+
16
body {
27
--bs-light-rgb: 219, 224, 229;
38
--pagefind-ui-scale: 1;

assets/sass/footer.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
justify-content: normal;
99
flex-wrap: wrap;
1010

11-
@include media-breakpoint-up(lg) {
11+
@media (min-width: #{$breakpoint-lg}) {
1212
justify-content: flex-end;
1313
}
1414
}
@@ -25,7 +25,7 @@
2525
color: var(--link-hovered);
2626
}
2727

28-
@include media-breakpoint-up(lg) {
28+
@media (min-width: #{$breakpoint-lg}) {
2929
margin-left: 1.6rem;
3030
margin-right: 0;
3131
}

assets/sass/form.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
margin-left: 0;
44
margin-right: 0;
55

6-
@include media-breakpoint-down(md) {
6+
@media (max-width: #{$breakpoint-md}) {
77
max-width: fit-content;
88
}
99

@@ -19,7 +19,7 @@
1919
border-color: var(--color-onLight);
2020
padding: 1.2rem;
2121

22-
@include media-breakpoint-up(md) {
22+
@media (min-width: #{$breakpoint-md}) {
2323
width: 50%;
2424
}
2525
}

assets/sass/navigation.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
display: flex;
1414
justify-content: space-between;
1515

16-
@include media-breakpoint-up(md) {
16+
@media (min-width: #{$breakpoint-md}) {
1717
justify-content: unset;
1818
}
1919
}
@@ -30,7 +30,7 @@
3030
display: flex;
3131
justify-content: flex-end;
3232

33-
@include media-breakpoint-up(md) {
33+
@media (min-width: #{$breakpoint-md}) {
3434
display: block;
3535
}
3636
}
@@ -39,15 +39,15 @@
3939
width: 100%;
4040
display: none;
4141

42-
@include media-breakpoint-up(md) {
42+
@media (min-width: #{$breakpoint-md}) {
4343
display: block;
4444
}
4545
}
4646

4747
.o-header__nav nav h2 {
4848
display: block;
4949

50-
@include media-breakpoint-up(md) {
50+
@media (min-width: #{$breakpoint-md}) {
5151
display: none;
5252
}
5353
}
@@ -152,7 +152,7 @@
152152
.o-header__item .o-header__item-countries {
153153
display: flex;
154154

155-
@include media-breakpoint-up(md) {
155+
@media (min-width: #{$breakpoint-md}) {
156156
display: none;
157157
z-index: 2;
158158
position: absolute;
@@ -172,21 +172,21 @@
172172
.o-nav__menu-button {
173173
display: flex;
174174

175-
@include media-breakpoint-up(md) {
175+
@media (min-width: #{$breakpoint-md}) {
176176
display: none;
177177
}
178178
}
179179

180180
.o-header__expand-button {
181181
display: none;
182182

183-
@include media-breakpoint-up(md) {
183+
@media (min-width: #{$breakpoint-md}) {
184184
display: flex;
185185
}
186186
}
187187

188188
.o-header__nav--open nav {
189-
@include media-breakpoint-down(md) {
189+
@media (max-width: #{$breakpoint-md}) {
190190
display: flex;
191191
flex-direction: column;
192192
align-items: flex-end;

assets/sass/print.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
.a-anchorlink__link,
3333
picture,
3434
.icon-arrow_outward,
35-
.sidemenu,
35+
.o-aside,
3636
.o-list__picture,
3737
.o-header__wrapper,
3838
.o-footer__links,

assets/sass/sidemenu.scss

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,22 @@
1010

1111
z-index: 3;
1212

13-
@include media-breakpoint-up(lg) {
14-
margin-right: 1.2rem;
13+
display: flex;
14+
flex-direction: column;
15+
gap: 1.5rem;
16+
flex-wrap: wrap;
17+
height: fit-content;
18+
19+
@media (min-width: #{$breakpoint-lg}) {
1520
margin-bottom: 0;
1621
}
1722

18-
@include media-breakpoint-down(lg) {
23+
@media (max-width: #{$breakpoint-lg}) {
1924
display: none;
2025
}
2126

22-
.o-single__container {
23-
margin-bottom: 1.6rem;
24-
}
25-
2627
.o-aside__mobile-container--open {
27-
@include media-breakpoint-down(lg) {
28+
@media (max-width: #{$breakpoint-lg}) {
2829
display: block;
2930
}
3031
}
@@ -36,10 +37,10 @@
3637
padding-left: 0;
3738
}
3839

39-
.tableOfContents a {
40+
.o-aside a {
4041
text-decoration-line: none;
4142
display: flex;
42-
align-items: center;
43+
align-items: flex-start;
4344
gap: .5rem;
4445
}
4546

@@ -76,3 +77,13 @@
7677
background-color: var(--link-default);
7778
}
7879
}
80+
81+
.o-news__list {
82+
list-style-type: none;
83+
list-style-position: outside;
84+
padding-left: 0;
85+
86+
&-date {
87+
padding-left: 2.5rem;
88+
}
89+
}

assets/sass/stage.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
display: flex;
3333
z-index: 2;
3434

35-
@include media-breakpoint-up(md) {
35+
@media (min-width: #{$breakpoint-md}) {
3636
width: 60%;
3737
max-width: 792px; // 1320*0.6
3838
}

assets/sass/styles.scss

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,23 @@ main > .container {
7676
border-radius: var(--border-radius-l);
7777
padding: 2rem;
7878

79-
@include media-breakpoint-down(sm) {
79+
@media (max-width: #{$breakpoint-sm}) {
8080
margin-top: 1.6rem;
8181
}
8282
}
8383

8484
main > .container:is(.o-single--with-sidemenu) {
8585
background-color: unset;
8686
padding: 0;
87+
88+
display: grid;
89+
grid-template-columns: 1fr 2fr;
90+
gap: 1.5rem;
91+
92+
@media (max-width: #{$breakpoint-lg}) {
93+
display: flex;
94+
flex-direction: column;
95+
}
8796
}
8897

8998
img {
@@ -103,7 +112,9 @@ img {
103112

104113
.o-list__link-wrapper {
105114
display: flex;
115+
gap: 2rem;
106116
margin-bottom: 0;
117+
padding-left: 0;
107118

108119
li {
109120
list-style-type: none;
@@ -117,7 +128,7 @@ img {
117128
}
118129

119130
.container {
120-
@include media-breakpoint-down(sm) {
131+
@media (max-width: #{$breakpoint-sm}) {
121132
max-width: calc(100% - 3.6rem);
122133
}
123134
}
@@ -131,9 +142,23 @@ img {
131142
padding: 0;
132143
background-color: inherit;
133144
}
145+
146+
&__content {
147+
display: flex;
148+
flex-direction: column;
149+
gap: 1.5rem;
150+
}
151+
152+
&__news-image {
153+
margin-bottom: 1.6rem;
154+
155+
@media (min-width: #{$breakpoint-lg}) {
156+
display: none;
157+
}
158+
}
134159
}
135160

136-
.o-single__header {
161+
.o-single__content-header {
137162
display: flex;
138163
justify-content: space-between;
139164
flex-flow: wrap;
@@ -146,17 +171,17 @@ img {
146171
}
147172
}
148173

149-
.o-single__header__title {
174+
.o-single__content-header-title {
150175
display: flex;
151176
align-items: center;
152-
gap: 1rem; // Adjust spacing between the image and the heading
177+
gap: 1.5rem;
153178
}
154179

155-
.o-single__header__title h1 {
180+
.o-single__content-header-title h1 {
156181
margin-bottom: 0;
157182
}
158183

159-
.o-single__header__title img {
184+
.o-single__content-header-title img {
160185
max-height: 3.6rem;
161186
width: auto;
162187
}
@@ -165,7 +190,6 @@ img {
165190
background-color: var(--bg-default);
166191
padding: 2rem;
167192
border-radius: var(--border-radius-l);
168-
margin-bottom: 2.4rem;
169193
}
170194

171195
.pagefind-highlight {

assets/sass/teaser.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
color: var(--link-special);
44

55
&:nth-child(-n+3) {
6-
@include media-breakpoint-down(lg) {
6+
@media (max-width: #{$breakpoint-lg}) {
77
margin-bottom: 2rem;
88
}
99
}
@@ -13,7 +13,7 @@
1313
margin-bottom: 2.4rem;
1414
display: flex;
1515

16-
@include media-breakpoint-down(md) {
16+
@media (max-width: #{$breakpoint-md}) {
1717
flex-flow: wrap;
1818
}
1919

i18n/de.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ highlight:
1616
inofficial: Inoffizielle Information
1717
tip: Persönlicher Tipp
1818
news-headline: Was gibt's Neues?
19+
news-other: Weitere News
1920
_operator__list_title: Betreiber mit FIP
2021
updateDate: Zuletzt aktualisiert
2122
related: Verwandte Seiten

i18n/en.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ highlight:
1616
inofficial: Unofficial Information
1717
tip: Personal Tip
1818
news-headline: What's new?
19+
news-other: Other News
1920
_operator__list_title: Operators supporting FIP
2021
updateDate: Last updated
2122
related: Related Pages

layouts/404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="o-single__header">
44
<h2 data-pagefind-meta="title">404 - Page Not Found</h2>
55
</div>
6-
<div class="content" data-pagefind-body="">
6+
<div class="o-single__content" data-pagefind-body="">
77
<p>Oops! The page you’re looking for is unavailable or has been moved.</p>
88
<p>Here's what you can do next:</p>
99
<ul>

layouts/_default/single.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ <h2 data-pagefind-meta="title">{{ .Title }}</h2>
55
{{ partial "updateDate.html" . }}
66
</div>
77

8-
<div class="content" data-pagefind-body>
8+
<div class="o-single__content" data-pagefind-body>
99
{{ .Content }}
1010
</div>
11-
12-
{{ partial "related.html" . }}
1311
</article>
1412
{{ end }}

0 commit comments

Comments
 (0)