Skip to content

Commit 7db2f7c

Browse files
Shay DeWaelseratch
authored andcommitted
Add documentation infra (slackapi#51)
* Add documentation infrastructure * modify sidebar * please github * change base url
1 parent 557ae62 commit 7db2f7c

25 files changed

Lines changed: 814 additions & 0 deletions

docs/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
_site
2+
Gemfile.lock
3+
.env
4+
.jekyll-metadata
5+
.vscode/
6+
.bundle/
7+
vendor/

docs/Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source 'https://rubygems.org'
2+
gem 'github-pages', group: :jekyll_plugins
3+
gem 'dotenv'

docs/_advanced/example.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: Example
3+
lang: en
4+
slug: advanced-ex
5+
order: 0
6+
---
7+
8+
<div class="section-content">
9+
An <b>advanced</b> section example.
10+
</div>
11+
12+
```python
13+
# We love Python <3
14+
```

docs/_basic/example.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Example
3+
lang: en
4+
slug: ex
5+
order: 0
6+
---
7+
8+
<div class="section-content">
9+
An example section
10+
</div>
11+
12+
```python
13+
# We love Python <3
14+
```
15+
16+
<details class="secondary-wrapper">
17+
<summary class="section-head" markdown="0">
18+
<h4 class="section-head">Secondary section</h4>
19+
</summary>
20+
21+
<div class="secondary-content" markdown="0">
22+
Some accessory information if need-be
23+
24+
</div>
25+
26+
```python
27+
# Ooo i'm coding
28+
```
29+
30+
</details>

docs/_config.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# For technical reasons, this file is *NOT* reloaded automatically when you use
2+
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
3+
title: Bolt
4+
description: >-
5+
A framework that makes Slack app development fast and straight-forward.
6+
With a single interface for Slack’s Web API, Events API, and interactive features,
7+
Bolt gives you the full power of the Slack platform out of the box.
8+
baseurl: /bolt-python
9+
url: https://slack.dev
10+
11+
collections:
12+
basic:
13+
output: false
14+
advanced:
15+
output: false
16+
tutorials:
17+
output: true
18+
permalink: /tutorials/:slug
19+
20+
defaults:
21+
-
22+
scope:
23+
path: ""
24+
values:
25+
layout: "default"
26+
27+
# Translation strings used in templates - they are typically used using t[page.lang]
28+
# so it's important to have corresponding strings for each translated language
29+
t:
30+
en:
31+
basic: Basic concepts
32+
advanced: Advanced concepts
33+
start: Getting started
34+
contribute: Contributing
35+
ja-jp:
36+
basic: 基本的な概念
37+
advanced: 応用コンセプト
38+
start: Bolt 入門ガイド
39+
contribute: 貢献
40+
41+
# Metadata
42+
repo_name: bolt-python
43+
github_username: SlackAPI
44+
45+
code_of_conduct_url: https://slackhq.github.io/code-of-conduct
46+
cla_url: https://cla-assistant.io/slackapi/bolt-python
47+
48+
google_analytics: UA-56978219-13
49+
google_tag_manager: GTM-KFZ5MK7
50+
51+
# Build settings
52+
markdown: kramdown
53+
kramdown:
54+
parse_block_html: true
55+
plugins:
56+
- jemoji
57+
- jekyll-redirect-from
58+
59+
repository: slackapi/bolt-python

docs/_includes/analytics.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
<script>
3+
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
4+
ga('create', '{{ site.google_analytics }}', 'auto');
5+
ga('send', 'pageview');
6+
</script>
7+
<script async src='https://www.google-analytics.com/analytics.js'></script>

docs/_includes/head.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<head>
2+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
3+
4+
<title>Slack | Bolt</title>
5+
<meta name="author" content="Slack">
6+
<meta name="description" content="{{ site.description }}">
7+
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
8+
<link href="https://a.slack-edge.com/17c88/style/rollup-slack_kit_legacy_adapters.css" rel="stylesheet" type="text/css">
9+
<link href="https://a.slack-edge.com/cc5205/style/rollup-api_site.css" rel="stylesheet" type="text/css">
10+
{% if page.lang == "ja-jp" %}
11+
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+JP:400,700&display=swap" rel="stylesheet">
12+
{% endif %}
13+
<link href="{{ site.url | append: site.baseurl }}/assets/style.css" rel="stylesheet" type="text/css">
14+
15+
<meta name="HandheldFriendly" content="true"/>
16+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17+
18+
19+
<!--[if lt IE 9]>
20+
<script src="https://a.slack-edge.com/ef0d/js/libs/html5shiv.js"></script>
21+
<![endif]-->
22+
23+
<link id="favicon" rel="shortcut icon" href="{{ site.url | append: site.baseurl }}/assets/bolt-favicon.png" sizes="16x16 32x32 48x48" type="image/png" />
24+
25+
</head>
26+

docs/_includes/header.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<div class="header">
2+
<div class="header_nav">
3+
<a href="https://github.com/{{ site.github_username }}/{{ site.repo_name }}" class="btn header_btn float_right"><ts-icon class="ts_icon_github"></ts-icon>Code on GitHub</a>
4+
<a href="https://api.slack.com" class="btn header_btn float_right"><ts-icon class="ts_icon_slack_pillow"></ts-icon>Slack Platform Home</a>
5+
<!-- If we add more languages, this logic will need to change -->
6+
{% if page.lang == "ja-jp" %}
7+
<a href="{{ site.url | append: site.baseurl }}/" class="header_btn language-switcher float_right">English</a>
8+
{% else %}
9+
<!-- <a href="{{ site.url | append: site.baseurl }}/ja-jp" class="header_btn language-switcher float_right">日本語 (Japanese)</a> -->
10+
{% endif %}
11+
</div>
12+
</div>

docs/_includes/sidebar.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<div class="sidebar-content">
2+
<div class="logo">
3+
<span class="icon">
4+
<img src="{{ site.url | append: site.baseurl }}/assets/bolt-py-logo.svg"/>
5+
</span>
6+
7+
<span class="name">
8+
Bolt
9+
</span>
10+
11+
<!-- Liquid has no ternary operator, so this is just meant to disclude
12+
english sections since they are at the root URL -->
13+
{% assign localized_base_url = page.lang | prepend: "/" | remove_first: "/en" %}
14+
15+
<span class="version">
16+
{% assign release = site.github.releases | sort: "created_at" | reverse | pop %}
17+
<a href="{{ release[0].html_url }}">{{ release[0].tag_name }}</a>
18+
</span>
19+
</div>
20+
21+
<ul class="sidebar-section">
22+
<a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/tutorial/getting-started"><li class="title">{{ site.t[page.lang].start }}</li></a>
23+
</ul>
24+
25+
<ul class="sidebar-section">
26+
<a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/concepts#basic"><li class="title">{{ site.t[page.lang].basic }}</li></a>
27+
{% assign basic_sections = site.basic | sort: "order" | where: "lang", page.lang %}
28+
29+
{% for section in basic_sections %}
30+
<a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/concepts#{{ section.slug }}">
31+
<li>{{section.title}}</li>
32+
</a>
33+
{% endfor %}
34+
</ul>
35+
36+
<ul class="sidebar-section">
37+
<a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/concepts#advanced">
38+
<li class="title">{{ site.t[page.lang].advanced }}</li>
39+
</a>
40+
{% assign advanced_sections = site.advanced | sort: "order" | where: "lang", page.lang %}
41+
{% for section in advanced_sections %}
42+
<a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/concepts#{{ section.slug }}">
43+
<li>{{section.title}}</li>
44+
</a>
45+
{% endfor %}
46+
</ul>
47+
48+
<ul class="sidebar-section">
49+
{% assign tutorials = site.tutorials | where: "lang", page.lang | where_exp: "tutorial", "tutorial.order > 0" %}
50+
{% for tutorial in tutorials %}
51+
<a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/tutorial/{{ tutorial.slug }}">
52+
<li class="title">{{tutorial.title}}</li>
53+
</a>
54+
{% endfor %}
55+
<a href="https://github.com/SlackAPI/bolt-python/blob/master/.github/contributing.md"><li class="title">{{ site.t[page.lang].contribute }}</li></a>
56+
</ul>
57+
</div>

docs/_includes/tag_manager.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- Google Tag Manager -->
2+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
3+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
4+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
5+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
6+
})(window,document,'script','dataLayer','{{ site.google_tag_manager }}');</script>
7+
<!-- End Google Tag Manager -->
8+
9+
<!-- Google Tag Manager (noscript) -->
10+
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ site.google_tag_manager }}"
11+
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
12+
<!-- End Google Tag Manager (noscript) -->

0 commit comments

Comments
 (0)