Skip to content

Commit

Permalink
Initial Wiki support, more to come (hidden for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianthoma committed Oct 31, 2024
1 parent 11a42f3 commit 4547958
Show file tree
Hide file tree
Showing 8 changed files with 356 additions and 15 deletions.
37 changes: 27 additions & 10 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ collections:
uploads:
title: Uploads
output: true
wiki:
title: Wiki
output: true
defaults:
- scope:
path: ''
Expand All @@ -28,7 +31,22 @@ defaults:
type: pages
values:
layout: single
breadcrumbs: false
author_profile: false
- scope:
path: ""
type: wiki
values:
layout: wiki
read_time: false
author_profile: false
share: false
related: false
sidebar_include: wiki-sidebar.html
breadcrumbs: true
classes: wide
permalink: "/wiki/:path/"

subtitle: Dein Makerspace in Basel!
email: open@lists.starship-factory.ch
description: Write an awesome description for your new site here. You can edit this
Expand All @@ -37,17 +55,22 @@ description: Write an awesome description for your new site here. You can edit t
twitter_username: StarshipFactory
github_username: starshipfactory
minimal_mistakes_skin: default
relative_permalinks: false
search: true
logo: "/assets/images/logo.svg"
breadcrumbs: true
teaser: "/assets/images/logo.svg"
markdown: kramdown
markdown_ext: "markdown,mkdown,mkdn,mkd,md,mdwn"
strict_front_matter : false
remote_theme: mmistakes/minimal-mistakes
permalink: "/:categories/:title/"
permalink: pretty
paginate: 5
paginate_path: "/blog/page:num/"
include:
- _pages
- wiki
plugins:
- jekyll-paginate
- jekyll-sitemap
Expand Down Expand Up @@ -79,23 +102,17 @@ footer:
icon: fab fa-brands fa-discourse
url: https://discourse.starship-factory.ch
- label: Signal
icon: fa fa-comment
icon: fab fa-brands fa-signal-messenger
url: https://signal.group/#CjQKIIt5fkwCXHlImGzm41tTrf-6umAhyM7ENTpqW4Y0P4SHEhDgMyhI63oL7v3mTk0N7G3t
- label: Kalender
icon: fa fa-calendar
icon: fa-solid fa-calendar-days
url: https://cloud.starship-factory.ch/apps/calendar/p/NBiqtDiWQZmAZYfq
- label: Twitter
icon: fab fa-fw fa-twitter-square
url: https://twitter.com/StarshipFactory
- label: GitHub
icon: fab fa-fw fa-github
icon: fab fa-brands fa-github
url: https://github.com/starshipfactory
- label: Instagram
icon: fab fa-fw fa-instagram
icon: fab fa-brands fa-instagram
url: https://instagram.com/starship_factory
- label: Facebook
icon: fab fa-fw fa-facebook
url: https://www.facebook.com/starshipfactory
linked_pages:
- label: Impressum
url: "/impressum/"
Expand Down
46 changes: 46 additions & 0 deletions _includes/breadcrumbs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{% case site.category_archive.type %}
{% when "liquid" %}
{% assign path_type = "#" %}
{% when "jekyll-archives" %}
{% assign path_type = nil %}
{% endcase %}

{% if page.collection != 'posts' %}
{% assign path_type = nil %}
{% assign crumb_path = '/' %}
{% else %}
{% assign crumb_path = site.category_archive.path %}
{% endif %}

<nav class="breadcrumbs">
<ol itemscope itemtype="https://schema.org/BreadcrumbList">
{% assign crumbs = page.url | split: '/' %}
{% assign i = 1 %}
{% assign path = '' %}
{% for crumb in crumbs offset: 1 %}
{% if forloop.first %}
<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ '/' | relative_url }}" itemprop="item"><span itemprop="name">{{
site.data.ui-text[site.locale].breadcrumb_home_label | default: "Home" }}</span></a>

<meta itemprop="position" content="{{ i }}" />
</li>
<span class="sep">{{ site.data.ui-text[site.locale].breadcrumb_separator | default: "/" }}</span>
{% endif %}
{% if forloop.last %}
<li class="current" {% if page.locale %} lang="{{ page.locale }}" {% endif %}>{{ page.title }}</li>
{% else %}
{% assign i = i | plus: 1 %}

<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ crumb | replace: '%20', '-' | prepend: path_type | prepend: crumb_path | prepend: path | relative_url }}"
itemprop="item"><span itemprop="name">{{ crumb | url_decode | replace: '-', ' ' | capitalize
}}</span></a>
<meta itemprop="position" content="{{ i }}" />
</li>
<span class="sep">{{ site.data.ui-text[site.locale].breadcrumb_separator | default: "/" }}</span>
{% assign path = path | append: '/' | append: crumb %}
{% endif %}
{% endfor %}
</ol>
</nav>
21 changes: 21 additions & 0 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% if page.author_profile or layout.author_profile or page.sidebar or page.sidebar_include %}
<div class="sidebar sticky">
{% if page.author_profile or layout.author_profile %}{% include author-profile.html %}{% endif %}
{% if page.sidebar %}
{% for s in page.sidebar %}
{% if s.image %}
<img src="{{ s.image | relative_url }}" alt="{% if s.image_alt %}{{ s.image_alt }}{% endif %}">
{% endif %}
{% if s.title %}<h3>{{ s.title }}</h3>{% endif %}
{% if s.text %}{{ s.text | markdownify }}{% endif %}
{% if s.nav %}{% include nav_list nav=s.nav %}{% endif %}
{% endfor %}
{% if page.sidebar.nav %}
{% include nav_list nav=page.sidebar.nav %}
{% endif %}
{% endif %}
{% if page.sidebar_include %}
{% include {{ page.sidebar_include }} %}
{% endif %}
</div>
{% endif %}
28 changes: 28 additions & 0 deletions _includes/wiki-sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<nav class="nav__list">
<input id="ac-toc" name="accordion-toc" type="checkbox" />
<label for="ac-toc">{{ site.data.ui-text[site.locale].menu_label | default: "Toggle Menu" }}</label>

{% assign navurl = page.url | remove: 'index.html' %}
{% assign pages = site.wiki %}
<ul class="nav__items">
{% for item in pages %}
<li>
{% assign level = item.url | remove: '/index.html' | split: '/' | size | minus:3 %}

<span {% if level==0 %}class="nav__sub-title" {% endif %}>

{% if level >= 0 and level <= 2 %} <a href="{{ item.url | relative_url }}"
style="margin-left: {{ level | times:0.7}}em; padding-inline: 0px; font-size:0.85em;" {% if
item.url==navurl %} class="active" {% endif %}>
{% if item.navtitle %}
{{item.navtitle}}
{% else %}
{{ item.title }}
{% endif %}
</a>
{% endif %}
</span>
</li>
{% endfor %}
</ul>
</nav>
87 changes: 87 additions & 0 deletions _layouts/wiki.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
layout: default
---

{% if page.header.overlay_color or page.header.overlay_image or page.header.image %}
{% include page__hero.html %}
{% elsif page.header.video.id and page.header.video.provider %}
{% include page__hero_video.html %}
{% endif %}

{% assign breadcrumbs_enabled = site.breadcrumbs %}
{% if page.breadcrumbs != null %}
{% assign breadcrumbs_enabled = page.breadcrumbs %}
{% endif %}
{% if page.url != "/" and breadcrumbs_enabled %}
{% unless paginator %}
{% include breadcrumbs.html %}
{% endunless %}
{% endif %}

<div id="main" role="main">
{% include sidebar.html %}

<article class="page" itemscope itemtype="https://schema.org/CreativeWork" {% if page.locale %}
lang="{{ page.locale }}" {% endif %}>
{% if page.title %}
<meta itemprop="headline"
content="{{ page.title | replace: '|', '&#124;' | markdownify | strip_html | strip_newlines | escape_once }}">
{% endif %}
{% if page.excerpt %}
<meta itemprop="description"
content="{{ page.excerpt | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
{% if page.date %}
<meta itemprop="datePublished" content="{{ page.date | date_to_xmlschema }}">{% endif %}
{% if page.last_modified_at %}
<meta itemprop="dateModified" content="{{ page.last_modified_at | date_to_xmlschema }}">{% endif %}

<div class="page__inner-wrap">
{% unless page.header.overlay_color or page.header.overlay_image %}
<header>
<div class="wiki_edit_link"><a href="#">Edit</a>
</div>
{% if page.title -%}
<h1 id="page-title" class="page__title" itemprop="headline">
<a href="{{ page.url | absolute_url }}" itemprop="url">{{ page.title | markdownify | remove: "<p>" |
remove: "</p>" }}</a>
</h1>
{%- endif %}
<div class="page__meta" style="padding-bottom: 0.5em;">
{% include page__date.html %}
{% include page__meta.html %}
</div>
</header>
{% endunless %}

<section class="page__content" itemprop="text">
{% if page.toc %}
<aside class="sidebar__right {% if page.toc_sticky %}sticky{% endif %}">
<nav class="toc">
<header>
<h4 class="nav__title"><i class="fas fa-{{ page.toc_icon | default: 'file-alt' }}"></i> {{
page.toc_label | default: site.data.ui-text[site.locale].toc_label | default: "On this
page" }}</h4>
</header>
{% include toc.html sanitize=true html=content h_min=1 h_max=6 class="toc__menu"
skip_no_ids=true %}
</nav>
</aside>
{% endif %}
{{ content }}
{% if page.link %}<div><a href="{{ page.link }}" class="btn btn--primary">{{
site.data.ui-text[site.locale].ext_link_label | default: "Direct Link" }}</a></div>{% endif %}
</section>

<footer class="page__meta">
{% if site.data.ui-text[site.locale].meta_label %}
<h4 class="page__meta-title">{{ site.data.ui-text[site.locale].meta_label }}</h4>
{% endif %}
{% include page__taxonomy.html %}

</footer>

</div>

</article>

</div>
122 changes: 122 additions & 0 deletions _wiki/formating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
title: Formatting in this Wiki
---
# Markdown Cheat Sheet

Thanks for visiting [The Markdown Guide](https://www.markdownguide.org)!

This Markdown cheat sheet provides a quick overview of all the Markdown syntax elements. It can’t cover every edge case, so if you need more information about any of these elements, refer to the reference guides for [basic syntax](https://www.markdownguide.org/basic-syntax/) and [extended syntax](https://www.markdownguide.org/extended-syntax/).

## Basic Syntax

These are the elements outlined in John Gruber’s original design document. All Markdown applications support these elements.

### Heading

# H1
## H2
### H3

### Bold

**bold text**

### Italic

*italicized text*

### Blockquote

> blockquote

### Ordered List

1. First item
2. Second item
3. Third item

### Unordered List

- First item
- Second item
- Third item

### Code

`code`

### Horizontal Rule

---

### Link

[Markdown Guide](https://www.markdownguide.org)

### Image

![alt text](https://www.markdownguide.org/assets/images/tux.png)

## Extended Syntax

These elements extend the basic syntax by adding additional features. Not all Markdown applications support these elements.

### Table

| Syntax | Description |
| ----------- | ----------- |
| Header | Title |
| Paragraph | Text |

### Fenced Code Block

```
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}
```

### Footnote

Here's a sentence with a footnote. [^1]

[^1]: This is the footnote.

### Heading ID

### My Great Heading {#custom-id}

### Definition List

term
: definition

### Strikethrough

~~The world is flat.~~

### Task List

- [x] Write the press release
- [ ] Update the website
- [ ] Contact the media

### Emoji

That is so funny! :joy:

(See also [Copying and Pasting Emoji](https://www.markdownguide.org/extended-syntax/#copying-and-pasting-emoji))

### Highlight

I need to highlight these ==very important words==.

### Subscript

H~2~O

### Superscript

X^2^
Loading

0 comments on commit 4547958

Please sign in to comment.