Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
laurakalbag-dot-com
laurakalbag-dot-com
Commits
e5d931a4
Commit
e5d931a4
authored
Jan 04, 2019
by
Laura Kalbag
⚡
Browse files
Make home HTML more semantic. Line up latest photo and note side-by-side on homepage
parent
e4b9a7ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
layouts/index.html
View file @
e5d931a4
{{ define "main" }}
<article>
<div
class=
"entry-content"
>
{{ .Content }}
</div>
</article>
<section
class=
"intro entry-content"
>
{{ .Content }}
</section>
{{/* Define a section to pull recent posts from. For Hugo 0.20 this will default to the section with the most number of pages. */}}
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
{{/* Create a variable with that section to use in multiple places. */}}
...
...
@@ -36,21 +34,27 @@
</section>
{{ end }}
{{ range first 1 (where .Data.Pages "Section" "notes") }}
<h2>
Latest Note
</h2>
<div
class=
"notes-list note-post"
>
<h3>
<a
href=
"{{ .URL }}"
>
{{- .Title -}}
</a>
</h3>
{{ partial "summary.html" . }}
</div>
{{ end }}
{{ range first 1 (where .Data.Pages "Section" "photos") }}
<h2>
Latest Photo
</h2>
<div
class=
"photos-list photo-post"
>
{{ partial "summary-photo.html" . }}
</div>
{{ end }}
<div
class=
"latest"
>
<section
class=
"latest-note"
>
{{ range first 1 (where .Data.Pages "Section" "notes") }}
<h2>
Latest Note
</h2>
<div
class=
"note"
>
<h3>
<a
href=
"{{ .URL }}"
>
{{- .Title -}}
</a>
</h3>
{{ partial "summary.html" . }}
</div>
{{ end }}
</section>
<section
class=
"latest-photo"
>
{{ range first 1 (where .Data.Pages "Section" "photos") }}
<h2>
Latest Photo
</h2>
<div
class=
"photo"
>
{{ partial "summary-photo.html" . }}
</div>
{{ end }}
</section>
</div>
{{ end }}
themes/static-kalbag/static/css/style.css
View file @
e5d931a4
...
...
@@ -595,6 +595,26 @@ body.contact-me .navigation-menu a[href="/"] {
/* - - - - - - - - VIEW-SPECIFIC
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - HOME
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
@media
screen
and
(
min-width
:
70em
)
{
/* make latest note and photo on homepage split into two columns on wider views */
body
.home
.latest
{
display
:
grid
;
grid-template-columns
:
auto
50%
;
}
}
body
.home
.note
{
margin-left
:
0
;
}
body
.home
.latest-note
h3
{
margin-top
:
1.2em
;
}
/* - - - - - - - - BLOG
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment