Skip to content

Commit 7a542d4

Browse files
authored
Add quarto-website (#115)
1 parent 1fe34f5 commit 7a542d4

File tree

16 files changed

+2052
-0
lines changed

16 files changed

+2052
-0
lines changed

.github/workflows/extensions.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
reaper: extensions/reaper/**
3333
integration-session-manager: extensions/integration-session-manager/**
3434
quarto-stock-report-python: extensions/quarto-stock-report-python/**
35+
quarto-website: extensions/quarto-website/**
3536
portfolio-dashboard: extensions/portfolio-dashboard/**
3637
quarto-document: extensions/quarto-document/**
3738
stock-api-plumber: extensions/stock-api-plumber/**
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.quarto/
2+
*.html
3+
*_files
4+
/env/
5+
_site
6+
featured.yaml
7+
all.yaml
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Quarto Website
2+
3+
## About this example
4+
5+
This Quarto website uses the Posit Connect Server API together with Python to construct a dashboard that presents published content. Views showing featured and all content are included.
6+
7+
Set the `FEATURED_TAGS` environment variable and feature content having a
8+
particular tag name.
9+
10+
11+
## Learn more
12+
13+
* [Quarto](https://quarto.org)
14+
* [Posit Connect API Reference](https://docs.posit.co/connect/api/)
15+
16+
## Requirements
17+
18+
* Python version 3.8 or higher
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
project:
2+
type: website
3+
pre-render: prepare.py
4+
5+
website:
6+
title: Content Dashboard
7+
navbar:
8+
left:
9+
- text: "Featured"
10+
href: "index.qmd"
11+
- text: "All"
12+
href: "all.qmd"
13+
- text: "About"
14+
href: "about.qmd"
15+
16+
format:
17+
html: default
18+
19+
theme:
20+
light: flatly
21+
dark: darkly
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: About
3+
---
4+
5+
This [Quarto Website](https://quarto.org/docs/websites/) shows how the [Posit
6+
Connect Server API](https://docs.posit.co/connect/api/) can combine with
7+
[Quarto Listings](https://quarto.org/docs/websites/website-listings.html) to
8+
create dashboards that highlight your content.
9+
10+
```{python}
11+
#| echo: false
12+
#| output: asis
13+
14+
import yaml
15+
with open("featured.yaml", "r") as f:
16+
featured = len(yaml.safe_load(f))
17+
with open("all.yaml", "r") as f:
18+
listing = len(yaml.safe_load(f))
19+
20+
print(f"This dashboard presents {featured} featured content items with {listing} total items.")
21+
```

extensions/quarto-website/all.qmd

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: All Content
3+
listing:
4+
contents: all.yaml
5+
type: table
6+
fields:
7+
- date
8+
- title
9+
- author
10+
max-items: 200
11+
---
Lines changed: 26 additions & 0 deletions
Loading
Lines changed: 46 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)