A nightly toolchain is required because some cool features, like `intra_rustdoc_links` and `doc_cfg`, are still
unstable.
+
+# adding a blog post
+
+Add a markdown file to `content/blog/<year/<name>.md`. At the beginning of the file add the following header:
+
+```
+---
+title: "<post title>"
+description: "<post description>"
+author: "<author>"
+date: "<date in yyyy-mm-dd format>"
+tags: ["<tag1>", "<tag2>]
+hidden: true
+draft: false
+---
+
+```
+
+After that header you can type your post using markdown.
+
+The title will be shown on top of the page, together with the list of tags. The description won't be shown, it's only used
+in the HTML metadata, so if you want to show it, you will have to copy it as part of the content that comes after the header.
+
+If you need to add static data like pictures you can make a folder called `static/blog/<year>/<name>` and store everything you need in there.
# Change default color scheme with a variant one. Can be "red", "blue", "green".
themeVariant = "blue"
# Provide a list of custom css files to load relative from the `static/` folder in the site root.
-custom_css = ["css/style.css", "css/jsonview.css"]
+custom_css = ["css/style.css", "css/jsonview.css", "css/blog.css"]
+
+[permalinks]
+tags = "/blog/tags/:slug"
+author = "/blog/author/:slug"
+blog = "/blog/:year/:month/:title/"
+
+[taxonomies]
+tag = "tags"
+author = "author"
# render raw html
[markup.goldmark.renderer]
--- /dev/null
++++
+title = "Blog"
+weight = 1
+chapter = false
+pre = '<i class="fas fa-newspaper"></i> '
++++
+
+This blog is used to publish announcements, guides and more regarding the BDK project.
+Anybody can contribute by sending a pull request to our [GitHub repository](https://github.com/bitcoindevkit/bitcoindevkit.org).
+++
title = "REPL"
date = 2020-04-28T17:03:00+02:00
-weight = 1
+weight = 5
chapter = true
pre = '<i class="fas fa-terminal"></i> '
+++
--- /dev/null
+{{ partial "header.html" . }}
+
+{{ if eq .Kind "section" }}
+ {{ .Content }}
+{{end}}
+
+{{ range (where .Site.Pages "Type" "blog").GroupByDate "2006" }}
+ <h2>Posts in {{ .Key }}</h2>
+
+ {{ range where .Pages ".Kind" "!=" "section" }}
+ <h3 class="blog-post"><span class="date">{{ .Date.Format "Jan 2" }}</span> <a href="{{ .RelPermalink }}" class="permalink">{{ .Title }}</a></h3>
+ {{ if isset .Params "tags" }}
+ <span class="blog-post-tags">
+ {{ $list := .Params.tags }}
+ {{ $len := (len $list) }}
+
+ Tags: {{ range $index, $elem := $list }}
+ <a href="/blog/tags/{{ $elem | urlize }}">{{ $elem }}</a> {{ if ne (add $index 1) $len }} ยท {{ end }}
+ {{ end }}
+ </span>
+ {{ end }}
+ {{ end }}
+{{ end }}
+
+{{ partial "footer.html" . }}
--- /dev/null
+<!-- Override the default tag from themes/learn/layouts/partials/tags.html to point to the right URL (with the /blog prefix) -->
+
+{{ if .Params.tags }}
+<div class="tags">
+{{range .Params.tags}}
+ <a class="tag-link" href="{{ "/blog/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
+{{end}}
+</div>
+{{end}}
--- /dev/null
+h3.blog-post {
+ display: flex;
+ align-items: center;
+ margin-bottom: 0;
+}
+
+h3.blog-post > span.date {
+ font-weight: lighter;
+ width: 10vh;
+ display: inline-block;
+ margin-left: 2vh;
+}
+
+span.blog-post-tags {
+ margin-left: 12vh;
+}
+
+a.tag-link::before {
+ left: calc(-1em + 0.5px) !important;
+ top: 0.5px !important;
+}