diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2023-11-01 21:02:09 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2023-11-01 21:02:09 +0100 |
commit | 6d3b8739287f8f1c89211b1c785342c2ce9050f5 (patch) | |
tree | 1b74e6c498cfa0bb12cdad10703b76e8303a71a5 | |
parent | ef15a6ec8f14c2398cfd28786c83072888690718 (diff) |
-rw-r--r-- | config.toml | 4 | ||||
-rw-r--r-- | content/blog/_index.md | 1 | ||||
-rwxr-xr-x | deploy.sh | 2 | ||||
-rw-r--r-- | sass/_typography.scss | 6 | ||||
-rw-r--r-- | sass/theme.scss | 73 | ||||
-rw-r--r-- | templates/404.html | 13 | ||||
-rw-r--r-- | templates/base.html | 20 | ||||
-rw-r--r-- | templates/blog-article.html | 22 | ||||
-rw-r--r-- | templates/blog.html | 49 | ||||
-rw-r--r-- | templates/index.html | 34 | ||||
-rw-r--r-- | templates/page.html | 11 | ||||
-rw-r--r-- | templates/tags/list.html | 21 | ||||
-rw-r--r-- | templates/tags/single.html | 20 | ||||
-rw-r--r-- | templates/taxonomy_list.html | 7 | ||||
-rw-r--r-- | templates/taxonomy_single.html | 13 |
15 files changed, 253 insertions, 43 deletions
diff --git a/config.toml b/config.toml index 5a67b9f..8605f97 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,8 @@ base_url = "https://stevenlr.com" +title = "Steven Le Rouzic" +description = "Programming, graphics, and more" compile_sass = true -build_search_index = true +build_search_index = false generate_feed = true feed_filename = "rss.xml" taxonomies = [ diff --git a/content/blog/_index.md b/content/blog/_index.md index 7357281..6249033 100644 --- a/content/blog/_index.md +++ b/content/blog/_index.md @@ -3,4 +3,5 @@ title = "Blog" sort_by = "date"
template = "blog.html"
page_template = "blog-article.html"
+paginate_by = 5
+++
diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..cbd0191 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,2 @@ +rsync -avzr --delete -e "ssh -i ~/.ssh/stevenlr.com.pem -o StrictHostKeyChecking=no -p 22" public/ ubuntu@stevenlr.com:/var/www/html + diff --git a/sass/_typography.scss b/sass/_typography.scss index 9f67009..b6bdf6d 100644 --- a/sass/_typography.scss +++ b/sass/_typography.scss @@ -61,6 +61,12 @@ border-radius: 8px;
}
+ @media (prefers-color-scheme: dark) {
+ pre {
+ border: 1px solid var(--color-outline-variant);
+ }
+ }
+
ul {
list-style: square;
}
diff --git a/sass/theme.scss b/sass/theme.scss index c24d30b..a9fe693 100644 --- a/sass/theme.scss +++ b/sass/theme.scss @@ -27,6 +27,11 @@ hr { color: var(--color-on-background);
font-size: 32px;
font-family: "PT Serif Caption", serif;
+
+ a {
+ color: inherit;
+ text-decoration: none;
+ }
}
.info {
@@ -61,3 +66,71 @@ hr { }
}
+.pagination {
+ display: flex;
+ flex-direction: row;
+ gap: 16px;
+ font-size: 18px;
+ font-family: "PT Serif Caption", serif;
+ margin: 32px 0px;
+
+ a {
+ display: block;
+ color: var(--color-primary);
+ text-decoration: none;
+
+ &:hover {
+ opacity: 80%;
+ }
+ }
+}
+
+#footer {
+ border-top: 1px solid var(--color-outline-variant);
+ padding: 16px 0px;
+ margin-top: 24px;
+}
+
+#header {
+ margin-bottom: 24px;
+ padding: 20px 0px;
+ border-bottom: 1px solid var(--color-outline-variant);
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+
+ .title_desc {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+
+ .title a {
+ text-decoration: none;
+ color: var(--color-on-background);
+ font-size: 28px;
+ }
+
+ .description {
+ color: var(--color-on-surface-variant);
+ font-size: 16px;
+ }
+ }
+
+ .navigation {
+ display: flex;
+ flex-direction: row;
+
+ a {
+ display: block;
+ text-decoration: none;
+ color: var(--color-on-background);
+ padding: 8px 16px;
+ border-radius: 9999px;
+
+ &:hover {
+ background-color: var(--color-primary-container);
+ color: var(--color-on-primary-container);
+ }
+ }
+ }
+}
diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 0000000..d8f00d2 --- /dev/null +++ b/templates/404.html @@ -0,0 +1,13 @@ +{% extends "base.html" %}
+
+{% block title %}
+{{ config.title }}
+{% endblock %}
+
+{% block content %}
+
+<div class="article-header">
+ <h1>Page not found</h1>
+</div>
+
+{% endblock %}
diff --git a/templates/base.html b/templates/base.html index f3c81fb..09d787b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -2,15 +2,33 @@ <html>
<head>
<meta charset="utf-8" />
- <title>Steven Le Rouzic</title>
+ <title>{% block title %}{% endblock %}</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=PT+Serif&family=PT+Serif+Caption&family=Roboto+Mono&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{{ get_url(path="theme.css") }}" />
<script src="https://unpkg.com/htmx.org@1.9.6"></script>
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="rss.xml", trailing_slash=false) }}">
</head>
<body hx-boost="true">
+ <div id="header">
+ <div class="title_desc">
+ <p class="title"><a href="{{ get_url(path="@/_index.md") }}">{{ config.title }}</a></p>
+ <p class="description">{{ config.description }}</p>
+ </div>
+ <div style="flex-grow: 1;"></div>
+ <div class="navigation">
+ <a href="{{ get_url(path="@/blog/_index.md") }}">Blog</a>
+ {% set tags = get_taxonomy(kind="tags") %}
+ <a href="{{ tags.permalink | safe }}" class="secondary">Tags</a>
+ <a href="https://twitter.com/steven_lr">Twitter</a>
+ <a href="https://github.com/stevenlr">Github</a>
+ </div>
+ </div>
{% block content %}{% endblock %}
+ <div id="footer" class="typography">
+ <p>© Copyright {{ now() | date(format="%Y") }}, Steven Le Rouzic</p>
+ </div>
</body>
</html>
diff --git a/templates/blog-article.html b/templates/blog-article.html index ccdd019..52d054c 100644 --- a/templates/blog-article.html +++ b/templates/blog-article.html @@ -1,17 +1,21 @@ {% extends "base.html" %}
+{% block title %}
+{{ page.title }} - {{ config.title }}
+{% endblock %}
+
{% block content %}
<div class="article-header">
-<h1>{{ page.title }}</h1>
-<div class="info">
- <p class="date">{{ page.date | date(format="%B %-d, %Y") }}</p>
- <p class="tags">
- {% for tag in page.taxonomies["tags"] %}
- <a href="{{ get_taxonomy_url(kind="tags", name=tag) }}">#{{ tag }}</a>
- {%- endfor %}
- </p>
-</div>
+ <h1>{{ page.title }}</h1>
+ <div class="info">
+ <p class="date">{{ page.date | date(format="%B %-d, %Y") }}</p>
+ <p class="tags">
+ {% for tag in page.taxonomies["tags"] %}
+ <a href="{{ get_taxonomy_url(kind="tags", name=tag) }}">#{{ tag }}</a>
+ {%- endfor %}
+ </p>
+ </div>
</div>
<div class="typography">
diff --git a/templates/blog.html b/templates/blog.html index a0d2450..a955f42 100644 --- a/templates/blog.html +++ b/templates/blog.html @@ -1,11 +1,52 @@ {% extends "base.html" %}
+{% block title %}
+Blog - {{ config.title }}
+{% endblock %}
+
{% block content %}
-<ul>
-{% for page in section.pages %}
- <li><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - {{ page.date | date(format="%B %-d, %Y") }}</li>
+<div class="pagination">
+ <a href="{{ paginator.first }}">« First page</a>
+ {% if paginator.previous %}
+ <a href="{{ paginator.previous }}">‹ Previous page</a>
+ {% endif %}
+ <div style="flex-grow: 1;"></div>
+ {% if paginator.next %}
+ <a class="right" href="{{ paginator.next }}">› Next page</a>
+ {% endif %}
+ <a class="right" href="{{ paginator.last }}">Last page »</a>
+</div>
+
+{% for page in paginator.pages %}
+<div class="article-header">
+ <h1><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h1>
+ <div class="info">
+ <p class="date">{{ page.date | date(format="%B %-d, %Y") }}</p>
+ <p class="tags">
+ {% for tag in page.taxonomies["tags"] %}
+ <a href="{{ get_taxonomy_url(kind="tags", name=tag) }}">#{{ tag }}</a>
+ {%- endfor %}
+ </p>
+ </div>
+</div>
+<div class="typography">
+ {{ page.summary | safe }}
+ <p><a href="">Read more…</a></p>
+</div>
+{% if not loop.last %}<hr />{% endif %}
{% endfor %}
-</ul>
+
+<div class="pagination">
+ <a href="{{ paginator.first }}">« First page</a>
+ {% if paginator.previous %}
+ <a href="{{ paginator.previous }}">‹ Previous page</a>
+ {% endif %}
+ <div style="flex-grow: 1;"></div>
+ {% if paginator.next %}
+ <a class="right" href="{{ paginator.next }}">› Next page</a>
+ {% endif %}
+ <a class="right" href="{{ paginator.last }}">Last page »</a>
+</div>
{% endblock %}
diff --git a/templates/index.html b/templates/index.html index f8df5f9..865ed3f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,14 +1,38 @@ {% extends "base.html" %}
+{% block title %}
+{{ config.title }}
+{% endblock %}
+
{% block content %}
+<div class="pagination">
+ <a href="{{ get_url(path="@/blog/_index.md") }}">Go to blog</a>
+</div>
+
{% set blog_section = get_section(path="blog/_index.md") %}
-<ul>
-{% for post in blog_section.pages | slice(end=3) %}
- <li><a href="{{ post.permalink | safe }}">{{ post.title }}</a> - {{ post.date | date(format="%B %-d, %Y") }}</li>
- <div class="typography">{{ post.summary | safe }}</div>
+{% for page in blog_section.pages | slice(end=5) %}
+<div class="article-header">
+ <h1><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h1>
+ <div class="info">
+ <p class="date">{{ page.date | date(format="%B %-d, %Y") }}</p>
+ <p class="tags">
+ {% for tag in page.taxonomies["tags"] %}
+ <a href="{{ get_taxonomy_url(kind="tags", name=tag) }}">#{{ tag }}</a>
+ {%- endfor %}
+ </p>
+ </div>
+</div>
+<div class="typography">
+ {{ page.summary | safe }}
+ <p><a href="">Read more…</a></p>
+</div>
+{% if not loop.last %}<hr />{% endif %}
{% endfor %}
-</ul>
+
+<div class="pagination">
+ <a href="">Go to blog</a>
+</div>
{% endblock %}
diff --git a/templates/page.html b/templates/page.html index 0e5679f..fa23b99 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,9 +1,14 @@ {% extends "base.html" %}
-{% block content %}
+{% block title %}
+{{ page.title }} - {{ config.title }}
+{% endblock %}
-<h1>{{ page.title }}</h1>
+{% block content %}
-{{ page.content | safe }}
+<div class="typography">
+ <h1>{{ page.title }}</h1>
+ {{ page.content | safe }}
+</div>
{% endblock %}
diff --git a/templates/tags/list.html b/templates/tags/list.html new file mode 100644 index 0000000..c18899d --- /dev/null +++ b/templates/tags/list.html @@ -0,0 +1,21 @@ +{% extends "base.html" %}
+
+{% block title %}
+Tags - {{ config.title }}
+{% endblock %}
+
+{% block content %}
+
+<div class="article-header">
+ <h1>Tags</h1>
+</div>
+
+<div class="typography">
+ <ul>
+ {% for term in terms %}
+ <li><a href="{{ term.permalink | safe }}">{{ term.name }}</a> ({{ term.page_count }})</li>
+ {% endfor %}
+ </ul>
+</div>
+
+{% endblock %}
diff --git a/templates/tags/single.html b/templates/tags/single.html new file mode 100644 index 0000000..a08695c --- /dev/null +++ b/templates/tags/single.html @@ -0,0 +1,20 @@ +{% extends "base.html" %}
+
+{% block title %}
+{{ term.name }} - {{ config.title }}
+{% endblock %}
+
+{% block content %}
+
+<div class="article-header">
+ <h1>{{ term.name }}</h1>
+</div>
+<div class="typography">
+ <ul>
+ {% for page in term.pages %}
+ <li><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - {{ page.date | date(format="%B %-d, %Y") }}</li>
+ {% endfor %}
+ </ul>
+</div>
+
+{% endblock %}
diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html deleted file mode 100644 index df8f63f..0000000 --- a/templates/taxonomy_list.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends "base.html" %}
-
-{% block content %}
-
-<h1>{{ taxonomy.name }}: multiple</h1>
-
-{% endblock %}
diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html deleted file mode 100644 index 3a75df8..0000000 --- a/templates/taxonomy_single.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "base.html" %}
-
-{% block content %}
-
-<h1>{{ taxonomy.name }}: {{ term.name }}</h1>
-
-<ul>
-{% for page in term.pages %}
- <li><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - {{ page.date | date(format="%B %-d, %Y") }}</li>
-{% endfor %}
-</ul>
-
-{% endblock %}
|