feat: added main header and hotlinks

master
EvilMuffinHa 2022-05-07 02:01:48 -04:00
commit 0b09faee82
6 changed files with 250 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.swp
public/*

40
config.toml Normal file
View File

@ -0,0 +1,40 @@
base_url = "http://127.0.0.1:1111"
title = "Dawn Theme"
compile_sass = false
build_search_index = true
[markdown]
highlight_code = true
[extra]
# Optional - Sets the colorscheme based on base16: base00 is used for the background.
#base00 = "#faf4ed"
# Optional - Sets the colorscheme based on base16: base05 is used for the foreground text.
#base05 = "#575279"
# Optional - Sets the colorscheme based on base16: base0d is used for unvisited links.
#base0d = "#286983"
# Optional - Sets the colorscheme based on base16: base0e is used for visited links.
#base0e = "#907aa9"
# Optional - Sets the mimetype of the favicon.
#favicon_mimetype = "image/png"
# Optional - Set the favicon.
#favicon = "/favicon.png"
# Optional - Sets the text displayed as the title to be different. Default title is "Dawn Theme"
#title_text = "Dawn Theme"
# Required - Menu options for the hotlinks under the title.
menu = [
{ name = "tags", url = "$BASE_URL/tags" },
{ name = "archive", url = "$BASE_URL/archive" },
{ name = "about me", url = "$BASE_URL/about" }
]

4
content/_index.md Normal file
View File

@ -0,0 +1,4 @@
+++
paginate_by = 2
sort_by = "date"
+++

60
content/showcase.md Normal file
View File

@ -0,0 +1,60 @@
+++
title = "Dawn Showcase"
date = 2022-04-18
[taxonomies]
tags = ["zola", "theme", "showcase"]
+++
Hi! This is a Showcase of the `Dawn` theme.
# Code:
```rust
use std::error::Error;
#[derive(Debug)]
struct Test {
pub lang: String,
pub content: String
}
fn main() -> Result<(), Box<dyn Error>> {
let a = Test {
lang: "en".to_string(),
content: "content".to_string()
};
println!("{:?}", a);
Ok(())
}
```
## Inline
`print("Hi")`
### Typography
*Italic*, **Bold**, _**Italic Bold**_, [link](#)
#### Quote
> Helo
# Lists
- A
- B
1. a
2. b
3. c
---
fin post summary
<!-- more -->
Next part

BIN
static/UtsukushiMincho.ttf Normal file

Binary file not shown.

144
templates/index.html Normal file
View File

@ -0,0 +1,144 @@
<!-- vim: set ft=html: -->
<!--
base00
base05
favicon_mimetype
favicon
title_text
-->
<!DOCTYPE HTML>
<html lang="{%- if config.default_language -%}{{ config.default_language }}{%- else -%}en{%- endif -%}">
<head>
<title>{%- block title %}{{ config.title }}{% endblock title -%}</title>
{%- if config.generate_rss %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="rss.xml") | safe }}">
{%- endif %}
{%- if config.extra.favicon %}
<link rel="shortcut icon" type="{{ config.extra.favicon_mimetype | default(value="image/x-icon") }}" href="{{ config.extra.favicon | safe }}">
{%- endif %}
{%- block extra_head %}
{%- endblock extra_head %}
<style>
@font-face {
font-family: "UtsukushiMincho";
src: url(UtsukushiMincho.ttf);
}
body {
font-family: UtsukushiMincho;
{%- if config.extra.base00 %}
background-color: {{ config.extra.base00 }};
{% else %}
background-color: #faf4ed;
{% endif -%}
{%- if config.extra.base05 %}
color: {{ config.extra.base05 }};
{% else %}
color: #575279;
{% endif -%}
display: flex;
justify-content: center;
}
.header_title {
font-weight: bolder;
font-size: 2.5rem;
}
.header {
width: 50%;
margin-top: 7rem;
padding-top: 1rem;
padding-left: 1rem;
padding-bottom: 1.5rem;
border-radius: 5px;
{%- if config.extra.base00 %}
border: solid {{ config.extra.base00 }};
{% else %}
border: solid #575279;
{% endif -%}
}
.menu_inner {
list-style: none;
margin: 0;
font-weight: bold;
font-size: 1.2rem;
padding: 0.1rem;
padding-top: 0.5rem;
padding-left: 0.3rem;
display: flex;
flex-wrap: wrap;
}
.menu_list {
margin-right: 20px;
}
.menu_item {
{%- if config.extra.base0d %}
color: {{ config.extra.base0d }};
{% else %}
color: #286983;
{% endif -%}
}
.menu_item:visited {
{%- if config.extra.base0e %}
color: {{ config.extra.base0e }};
{% else %}
color: #907aa9;
{% endif -%}
}
</style>
</head>
<body>
{% block header %}
<div class="header">
<div class="header_title">
{% block title_content %}
{%- if config.extra.title_text %}
{{ config.extra.title_text }}
{% elif config.title %}
{{ config.title }}
{% else %}
Dawn Theme
{% endif -%}
{% endblock title_content %}
</div>
{% block header_menu %}
<div class="header_menu">
<nav class="header_nav">
<ul class="menu_inner">
{% for item in config.extra.menu %}
<li class = "menu_list">
<a class = "menu_item" href="{{ item.url | replace(from="$BASE_URL", to=config.base_url) }}">
{{ item.name }}
</a>
</li>
{% endfor %}
</ul>
</nav>
</div>
{% endblock header_menu %}
</div>
{% endblock header %}
</body>
</html>