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;
}
p a {
text-decoration: underline;
}
& > p > img {
max-width: 100%;
}
@ -156,6 +160,7 @@ nav {
article {
display: flex;
flex-direction: column;
&.preview {
margin-bottom: 3rem;
@ -177,21 +182,15 @@ article {
}
}
&.page {
&.page, &.post {
& > .image {
display: none;
text-align: right;
& > img {
display: block;
height: auto;
width: 100%;
}
@media screen and (min-width: $small) {
display: block;
padding-left: 1.5em;
width: 60%;
}
}
& > .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 {

View File

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