Skip to content

Commit 07b859b

Browse files
committed
Setup Pelican Properly
1 parent 1f60f3e commit 07b859b

File tree

2 files changed

+80
-2
lines changed

2 files changed

+80
-2
lines changed

.github/workflows/build-pelican.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
name: Build a Pelican Website
22
on:
33
push:
4-
branches: [ "main" ]
4+
# This prevents the workflow from running automatically on a new branch
5+
# When creating a new site branch, please ensure that the push and checkout branches agree
6+
# and that the action/pelican destination value is updated accordingly
7+
branches: [ 'main' ]
58
workflow_dispatch:
69
jobs:
710
build-pelican:
811
runs-on: ubuntu-latest
9-
continue-on-error: true
1012
steps:
1113
- uses: actions/checkout@v4
1214
with:
15+
# This must equal the push/branches list above, and be appropriate for the destination below
1316
ref: 'main'
1417
- uses: apache/infrastructure-actions/pelican@main
1518
with:
19+
# This must be appropriate for the branch being built
1620
destination: 'asf-site'
1721
gfm: 'true'

pelicanconf.py

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
2+
import datetime
3+
# Basic information about the site.
4+
SITENAME = 'ASF Tooling Website'
5+
SITEDESC = 'The official website of the ASF Tooling Team'
6+
SITEDOMAIN = 'tooling.apache.org'
7+
SITEURL = 'https://tooling.apache.org'
8+
SITELOGO = 'https://tooling.apache.org//extras/favicon.ico'
9+
SITEREPOSITORY = 'https://github.com/apache/tooling-docs/blob/main/content/'
10+
CURRENTYEAR = datetime.date.today().year
11+
TRADEMARKS = 'Apache and the Apache feather logo are trademarks of The Apache Software Foundation.'
12+
TIMEZONE = 'UTC'
13+
# Theme includes templates and possibly static files
14+
THEME = 'content/theme'
15+
# Specify location of plugins, and which to use
16+
PLUGIN_PATHS = [ 'plugins', ]
17+
# If the website uses any *.ezmd files, include the 'gfm' and 'asfreader' plugins (in that order)
18+
PLUGINS = [ 'toc', 'spu', 'gfm', 'asfgenid', 'asfrun', ]
19+
# All content is located at '.' (aka content/ )
20+
PAGE_PATHS = [ 'pages' ]
21+
STATIC_PATHS = [ '.', ]
22+
# Where to place/link generated pages
23+
24+
PATH_METADATA = 'pages/(?P<path_no_ext>.*)\\..*'
25+
26+
PAGE_SAVE_AS = '{path_no_ext}.html'
27+
# Don't try to translate
28+
PAGE_TRANSLATION_ID = None
29+
# Disable unused Pelican features
30+
# N.B. These features are currently unsupported, see https://github.com/apache/infrastructure-pelican/issues/49
31+
FEED_ALL_ATOM = None
32+
INDEX_SAVE_AS = ''
33+
TAGS_SAVE_AS = ''
34+
CATEGORIES_SAVE_AS = ''
35+
AUTHORS_SAVE_AS = ''
36+
ARCHIVES_SAVE_AS = ''
37+
# Disable articles by pointing to a (should-be-absent) subdir
38+
ARTICLE_PATHS = [ 'blog' ]
39+
# needed to create blogs page
40+
ARTICLE_URL = 'blog/{slug}.html'
41+
ARTICLE_SAVE_AS = 'blog/{slug}.html'
42+
# Disable all processing of .html files
43+
READERS = { 'html': None, }
44+
45+
# Configure the asfgenid plugin
46+
ASF_GENID = {
47+
'unsafe_tags': True,
48+
'metadata': False,
49+
'elements': False,
50+
'permalinks': False,
51+
'tables': False,
52+
53+
'headings': False,
54+
55+
56+
'toc': False,
57+
58+
'debug': False,
59+
}
60+
61+
62+
63+
64+
65+
# Configure the asfrun plugin (finalization)
66+
ASF_POSTRUN = [ '/bin/bash pagefind.sh', ]
67+
68+
69+
# Configure ignore files
70+
# File and directory basenames matching any of these patterns will be ignored by the processor.
71+
IGNORE_FILES = [ 'theme', ]
72+
73+
74+

0 commit comments

Comments
 (0)