-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,982 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build a Pelican Website | ||
on: | ||
push: | ||
branches: [ "dfoulks/pelican-gha" ] | ||
workflow_dispatch: | ||
jobs: | ||
build-pelican: | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: '' | ||
ref: 'dfoulks/pelican-gha' | ||
- name: Install Pelican | ||
run: pip3 install pelican markdown ghp-import bs4 | ||
# Optionally, if your website uses the gfm plugin uncomment the GFM block | ||
######################### | ||
# START BUILD GFM BLOCK # | ||
######################### | ||
- name: fetch libcmark-gfm.so buildscript | ||
run: wget https://raw.githubusercontent.com/apache/infrastructure-pelican/master/bin/build-cmark.sh | ||
- name: build libcmark-gfm.so | ||
run: /bin/bash ./build-cmark.sh | ||
####################### | ||
# END BUILD GFM BLOCK # | ||
####################### | ||
- name: Generate website from markdown | ||
run: /usr/bin/env python3 -m pelican content -o output | ||
env: | ||
LIBCMARKDIR: cmark-gfm-0.28.3.gfm.12/lib | ||
- name: Open a PR against the staging branch | ||
uses: peter-evans/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: GitHub Actions Generated Pelican Build | ||
title: Generated Pelican Output | ||
body: output generated | ||
add-paths: | | ||
output/ | ||
base: dfoulks/gha-site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
|
||
# Basic information about the site. | ||
SITENAME = 'Apache Software Foundation' | ||
SITEDESC = 'The main website of the ASF' | ||
SITEDOMAIN = 'www.apache.org' | ||
SITEURL = 'https://www.apache.org' | ||
SITELOGO = 'https://www.apache.org/images/logo.png' | ||
SITEREPOSITORY = 'https://github.com/apache/www-site/blob/main/content/' | ||
CURRENTYEAR = 2024 | ||
TRADEMARKS = 'Apache, the Apache feather logo are trademarks' | ||
TIMEZONE = 'UTC' | ||
# Theme includes templates and possibly static files | ||
THEME = 'theme/apache' | ||
# Specify location of plugins, and which to use | ||
PLUGIN_PATHS = [ 'plugins', ] | ||
PLUGINS = [ 'gfm', 'asfindex', 'consensual_youtube', 'asfgenid', 'asfdata', 'asfrun', ] | ||
# All content is located at '.' (aka content/ ) | ||
PAGE_PATHS = [ '.' ] | ||
STATIC_PATHS = [ '.', ] | ||
# Where to place/link generated pages | ||
|
||
PATH_METADATA = '(?P<path_no_ext>.*)\\..*' | ||
|
||
PAGE_SAVE_AS = '{path_no_ext}.html' | ||
# Don't try to translate | ||
PAGE_TRANSLATION_ID = None | ||
# Disable unused Pelican features | ||
# N.B. These features are currently unsupported, see https://github.com/apache/infrastructure-pelican/issues/49 | ||
FEED_ALL_ATOM = None | ||
INDEX_SAVE_AS = '' | ||
TAGS_SAVE_AS = '' | ||
CATEGORIES_SAVE_AS = '' | ||
AUTHORS_SAVE_AS = '' | ||
ARCHIVES_SAVE_AS = '' | ||
# Disable articles by pointing to a (should-be-absent) subdir | ||
ARTICLE_PATHS = [ 'blog' ] | ||
# needed to create blogs page | ||
ARTICLE_URL = 'blog/{slug}.html' | ||
ARTICLE_SAVE_AS = 'blog/{slug}.html' | ||
# Disable all processing of .html files | ||
READERS = { 'html': None, } | ||
|
||
# Configure the asfgenid plugin | ||
ASF_GENID = { | ||
'unsafe_tags': True, | ||
'metadata': True, | ||
'elements': True, | ||
'permalinks': True, | ||
'tables': True, | ||
|
||
'headings': True, | ||
'headings_re': '^h[1-4]', | ||
|
||
|
||
'toc': True, | ||
'toc_headers': '^h[1-4]', | ||
|
||
'debug': False, | ||
} | ||
|
||
|
||
|
||
# Configure the asfdata plugin | ||
ASF_DATA = { | ||
'data': 'asfdata.yaml', | ||
'metadata': { | ||
'site_url': SITEURL | ||
}, | ||
'debug': False, | ||
} | ||
|
||
|
||
# Configure the asfrun plugin (initialization) | ||
ASF_RUN = [ '/bin/bash get_calendar.sh', ] | ||
|
||
|
||
# Configure the asfrun plugin (finalization) | ||
ASF_POSTRUN = [ '/bin/bash pagefind.sh', ] | ||
|
||
|
||
# Configure ignore files | ||
IGNORE_FILES = [ 'README.md', 'interviews', 'include', '*.odt', ] | ||
|
Oops, something went wrong.