Skip to content

Commit

Permalink
Use mkdocs for GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
0x46616c6b committed Dec 31, 2023
1 parent 6903315 commit 8174a5d
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 27 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Documentation

on:
push:
branches:
- 'main'

jobs:
mkdocs:
name: Build & Deploy Documentation
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected]

- name: Deploy Documentation
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: mkdocs.yml
22 changes: 0 additions & 22 deletions .github/workflows/publish-page.yml

This file was deleted.

6 changes: 1 addition & 5 deletions pages/index.html → docs/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,14 @@
padding: 1rem;
}

h1, .info, .widget {
.widget {
max-width: 500px;
margin: 0 auto;
}
</style>
</head>
<body>
<div class="content">
<h1>Ticker Widget Demo</h1>
<div class="info">
<p>This is a demo of the <a href="https://github.com/systemli/ticker-widget">ticker-widget</a> component.</p>
</div>
<div class="widget">
<ticker-timeline domain="updates.systemli.org" limit="10" header="Latest Updates"></ticker-timeline>
</div>
Expand Down
29 changes: 29 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Ticker Widget

A web component to display the latest updates from a ticker instance.

## Usage

!!! important

We will provide a self hosted version of this component soon. Until then you can use the unpkg.com CDN to include the component in your website.

You need to include the script from unpkg.com and then you can use the component like this:

```html
<script type="module" src="https://unpkg.com/@systemli/ticker-widget"></script>
<ticker-timeline domain="updates.systemli.org" limit="10" header="Latest Updates"></ticker-timeline>
```

## Properties

| Property | Attribute | Description | Type | Default |
| -------- | --------- | ----------- | -------- | ----------------------------------- |
| `apiUrl` | `api-url` | | `string` | `'https://ticker-api.systemli.org'` |
| `domain` | `domain` | | `string` | `undefined` |
| `header` | `header` | | `string` | `''` |
| `limit` | `limit` | | `number` | `10` |

## Demo

<iframe src="/demo.html" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" title="systemli-ticker-widget"></iframe>
16 changes: 16 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
site_name: Ticker Widget
site_author: Systemli
repo_url: https://github.com/systemli/ticker-widget

nav:
- Home: index.md

theme:
name: material
palette:
primary: "blue"
accent: "blue"

markdown_extensions:
- admonition

0 comments on commit 8174a5d

Please sign in to comment.