Skip to content

Commit

Permalink
Testing pelican migration
Browse files Browse the repository at this point in the history
  • Loading branch information
dfoulks1 committed May 17, 2024
1 parent 29b99dc commit c7e2276
Show file tree
Hide file tree
Showing 8 changed files with 1,982 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-pelican.yml
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
83 changes: 83 additions & 0 deletions pelicanconf.py
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', ]

Loading

0 comments on commit c7e2276

Please sign in to comment.