Browse Source

started a blag

master
Vincent Truchseß 1 year ago
parent
commit
22189546b7
6 changed files with 88 additions and 2 deletions
  1. +8
    -0
      blag.adoc
  2. +8
    -0
      blag/helloworld.adoc
  3. +7
    -0
      posts/blag.adoc
  4. +21
    -2
      src/proton/site.clj
  5. +43
    -0
      templates/custom/default-blag.clj
  6. +1
    -0
      templates/custom/default.clj

+ 8
- 0
blag.adoc View File

@@ -0,0 +1,8 @@
= Blag
VI

Wie ich ja in einem vergangenem Blogpost beschrieben habe, will ich einen
kleinen Spinoff meines Blog's starten. +
Hier wird's etwas Persönlicher und Meinungsvoller, darum habe ich mich auch
entschieden, in meiner Muttersprache zu schreiben. +
Hierfür gibts auch nen eigenen link:blag/rss.xml[RSS-Feed].

+ 8
- 0
blag/helloworld.adoc View File

@@ -0,0 +1,8 @@
= Hello World
VI
:date: 2019-09-25T13:13:14+02:00

Hallo Welt! +

Noch gibbet hier nix zu sehen, außer, dass der Feed offenbar zu funktionieren
scheint.

+ 7
- 0
posts/blag.adoc View File

@@ -0,0 +1,7 @@
= Blag
VI
:date: 2019-09-25T13:43:12+02:00

As announced, I have started a spinoff of this tech-blog. +
This is gonna be more personal and oppinionated so I decided to write there in
my mother-tounge. It's having it,s own link:../blag/rss.xml[rss-feed] and link:../blag.html[startpage].

+ 21
- 2
src/proton/site.clj View File

@@ -1,7 +1,8 @@
(ns proton.site
(:require [proton.templates :as tpl])
(:require [proton.writers :as wr])
(:require [proton.rss :as rss]))
(:require [proton.rss :as rss])
(:require [proton.adoc :as ad]))

(defn site []
;;This function gets loaded at runtime into proton.core. The available namespaces are
@@ -10,16 +11,34 @@
;; proton.writers wr
;; proton.rss rss
(let [t (tpl/template-from-file "templates/custom/default.clj")
blag-t (tpl/template-from-file "templates/custom/default-blag.clj")
posts (wr/compile-posts t tpl/default-post-template)
blag-posts (wr/compile-posts blag-t tpl/default-post-template "blag")
rss-opts {:title "VI's Blog"
:link "https://blog.fyber.space"
:host "blog.fyber.space"
:description "VI's small tech-blog"
:rss-link "https://blog.fyber.space/rss.xml"
:author "Vincent Truchseß"
:max-items 20}
blag-rss-opts {:title "VI's Blag"
:link "https://blog.fyber.space/blag.html"
:host "blog.fyber.space"
:description "VI's small tech-blog"
:rss-link "https://blog.fyber.space/blag/rss.xml"
:author "Vincent Truchseß"
:max-items 20}]
(wr/compile-page t "about.adoc" "about.html")
(wr/compile-page t "contact.adoc" "contact.html")
(wr/write-archive-page t posts "archive.html")
(wr/write-index-with-posts t tpl/default-index-template posts)
(rss/write-feed posts rss-opts)))
(rss/write-feed posts rss-opts)
(let [page (ad/adoc-load "blag.adoc")]
(wr/write-page blag-t "blag.html"
(tpl/default-index-template nil nil
(:content page)
nil
{:postlist (wr/gen-postlist blag-posts 10)})
(:title page)))
(wr/write-archive-page blag-t blag-posts "blag/archive.html")
(rss/write-feed blag-posts blag-rss-opts "blag/rss.xml")))

+ 43
- 0
templates/custom/default-blag.clj View File

@@ -0,0 +1,43 @@
(fn [author date content title extras]
[:html {:lang "en"}
[:head
[:meta {:charset "utf-8"}]
[:meta {:http-equiv "x-ua-compatible"
:content "ie=edge"}]
[:meta {:name "viewport"
:content "width=device-width, init-scale=1"}]
[:title title]
[:link {:rel "stylesheet"
:href (str (:base-url extras) "css/default.css")}]
[:link {:rel "icon"
:type "image/png"
:href (str (:base-url extras) "favicon.png")}]]
[:body
[:header
[:div {:class "logo"}
[:a {:href (:base-url extras)}
[:img {:src (str (:base-url extras) "logo.png")}]]]
(into [:nav]
(map (fn [[url label]]
[:a {:href (str (:base-url extras) url)} label])
[["index.html" "Home"]
["blag.html" "Blag"]
["about.html" "About"]
["blag/archive.html" "Archive"]
["contact.html" "Contact"]]))]
[:main {:role "main"}
[:h1 title]
content]
[:footer
[:a {:href (str (:base-url extras) "contact.html")
:style "float: left; padding-right: 8px;"}
"Impress"]
[:a {:href (str (:base-url extras) "blag/rss.xml")
:style "float: left; padding-right: 8px;"}
"RSS feed"]
[:a {:href (str (:base-url extras) "https://git.fyber.space/vincent/blog-ng")
:style "float: left;"}
"source"]
"Site proudly generated by"
[:a {:href "https://git.fyber.space/vincent/proton"}
"Proton"]]]])

+ 1
- 0
templates/custom/default.clj View File

@@ -21,6 +21,7 @@
(map (fn [[url label]]
[:a {:href (str (:base-url extras) url)} label])
[["index.html" "Home"]
["blag.html" "Blag"]
["about.html" "About"]
["archive.html" "Archive"]
["contact.html" "Contact"]]))]


Loading…
Cancel
Save