From 3fca1185b04bc8579fba859d463787484bee2f25 Mon Sep 17 00:00:00 2001 From: John Janus Date: Tue, 1 Feb 2022 00:33:23 +0100 Subject: [PATCH 1/1] first commit with some content --- .gitignore | 1 + config.toml | 22 +++++ content/_index.md | 9 ++ content/blog/_index.md | 5 + content/blog/first.md | 82 ++++++++++++++++ content/blog/second.md | 7 ++ content/programming/Qt C++/_index.md | 4 + content/programming/_index.md | 5 + .../rust/001 - Linked List 01/index.md | 11 +++ content/programming/rust/_index.md | 4 + sass/main.scss | 94 +++++++++++++++++++ templates/base.html | 30 ++++++ templates/index.html | 6 ++ templates/page.html | 16 ++++ templates/section.html | 25 +++++ 15 files changed, 321 insertions(+) create mode 100644 .gitignore create mode 100644 config.toml create mode 100644 content/_index.md create mode 100644 content/blog/_index.md create mode 100644 content/blog/first.md create mode 100644 content/blog/second.md create mode 100644 content/programming/Qt C++/_index.md create mode 100644 content/programming/_index.md create mode 100644 content/programming/rust/001 - Linked List 01/index.md create mode 100644 content/programming/rust/_index.md create mode 100644 sass/main.scss create mode 100644 templates/base.html create mode 100644 templates/index.html create mode 100644 templates/page.html create mode 100644 templates/section.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..364fdec --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +public/ diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..40a6304 --- /dev/null +++ b/config.toml @@ -0,0 +1,22 @@ +# The URL the site will be built for +base_url = "https://blog.johnzone.org" +title = "Johns Blog" +description = "Yet another useless blog" +generate_feed = true +default_language = "de" + +# Whether to automatically compile all Sass files in the sass directory +compile_sass = true + +# Whether to build a search index to be used later on by a JavaScript library +build_search_index = false + +[markdown] +# Whether to do syntax highlighting +# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola +highlight_code = true +highlight_theme = "gruvbox-dark" +render_emoji = true + +[extra] +# Put all your custom variables here diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..1b0b8aa --- /dev/null +++ b/content/_index.md @@ -0,0 +1,9 @@ ++++ +title = "Willkommen" ++++ +# Neues Design und Framework + +Wordpress war wohl etwas Overkill. +Ich versuche es jetzt mal mit [Zola](https://getzola.org). +Unter [Blog](blog) wird der neue Inhalt zu finden sein. +Der andere Qutsch kommt auch noch. diff --git a/content/blog/_index.md b/content/blog/_index.md new file mode 100644 index 0000000..c75534e --- /dev/null +++ b/content/blog/_index.md @@ -0,0 +1,5 @@ ++++ +title = "Blog" +sort_by = "date" ++++ +Blogeinträge. diff --git a/content/blog/first.md b/content/blog/first.md new file mode 100644 index 0000000..44076ec --- /dev/null +++ b/content/blog/first.md @@ -0,0 +1,82 @@ ++++ +title = "Hello World Title" +date = 2021-10-24 ++++ +# My first entry!! + +Testing code highlighting: + + +```rust,linenos +use std::rc::Rc; + +pub struct LinkedList +where + T: Copy, +{ + head: Option>>, + tail: Option>>, +} + +struct Node +where + T: Copy, +{ + data: T, + prev: Option>>, + next: Option>>, +} + +impl Node +where + T: Copy, +{ + fn new(data: T) -> Self { + Node { + data: data, + prev: None, + next: None, + } + } +} + + +impl LinkedList +where + T: Copy, +{ + pub fn new() -> Self { + LinkedList { + head: None, + tail: None, + } + } + + pub fn push_back(&mut self, data: T) { + let mut node = Node::new(data); + if self.head.is_none() { + let noderef = Rc::new(node); + self.head = Some(noderef.clone()); + self.tail = Some(noderef.clone()); + return; + } + node.prev = Some(self.tail.as_ref().unwrap().clone()); + self.tail = Some(Rc::new(node)); + } + + pub fn pop(&mut self) -> Option { + if self.tail.is_none() { + return None; + } + let value = self.tail.as_ref().unwrap().clone(); + if value.prev.is_some() { + let mut prev = value.prev.as_ref().unwrap(); + prev.deref().next = None; + self.tail = Some(prev.clone()); + } else { + self.tail = None; + } + Some(value.data) + } +} +``` diff --git a/content/blog/second.md b/content/blog/second.md new file mode 100644 index 0000000..11e50bf --- /dev/null +++ b/content/blog/second.md @@ -0,0 +1,7 @@ ++++ +title = "Second" +date = 2022-01-31 ++++ + +Dies ist der zweite Artikel, um zu testen, ob das einigermaßen gut aussieht... + diff --git a/content/programming/Qt C++/_index.md b/content/programming/Qt C++/_index.md new file mode 100644 index 0000000..b3dd798 --- /dev/null +++ b/content/programming/Qt C++/_index.md @@ -0,0 +1,4 @@ ++++ +title = "Qt and C++" +sort_by = "title" ++++ diff --git a/content/programming/_index.md b/content/programming/_index.md new file mode 100644 index 0000000..6ffce4a --- /dev/null +++ b/content/programming/_index.md @@ -0,0 +1,5 @@ ++++ +title = "Programmieren" +sort_by = "weight" ++++ +Hier werden nach Sprachen sortiert einige snippets und Helferlein erscheinen, die ich zum Lernen oder zum Gebrauch geschrieben habe diff --git a/content/programming/rust/001 - Linked List 01/index.md b/content/programming/rust/001 - Linked List 01/index.md new file mode 100644 index 0000000..9d528a4 --- /dev/null +++ b/content/programming/rust/001 - Linked List 01/index.md @@ -0,0 +1,11 @@ ++++ +title = "001 - Linked List 01" +date = "2022-01-31" ++++ +Um etwas rust zu lernen, versuche ich eine vermeintlich leichte Übung. +Eine doppelt verkettete Liste mit mindestens push- und pop-Operationen an beiden Enden. + + +Dies gestaltet sich in rust etwas schwerer als erwartet, da nur an einer Stelle geschrieben werden kann, +wenn an keiner Stelle mehr gelesen werden kann. Es müssen also die Verknüpfungen zu den Nachbarnodes +in Smartpointern abgelegt werden. diff --git a/content/programming/rust/_index.md b/content/programming/rust/_index.md new file mode 100644 index 0000000..bef062f --- /dev/null +++ b/content/programming/rust/_index.md @@ -0,0 +1,4 @@ ++++ +title = "rust" +sort_by = "title" ++++ diff --git a/sass/main.scss b/sass/main.scss new file mode 100644 index 0000000..a83b85b --- /dev/null +++ b/sass/main.scss @@ -0,0 +1,94 @@ +html, body { + color: white; + background-color: black; + height: 100%; + //padding: 0; + margin: 0; +} + + +body { + display: flex; + flex-direction: column; + //margin: 0 16px; + padding: 0 16px; + +} + +header { + flex-grow: 0; + flex-shrink: 0; +} +main { + flex-grow: 1; +} + +footer { + flex: 0 0 80px; +} + +nav#main { + display: flex; + justify-content: left; + flex-direction: row; + background-color: fuchsia; + padding: 4px 10px; +} +nav#main a { + background-color: aqua; + padding: 4px; + margin: 2px 16px; + color: black; +} + +article { + background-color: darkslategray; + height: 100%; +} + +article.card { + box-shadow: 0 4px 8px 10px rgba(255,0,255,0.2); + transition: 0.3s; + border-radius: 5px; /* 5px rounded corners */ + padding: 4px 16px; + margin: 24px; + background-color: darkslategray; + width: 20%; +} + +/* On mouse-over, add a deeper shadow */ +article.card:hover { + box-shadow: 0 8px 16px 20px rgba(255,0,255,0.2); +} + +article.card h3 { + background-color: fuchsia; + padding: 4px 8px; +} + +article.card time { + font-size: 10px; +} + +article.card div { + //background-color: dark-grey; +} + +a.nav { + margin: 2px 8px; +} + +.subsections { + display: flex; + flex-wrap: wrap; + flex-direction: row; + justify-content: left; + background-color: crimson; + padding: 4px 10px; +} + +.overview { + display: flex; + flex-wrap: wrap; + justify-content: space-around; +} diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..dfaa89d --- /dev/null +++ b/templates/base.html @@ -0,0 +1,30 @@ + + + + + + Johns Zolatest + + +
+

Johns Site - base

+ +
+
+ {% block content %}{% endblock %} +
+ +
+ foot +
+ + diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..47950a1 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,6 @@ +{% extends "base.html" %} + +{% block content %} +

{{ section.title }}

+{{ section.content | safe }} +{% endblock %} diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..187fbed --- /dev/null +++ b/templates/page.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} + +{% block content %} +
+{% set section = get_section(path=page.ancestors | last) %} +<{{ section.title }}  + +

{{ page.title }}

+ +

{{ page.content | safe }}

+
+{% endblock %} + +{% block aside %} +test +{% endblock %} diff --git a/templates/section.html b/templates/section.html new file mode 100644 index 0000000..064c5c1 --- /dev/null +++ b/templates/section.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} + +{% block content %} +

{{ section.title }}

+{% set p_section = get_section(path=section.ancestors | last) %} +<{{ p_section.title }}  +{% if section.subsections | length > 0 %} +
+ {% for sub in section.subsections %} + {% set subsection = get_section(path=sub) %} + {{ subsection.title }} + {% endfor %} +
+{% endif %} +
{{ section.content | safe}}
+
+ {% for page in section.pages %} +
+ +

{{ page.title }}

+
{{ page.summary | safe }}
+
+ {% endfor %} +
+{% endblock %} -- 2.47.0