-
Notifications
You must be signed in to change notification settings - Fork 0
/
sn.yaml
136 lines (135 loc) · 4.06 KB
/
sn.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# TO SPECIFY A DIFFERENT CONFIG FILE
# Execute the Sn command with an environment variable pointing to the file:
# SN_CONFIG=/my/config.yaml Sn
#
# title - The title of the site, usable in templates for output as {title}
title: Sn
# subtitle - The subtitle of the site, usable in templates for output as {subtitle}
subtitle: Sn is Tin
# rooturl - The root url of the site, usable in templates for output as {rooturl}
rooturl: 'http://localhost/'
# port - The port on which the server runs
port: 8080
# path - The "root path" for all referenced files here, relative to this file
path: welcome
# dbfile - The name of a database file or leave blank to use an in-memory database
dbfile: 'file:sn?mode=memory&cache=shared'
# dbfile: 'asy.db'
# cleandb - true/false whether to start with a fresh database every time the app starts
cleandb: true
# template_dir - A directory inside of the root path where templates are stored
template_dir: template
# repos - An entry for each repo of data items (usually posts as markdown files), the names here are used to reference the repo
repos:
posts:
# path - The directory inside of the root path that will be scanned for files for this repo
path: posts
pages:
path: pages
# users - A list of users for authentication
users:
test:
passwordhash: $2a$10$X7szeKDWNVDNNTIvg5/uRuIY0ETKkWeDbG/Pk7VfJxa9RnNlg9ki2
webauthn:
rp_display_name: Sn
rp_id: localhost
rp_origins:
- http://localhost
# slug_pattern: The pattern used to generate slugs for posts, defaults to a pattern of: YYYY-mm-dd-title
slug_pattern: YYYY-MM-DD-title
# routes - A list of URL routes for this site, requests are checked against the paths in alphabetical order by name, first matched wins
routes:
01_index:
# path - The URL pattern to match against the request, capture URL parts with {braces}
path: /
# handler - The handler used to process the data to supply to the templates, options: posts, static, debug, git
handler: posts
# template - The templates to use to render the content of this page, rendered in order
templates:
- posts.html.hb
- layout.html.hb
# out - A list of named queries that supply data to the template, each name becomes a value that can be used in the template
out:
posts:
# repo - The repo to query against
repo: posts
# paginate_name - A querystring or URL part that will be used to specify what page to select
paginate_name: page
# paginate_count - The number of items to diplay on each page
paginate_count: 5
02_static:
handler: static
path: /static
# dir - For the static handler, the directory inside of the root path that houses content at this URL
dir: static
03_favicon:
path: /favicon.ico
handler: static
file: static/favicon.svg
04_categories:
path: /tag/{tag}
handler: posts
templates:
- posts.html.hb
- layout.html.hb
out:
posts:
repo: posts
tag: "{tag}"
paginate_name: page
paginate_count: 5
05_posts:
path: /posts/{slug:[^/]+}
handler: posts
templates:
- post.html.hb
- layout.html.hb
out:
posts:
repo: posts
slug: "{slug}"
404_on_empty: fof
05a_posts:
path: /posts/{slug:[^/]+}/
handler: redirect
to: /posts/{slug}
06_pages:
path: /pages/{pageslug:[^/]+}
handler: posts
templates:
- post.html.hb
- layout.html.hb
out:
posts:
repo: pages
slug: "{pageslug}"
404_on_empty: fof
07_search:
path: /search
template: posts.html.hb
layout: layout.html.hb
handler: posts
out:
posts:
repo: posts
search: "{params.s}"
paginate_name: page
paginate_count: 5
98_frontend:
path: /_/frontend
handler: frontend
dir: frontend
99_debug:
path: /_/debug
handler: debug
00_update:
path: /_/webhook
handler: git
remote: asy
dir: /Users/ringmaster/Projects/Sn
fof:
path: /{any:.*}
handler: posts
templates:
- 404.html.hb
- layout.html.hb