From: Alekos Filini Date: Wed, 18 Nov 2020 16:21:28 +0000 (+0100) Subject: Add support for publishing blog posts X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/struct.SelectionError.html?a=commitdiff_plain;h=cf360c886610d8135437633b05bc31a07151e06b;p=bitcoindevkit.org Add support for publishing blog posts --- diff --git a/README.md b/README.md index 3acbd2eb43..4c966c512c 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,27 @@ the `bdk/target/doc` directory after running the below commands from the `bdk` p 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/.md`. At the beginning of the file add the following header: + +``` +--- +title: "" +description: "" +author: "" +date: "" +tags: ["", "] +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//` and store everything you need in there. diff --git a/config.toml b/config.toml index 425ca2e443..4b80e3da04 100644 --- a/config.toml +++ b/config.toml @@ -26,7 +26,16 @@ ordersectionsby = "weight" # 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] diff --git a/content/blog/_index.md b/content/blog/_index.md new file mode 100644 index 0000000000..8df61f49c7 --- /dev/null +++ b/content/blog/_index.md @@ -0,0 +1,9 @@ ++++ +title = "Blog" +weight = 1 +chapter = false +pre = ' ' ++++ + +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). diff --git a/content/repl/_index.md b/content/repl/_index.md index 9a53caf71e..fd9d9c762d 100644 --- a/content/repl/_index.md +++ b/content/repl/_index.md @@ -1,7 +1,7 @@ +++ title = "REPL" date = 2020-04-28T17:03:00+02:00 -weight = 1 +weight = 5 chapter = true pre = ' ' +++ diff --git a/layouts/blog/list.html b/layouts/blog/list.html new file mode 100644 index 0000000000..669a5a2b33 --- /dev/null +++ b/layouts/blog/list.html @@ -0,0 +1,25 @@ +{{ partial "header.html" . }} + +{{ if eq .Kind "section" }} + {{ .Content }} +{{end}} + +{{ range (where .Site.Pages "Type" "blog").GroupByDate "2006" }} +

Posts in {{ .Key }}

+ + {{ range where .Pages ".Kind" "!=" "section" }} +

{{ .Date.Format "Jan 2" }}

+ {{ if isset .Params "tags" }} + + {{ end }} + {{ end }} +{{ end }} + +{{ partial "footer.html" . }} diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html new file mode 100644 index 0000000000..75bb3a4667 --- /dev/null +++ b/layouts/partials/tags.html @@ -0,0 +1,9 @@ + + +{{ if .Params.tags }} +
+{{range .Params.tags}} + {{ . }} +{{end}} +
+{{end}} diff --git a/static/css/blog.css b/static/css/blog.css new file mode 100644 index 0000000000..fe479652a8 --- /dev/null +++ b/static/css/blog.css @@ -0,0 +1,21 @@ +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; +}