Compare commits

...

2 Commits

Author SHA1 Message Date
Luca 85a39501fb Show images on small screens for blog posts, but not for regular pages
continuous-integration/drone/push Build is passing Details
2023-03-30 00:34:36 +02:00
Luca fbf89b79ee Underline links in main content 2023-03-30 00:32:00 +02:00
2 changed files with 40 additions and 11 deletions

View File

@ -98,6 +98,10 @@ main {
margin-bottom: 0 !important; margin-bottom: 0 !important;
} }
p a {
text-decoration: underline;
}
& > p > img { & > p > img {
max-width: 100%; max-width: 100%;
} }
@ -156,6 +160,7 @@ nav {
article { article {
display: flex; display: flex;
flex-direction: column;
&.preview { &.preview {
margin-bottom: 3rem; margin-bottom: 3rem;
@ -177,21 +182,15 @@ article {
} }
} }
&.page { &.page, &.post {
& > .image { & > .image {
display: none;
text-align: right; text-align: right;
& > img { & > img {
display: block;
height: auto; height: auto;
width: 100%; width: 100%;
} }
@media screen and (min-width: $small) {
display: block;
padding-left: 1.5em;
width: 60%;
}
} }
& > .text { & > .text {
@ -202,6 +201,35 @@ article {
} }
} }
} }
&.page > .image {
display: none;
@media screen and (min-width: $small) {
display: block;
padding-left: 1.5em;
width: 60%;
}
}
&.post {
& > .image {
margin-bottom: 1em;
@media screen and (min-width: $small) {
padding-left: 1.5em;
width: 60%;
}
}
@media screen and (min-width: $small) {
flex-direction: row-reverse;
}
}
@media screen and (min-width: $small) {
flex-direction: row;
}
} }
a { a {

View File

@ -1,9 +1,9 @@
{{ define "main" }} {{ define "main" }}
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{ $textContent := .Content }} {{ $pages := .Site.GetPage "/pages" }}
{{ $page := . }}
{{ with .Resources.GetMatch "image.jpg" }} {{ with .Resources.GetMatch "image.jpg" }}
<article class="page"> <article class="{{ if $pages.InSection $page }}page{{ else }}post{{ end }}">
<section class="text">{{ $textContent }}</section>
<section class="image"> <section class="image">
<img alt="{{ .Title }}" src="{{ .RelPermalink }}"> <img alt="{{ .Title }}" src="{{ .RelPermalink }}">
{{ $params := .Params }} {{ $params := .Params }}
@ -16,6 +16,7 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
</section> </section>
<section class="text">{{ $page.Content }}</section>
</article> </article>
{{ else }} {{ else }}
{{ .Content }} {{ .Content }}