refactor[home]: split monolithic home into reusable partials
Home is split into submodules loaded as partials, indent and comment code
This commit is contained in:
parent
77b7b40a9e
commit
e9634a03bf
|
@ -1,113 +1,34 @@
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
id="mainBG"
|
id="mainBG"
|
||||||
style="background-image: url('{{ if $.Site.Params.mainbg }}{{ $.Site.Params.mainbg }}{{ else }}https://picsum.photos/1920/1080{{ end }}');"
|
style="background-image: url('{{ if $.Site.Params.mainbg }}{{ $.Site.Params.mainbg }}{{ else }}https://picsum.photos/1920/1080{{ end }}');"
|
||||||
>
|
>
|
||||||
|
|
||||||
{{ partial "utilities/wave"}}
|
{{ partial "utilities/wave" .}}
|
||||||
|
|
||||||
<div class="centerAll">
|
<div class="centerAll">
|
||||||
<div class="title text-6xl font-bold text-center">
|
<div class="title text-6xl font-bold text-center">
|
||||||
{{if $.Site.Params.maintitle }}{{ $.Site.Params.maintitle }}{{else}}Hello, World{{end}}
|
{{if $.Site.Params.maintitle }}
|
||||||
|
{{ $.Site.Params.maintitle }}
|
||||||
|
{{else}}
|
||||||
|
Hello, World
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text text-xl text-center">
|
<div class="text text-xl text-center">
|
||||||
{{if $.Site.Params.maintext}}{{ $.Site.Params.maintext }}{{else}}Edit config.toml/params{{end}}
|
{{if $.Site.Params.maintext}}
|
||||||
|
{{ $.Site.Params.maintext }}
|
||||||
|
{{else}}
|
||||||
|
Edit config.toml/params
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{{ $data := .Site.Data.home }}
|
|
||||||
<main class="container mx-auto mt-8 px-4 xl:px-0">
|
<main class="container mx-auto mt-8 px-4 xl:px-0">
|
||||||
<section id="about" class="md:flex justify-around">
|
{{partial "utilities/widgetAbout" .}}
|
||||||
<div class="my-auto md:mr-4">
|
{{partial "utilities/widgetBoxIconText" .}}
|
||||||
{{ partial "home/homeTitle" (dict "title" "About Me") }}
|
{{partial "utilities/widgetBoxImageText" .}}
|
||||||
<div class="flex mt-3 gap-3 text-xl">
|
|
||||||
{{ range $data.about.link }}
|
|
||||||
<a href="{{.url}}"><i class="{{ .icon }}"></i></a>{{end}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="mt-4 md:mt-0 md:ml-4">
|
|
||||||
<div class="text-2xl font-bold">
|
|
||||||
{{ if $data.about.title }}{{$data.about.title}}{{else}}You can put
|
|
||||||
text in data/home/about.toml/title{{end}}
|
|
||||||
</div>
|
|
||||||
<div class="text-lg mt-3">
|
|
||||||
<div>
|
|
||||||
{{ if $data.about.text}}{{ replace $data.about.text "\n" "<br />" | safeHTML }}
|
|
||||||
{{else}}You can put text in
|
|
||||||
data/home/about.toml/text{{end}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section id="skills" class="mt-12">
|
|
||||||
<div class="md:flex justify-center">
|
|
||||||
{{ partial "home/homeTitle" (dict "title" "Skills") }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{if $data.skills.list}}
|
|
||||||
<div
|
|
||||||
class="mt-8 grid grid-flow-row grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"
|
|
||||||
>
|
|
||||||
{{ range $data.skills.list }}
|
|
||||||
<div class="w-full rounded overflow-hidden shadow-lg">
|
|
||||||
<div class="">
|
|
||||||
<div class="font-bold text-xl mb-2 py-2 px-6 bg-gray-500">
|
|
||||||
<div class="flex">
|
|
||||||
<img
|
|
||||||
src="{{ .icon }}"
|
|
||||||
width="50px"
|
|
||||||
class="bg-gray-300 py-1 px-1 rounded-full"
|
|
||||||
/>
|
|
||||||
<div class="my-auto ml-2">
|
|
||||||
{{ .name }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p class="text-gray-700 text-base px-6 pb-4">
|
|
||||||
{{ replace .text "\n" "<br />" | safeHTML }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
{{else}}
|
|
||||||
<div class="mt-4 text-xl text-center">Skills don't exist</div>
|
|
||||||
{{end}}
|
|
||||||
</section>
|
|
||||||
<section id="projects" class="mt-12">
|
|
||||||
<div class="md:flex justify-center">
|
|
||||||
{{ partial "home/homeTitle" (dict "title" "Projects") }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{if $data.skills.list}}
|
|
||||||
<div
|
|
||||||
class="mt-8 grid grid-flow-row grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"
|
|
||||||
>
|
|
||||||
{{ range $data.project.list }}
|
|
||||||
<div class="w-full rounded overflow-hidden shadow-lg">
|
|
||||||
<a href="{{ .url }}" target="_blank">
|
|
||||||
<img
|
|
||||||
class="w-full h-48"
|
|
||||||
src="{{ .image }}"
|
|
||||||
alt="Sunset in the mountains"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
<div class="px-6 py-4">
|
|
||||||
<div class="font-bold text-xl mb-2">{{ .title }}</div>
|
|
||||||
<p class="text-gray-700 text-base">
|
|
||||||
{{ .text }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
{{else}}
|
|
||||||
<div class="mt-4 text-xl text-center">Projects does not exist</div>
|
|
||||||
{{end}}
|
|
||||||
</section>
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
{{ $data := .Site.Data.home }}
|
||||||
|
|
||||||
|
<section id="about" class="md:flex justify-around">
|
||||||
|
<div class="my-auto md:mr-4">
|
||||||
|
{{ partial "home/homeTitle" (dict "title" "About Me") }}
|
||||||
|
|
||||||
|
<div class="flex mt-3 gap-3 text-xl">
|
||||||
|
{{ range $data.about.link }}
|
||||||
|
<a href="{{.url}}"><i class="{{ .icon }}"></i></a>{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-4 md:mt-0 md:ml-4">
|
||||||
|
|
||||||
|
<div class="text-2xl font-bold">
|
||||||
|
{{ if $data.about.title }}
|
||||||
|
{{$data.about.title}}
|
||||||
|
{{else}}
|
||||||
|
You can put text in data/home/about.toml/title
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="text-lg mt-3">
|
||||||
|
{{ if $data.about.text}}
|
||||||
|
{{ replace $data.about.text "\n" "<br />" | safeHTML }}
|
||||||
|
{{else}}
|
||||||
|
You can put text in data/home/about.toml/text
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
|
@ -0,0 +1,39 @@
|
||||||
|
{{ $data := .Site.Data.home }}
|
||||||
|
|
||||||
|
<section id="skills" class="mt-12">
|
||||||
|
<div class="md:flex justify-center">
|
||||||
|
{{ partial "home/homeTitle" (dict "title" "Skills") }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{if $data.skills.list}}
|
||||||
|
<div class="mt-8 grid grid-flow-row grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4" >
|
||||||
|
|
||||||
|
{{ range $data.skills.list }}
|
||||||
|
<div class="w-full rounded overflow-hidden shadow-lg">
|
||||||
|
<div class="">
|
||||||
|
<div class="font-bold text-xl mb-2 py-2 px-6 bg-gray-500">
|
||||||
|
<div class="flex">
|
||||||
|
<img
|
||||||
|
src="{{ .icon }}"
|
||||||
|
width="50px"
|
||||||
|
class="bg-gray-300 py-1 px-1 rounded-full"
|
||||||
|
/>
|
||||||
|
<div class="my-auto ml-2">
|
||||||
|
{{ .name }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="text-gray-700 text-base px-6 pb-4">
|
||||||
|
{{ replace .text "\n" "<br />" | safeHTML }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{else}}
|
||||||
|
<div class="mt-4 text-xl text-center">Skills don't exist</div>
|
||||||
|
{{end}}
|
||||||
|
</section>
|
|
@ -0,0 +1,32 @@
|
||||||
|
{{ $data := .Site.Data.home }}
|
||||||
|
|
||||||
|
<section id="projects" class="mt-12">
|
||||||
|
<div class="md:flex justify-center">
|
||||||
|
{{ partial "home/homeTitle" (dict "title" "Projects") }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{if $data.skills.list}}
|
||||||
|
<div class="mt-8 grid grid-flow-row grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||||
|
{{ range $data.project.list }}
|
||||||
|
<div class="w-full rounded overflow-hidden shadow-lg">
|
||||||
|
<a href="{{ .url }}" target="_blank">
|
||||||
|
<img
|
||||||
|
class="w-full h-48"
|
||||||
|
src="{{ .image }}"
|
||||||
|
alt="Sunset in the mountains"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<div class="px-6 py-4">
|
||||||
|
<div class="font-bold text-xl mb-2">{{ .title }}</div>
|
||||||
|
<p class="text-gray-700 text-base">
|
||||||
|
{{ .text }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{else}}
|
||||||
|
<div class="mt-4 text-xl text-center">Projects does not exist</div>
|
||||||
|
{{end}}
|
||||||
|
</section>
|
File diff suppressed because one or more lines are too long
|
@ -761,14 +761,14 @@ ul {
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pb-4 {
|
|
||||||
padding-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pl-4 {
|
.pl-4 {
|
||||||
padding-left: 1rem;
|
padding-left: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pb-4 {
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
.text-center {
|
.text-center {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
@ -792,6 +792,11 @@ ul {
|
||||||
line-height: 1.75rem;
|
line-height: 1.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-3xl {
|
||||||
|
font-size: 1.875rem;
|
||||||
|
line-height: 2.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
.text-2xl {
|
.text-2xl {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
line-height: 2rem;
|
line-height: 2rem;
|
||||||
|
@ -807,11 +812,6 @@ ul {
|
||||||
line-height: 1.5rem;
|
line-height: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-3xl {
|
|
||||||
font-size: 1.875rem;
|
|
||||||
line-height: 2.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.font-bold {
|
.font-bold {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue