mirror of
https://github.com/danbee/danbarber.me.hugo.git
synced 2025-03-04 08:59:18 +00:00
Compare commits
5 Commits
71a5ff3929
...
c3cb433f73
| Author | SHA1 | Date | |
|---|---|---|---|
| c3cb433f73 | |||
| edb92a7550 | |||
| d256b37b57 | |||
| 8e12a5f486 | |||
| 4698cd6e9c |
9
assets/sass/components/_home.scss
Normal file
9
assets/sass/components/_home.scss
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
.home__about,
|
||||||
|
.home__photos,
|
||||||
|
.home__blog {
|
||||||
|
margin-top: 8vmin;
|
||||||
|
}
|
||||||
|
|
||||||
|
.home__more {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
29
assets/sass/components/_logo.scss
Normal file
29
assets/sass/components/_logo.scss
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
$_desaturate_amount: 35%;
|
||||||
|
|
||||||
|
$_color_1: desaturate(#ff6800, $_desaturate_amount);
|
||||||
|
$_color_2: desaturate(#e8ff00, $_desaturate_amount);
|
||||||
|
$_color_3: desaturate(#00a9ff, $_desaturate_amount);
|
||||||
|
$_color_4: desaturate(#b346e2, $_desaturate_amount);
|
||||||
|
|
||||||
|
.logo__wrapper {
|
||||||
|
width: 7rem;
|
||||||
|
line-height: 0;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo__color_1 {
|
||||||
|
fill: $_color_1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo__color_2 {
|
||||||
|
fill: $_color_2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo__color_3 {
|
||||||
|
fill: $_color_3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo__color_4 {
|
||||||
|
fill: $_color_4;
|
||||||
|
}
|
||||||
|
|
||||||
@ -1,6 +1,7 @@
|
|||||||
.post {
|
.post {
|
||||||
border-bottom: 1px dashed $border-color;
|
border-bottom: 1px dashed $border-color;
|
||||||
padding: 1.5em $pad-min;
|
margin-top: 2em;
|
||||||
|
padding-bottom: 1.5em;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|||||||
@ -6,3 +6,11 @@
|
|||||||
border-bottom: 1px dashed $text-color-dark;
|
border-bottom: 1px dashed $text-color-dark;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.site-header__container {
|
||||||
|
@include container;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-header__home-link {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
blockquote {
|
blockquote {
|
||||||
padding-left: 2rem;
|
padding-left: 2rem;
|
||||||
border-left: 3px solid $text-color-light;
|
border-left: 3px solid $text-color-light;
|
||||||
|
margin: 1em 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,14 +28,17 @@
|
|||||||
// 5. Objects – class-based selectors which define undecorated design patterns,
|
// 5. Objects – class-based selectors which define undecorated design patterns,
|
||||||
// for example media object known from OOCSS
|
// for example media object known from OOCSS
|
||||||
@import "objects/container";
|
@import "objects/container";
|
||||||
|
@import "objects/outer";
|
||||||
|
|
||||||
// 6. Components – specific UI components.
|
// 6. Components – specific UI components.
|
||||||
// This is where majority of our work takes place and our UI components
|
// This is where majority of our work takes place and our UI components
|
||||||
// are often composed of Objects and Components
|
// are often composed of Objects and Components
|
||||||
@import "components/site-header";
|
@import "components/site-header";
|
||||||
|
@import "components/home";
|
||||||
@import "components/posts";
|
@import "components/posts";
|
||||||
@import "components/post";
|
@import "components/post";
|
||||||
@import "components/photos";
|
@import "components/photos";
|
||||||
|
@import "components/logo";
|
||||||
|
|
||||||
// 7. Utilities – utilities and helper classes with ability to override
|
// 7. Utilities – utilities and helper classes with ability to override
|
||||||
// anything which goes before in the triangle, eg. hide helper class
|
// anything which goes before in the triangle, eg. hide helper class
|
||||||
|
|||||||
3
assets/sass/objects/_outer.scss
Normal file
3
assets/sass/objects/_outer.scss
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.outer {
|
||||||
|
padding: 0 $pad-min;
|
||||||
|
}
|
||||||
7
content/_index.md
Normal file
7
content/_index.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
date: '2019-10-16'
|
||||||
|
---
|
||||||
|
|
||||||
|
Hi, my name is Dan Barber. I’m a web designer and developer in New York.
|
||||||
|
I design and build standards compliant websites that are simple, usable and
|
||||||
|
attractive using open source software technologies.
|
||||||
@ -1,3 +0,0 @@
|
|||||||
{{ define "main" }}
|
|
||||||
<h1>Foo</h1>
|
|
||||||
{{ end }}
|
|
||||||
45
layouts/index.html
Normal file
45
layouts/index.html
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
{{ define "main" }}
|
||||||
|
<section class="home__about outer">
|
||||||
|
<article class="container">
|
||||||
|
{{ .Content }}
|
||||||
|
</article>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="home__photos outer">
|
||||||
|
<article class="container">
|
||||||
|
<header>
|
||||||
|
<h2>Latest Photos</h2>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="photos__container">
|
||||||
|
{{ range first 3 (where .Site.RegularPages "Section" "photos") }}
|
||||||
|
<article class="photos__thumb-container">
|
||||||
|
{{ partial "photo_thumb.html" . }}
|
||||||
|
</article>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<footer class="home__more">
|
||||||
|
<p><a href="/photos">All Photos →</a></p>
|
||||||
|
</footer>
|
||||||
|
</article>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="home__blog">
|
||||||
|
<article>
|
||||||
|
<header class="outer">
|
||||||
|
<div class="container">
|
||||||
|
<h2>From the Blog</h2>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
{{ range first 3 (where .Site.RegularPages "Section" "blog") }}
|
||||||
|
{{ partial "blog_post_summary.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
<footer class="container home__more">
|
||||||
|
<p><a href="/blog">More →</a></p>
|
||||||
|
</footer>
|
||||||
|
</article>
|
||||||
|
</section>
|
||||||
|
{{ end }}
|
||||||
17
layouts/partials/blog_post_summary.html
Normal file
17
layouts/partials/blog_post_summary.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<article class="post outer">
|
||||||
|
<header>
|
||||||
|
<div class="container">
|
||||||
|
<h3 class="post__title"><a href="{{.Permalink}}">{{.Title}}</a></h3>
|
||||||
|
|
||||||
|
<p class="post__date">{{.Date.Format "Jan 2, 2006"}}</p>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
{{ if .Truncated }}
|
||||||
|
{{.Summary}}
|
||||||
|
|
||||||
|
<p class="post__read-more"><a href="{{.Permalink}}">Read on →</a></p>
|
||||||
|
{{ else }}
|
||||||
|
{{.Content}}
|
||||||
|
{{ end }}
|
||||||
|
</article>
|
||||||
@ -1,5 +1,7 @@
|
|||||||
<header class="site-header" role="banner">
|
<header class="site-header" role="banner">
|
||||||
<div class="container">
|
<div class="site-header__container">
|
||||||
<h1>{{.Site.Title}}</h1>
|
<h1 class="logo__wrapper">
|
||||||
|
<a class="site-header__home-link" href="/">{{ partial "logo.svg" . }}</a>
|
||||||
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
1
layouts/partials/logo.svg
Normal file
1
layouts/partials/logo.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 36 KiB |
@ -1,22 +1,8 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<section class="posts">
|
<section class="posts">
|
||||||
{{ range .Paginator.Pages }}
|
{{ range .Paginator.Pages }}
|
||||||
<article class="post">
|
{{ partial "blog_post_summary.html" . }}
|
||||||
<header>
|
{{ end }}
|
||||||
<h3 class="post__title"><a href="{{.Permalink}}">{{.Title}}</a></h3>
|
|
||||||
|
|
||||||
<p class="post__date">{{.Date.Format "Jan 2, 2006"}}</p>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
{{ if .Truncated }}
|
|
||||||
{{.Summary}}
|
|
||||||
|
|
||||||
<p class="post__read-more"><a href="{{.Permalink}}">Read on →</a></p>
|
|
||||||
{{ else }}
|
|
||||||
{{.Content}}
|
|
||||||
{{ end }}
|
|
||||||
</article>
|
|
||||||
{{ end }}
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="posts__pagination">
|
<section class="posts__pagination">
|
||||||
|
|||||||
@ -324,7 +324,8 @@ a {
|
|||||||
|
|
||||||
blockquote {
|
blockquote {
|
||||||
padding-left: 2rem;
|
padding-left: 2rem;
|
||||||
border-left: 3px solid #a6a6a6; }
|
border-left: 3px solid #a6a6a6;
|
||||||
|
margin: 1em 0; }
|
||||||
|
|
||||||
figure {
|
figure {
|
||||||
margin: 1em 0; }
|
margin: 1em 0; }
|
||||||
@ -369,6 +370,9 @@ pre {
|
|||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
max-width: 40rem; }
|
max-width: 40rem; }
|
||||||
|
|
||||||
|
.outer {
|
||||||
|
padding: 0 6.5%; }
|
||||||
|
|
||||||
.site-header {
|
.site-header {
|
||||||
padding: 0 6.5%;
|
padding: 0 6.5%;
|
||||||
border-bottom: 1px dashed #333; }
|
border-bottom: 1px dashed #333; }
|
||||||
@ -376,6 +380,22 @@ pre {
|
|||||||
.site-header {
|
.site-header {
|
||||||
border-bottom: 1px dashed #ddd; } }
|
border-bottom: 1px dashed #ddd; } }
|
||||||
|
|
||||||
|
.site-header__container {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
max-width: 40rem; }
|
||||||
|
|
||||||
|
.site-header__home-link {
|
||||||
|
color: inherit; }
|
||||||
|
|
||||||
|
.home__about,
|
||||||
|
.home__photos,
|
||||||
|
.home__blog {
|
||||||
|
margin-top: 8vmin; }
|
||||||
|
|
||||||
|
.home__more {
|
||||||
|
text-align: right; }
|
||||||
|
|
||||||
.posts__pagination {
|
.posts__pagination {
|
||||||
padding: 1em 6.5%; }
|
padding: 1em 6.5%; }
|
||||||
|
|
||||||
@ -394,7 +414,8 @@ pre {
|
|||||||
|
|
||||||
.post {
|
.post {
|
||||||
border-bottom: 1px dashed #ccc;
|
border-bottom: 1px dashed #ccc;
|
||||||
padding: 1.5em 6.5%; }
|
margin-top: 2em;
|
||||||
|
padding-bottom: 1.5em; }
|
||||||
.post img {
|
.post img {
|
||||||
max-width: 100%; }
|
max-width: 100%; }
|
||||||
.post > * {
|
.post > * {
|
||||||
@ -431,3 +452,20 @@ pre {
|
|||||||
.photos__thumb {
|
.photos__thumb {
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
width: 100%; }
|
width: 100%; }
|
||||||
|
|
||||||
|
.logo__wrapper {
|
||||||
|
width: 7rem;
|
||||||
|
line-height: 0;
|
||||||
|
margin-bottom: 1em; }
|
||||||
|
|
||||||
|
.logo__color_1 {
|
||||||
|
fill: #d2702d; }
|
||||||
|
|
||||||
|
.logo__color_2 {
|
||||||
|
fill: #c3d22d; }
|
||||||
|
|
||||||
|
.logo__color_3 {
|
||||||
|
fill: #2d9ad2; }
|
||||||
|
|
||||||
|
.logo__color_4 {
|
||||||
|
fill: #a46bbd; }
|
||||||
|
|||||||
24
scripts/fix_images
Executable file
24
scripts/fix_images
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
|
require "date"
|
||||||
|
require "fileutils"
|
||||||
|
require "front_matter_parser"
|
||||||
|
|
||||||
|
unsafe_yaml_loader = ->(string) { YAML.load(string) }
|
||||||
|
|
||||||
|
Dir.glob("content/photos/**/*.md").each do |file|
|
||||||
|
parsed_file = FrontMatterParser::Parser.
|
||||||
|
parse_file(file, loader: unsafe_yaml_loader)
|
||||||
|
|
||||||
|
image = parsed_file["image"].split("/").last
|
||||||
|
|
||||||
|
new_content = <<~CONTENT
|
||||||
|
#{parsed_file.front_matter.merge("image" => image).to_yaml}---
|
||||||
|
|
||||||
|
#{parsed_file.content}
|
||||||
|
CONTENT
|
||||||
|
|
||||||
|
File.open(file, "w") do |new_file|
|
||||||
|
new_file.write(new_content)
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Reference in New Issue
Block a user