Compare commits
10 commits
d93958e891
...
658f4a5874
Author | SHA1 | Date | |
---|---|---|---|
|
658f4a5874 | ||
|
8a80ab665d | ||
|
d70e270ed0 | ||
|
0209f10696 | ||
|
d68db94b3b | ||
|
7a3eb89fd8 | ||
|
a9f0437fc7 | ||
|
bb07ca780e | ||
|
6ff83f6742 | ||
|
fd6448c6f2 |
|
@ -1,4 +1,4 @@
|
|||
Copyright 2024 Leon Mika
|
||||
Copyright 2025 Leon Mika
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# Sidebar For Tiny Theme
|
||||
|
||||
## Description
|
||||
|
||||
Sidebar for Tiny Theme is a Micro.blog plugin that adds a sidebar to a blog using [Tiny Theme](https://tiny.micro.blog/), by Matt Langford. This can be used to show your [blog-roll](https://www.manton.org/2024/03/11/recommendations-and-blogrolls.html), links, and pretty much anything you can imagine going into a sidebar.
|
||||
|
||||
For an example of how this looks on a blog, visit [the example site](https://sidebar-for-tiny-theme.lmika.dev/) or [my own blog](https://lmika.org/).
|
||||
|
||||
Questions? Bugs? Ideas? Please raise them as Github issue or [contact me directly](https://leonmika.com).
|
||||
|
||||
## Credit
|
||||
|
||||
Tiny Theme is created and maintained by [Matt Langfield](http://micro.blog/mtt?remote_follow=1).
|
||||
|
|
|
@ -2,15 +2,17 @@
|
|||
<header>
|
||||
<h1>Recommendations</h1>
|
||||
</header>
|
||||
<ul class="blogroll">
|
||||
{{ range .Site.Data.blogrolls.recommendations }}
|
||||
<li><a href="{{ .url }}">{{ .name }}: <span>{{ (urls.Parse .url).Hostname }}</span></a></li>
|
||||
{{ else }}
|
||||
<p>No recommendations yet.</p>
|
||||
{{ end }}
|
||||
</ul>
|
||||
<div class="blogroll-footer-links">
|
||||
<a href="{{ absURL ".well-known/recommendations.opml" }}">OPML</a>
|
||||
<a href="{{ absURL ".well-known/recommendations.json" }}">JSON</a>
|
||||
</div>
|
||||
{{ if and (.Site.Data.blogrolls) (.Site.Data.blogrolls.recommendations) }}
|
||||
<ul class="blogroll">
|
||||
{{ range .Site.Data.blogrolls.recommendations }}
|
||||
<li><a href="{{ .url }}">{{ .name }}: <span>{{ (urls.Parse .url).Hostname }}</span></a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
<div class="blogroll-footer-links">
|
||||
<a href="{{ absURL ".well-known/recommendations.opml" }}">OPML</a>
|
||||
<a href="{{ absURL ".well-known/recommendations.json" }}">JSON</a>
|
||||
</div>
|
||||
{{ else }}
|
||||
<p>No recommendations yet.</p>
|
||||
{{ end }}
|
||||
</div>
|
|
@ -1,7 +1,13 @@
|
|||
{{ $isPost := eq .Page.Type "post" -}}
|
||||
{{ $showOnPosts := $.Site.Params.sidebar_show_on_posts -}}
|
||||
{{ $showOnPages := $.Site.Params.sidebar_show_on_pages -}}
|
||||
{{ $shouldShowSidebar := or .IsHome (and $showOnPosts $isPost) (and $showOnPages (not $isPost)) -}}
|
||||
{{ if $shouldShowSidebar -}}
|
||||
<div class="sidebar">
|
||||
{{ if templates.Exists "partials/sidebar.html" }}
|
||||
{{ partial "sidebar.html" . }}
|
||||
{{ else }}
|
||||
{{ partial "sidebar-for-tiny-theme/recommendations.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end -}}
|
18
plugin.json
18
plugin.json
|
@ -1,8 +1,20 @@
|
|||
{
|
||||
"version": "0.1.0",
|
||||
"title": "Sidebar for Tiny theme",
|
||||
"description": "Adds a sidebar to blogs using the Tiny theme",
|
||||
"version": "0.0.1",
|
||||
"title": "Sidebar for Bayou",
|
||||
"description": "Adds a sidebar to a blog using the Bayou theme",
|
||||
"includes": [
|
||||
"/sidebar.css"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"field": "params.sidebar_show_on_posts",
|
||||
"label": "Show sidebar on posts",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"field": "params.sidebar_show_on_pages",
|
||||
"label": "Show sidebar on other pages",
|
||||
"type": "boolean"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
max-width: 50em;
|
||||
}
|
||||
|
||||
div.wrapper:has(div.sidebar) {
|
||||
div.page-content:has(div.sidebar) {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(20em,35em) 15em;
|
||||
column-gap: 60px;
|
||||
|
|
Loading…
Reference in a new issue