Is there a way in Pelican (Python) static site generator to pass in just a raw HTML page only? At the moment I am trying to place a google-site-verification HTML file to be permanent hosted in the root directory. I have run into this issue a few other times, unrelated to the google site verification.
In an ideal world I would place the HTML file in the content
directory, like an rst
or an md
file, and then it is picked up and dropped into the output
directory. This is obviously not working, hence why I am here.
The simplest way to include arbitrary files in the output is with EXTRA_PATH_METADATA
and STATIC_PATHS
. For example, from my blog's config:
STATIC_PATHS = [
'images',
'extra',
]
EXTRA_PATH_METADATA = {
'extra/custom.css': {'path': 'custom.css'},
'extra/robots.txt': {'path': 'robots.txt'},
'extra/favicon.ico': {'path': 'favicon.ico'},
'extra/CNAME': {'path': 'CNAME'},
'extra/LICENSE': {'path': 'LICENSE'},
'extra/README': {'path': 'README'},
}
This takes the specified files from /content/extra
and puts them in the root of /output
.
As you have an HTML file in your extras, you will also need to include your static directory in ARTICLE_EXCLUDES
to prevent Pelican from trying to process the file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With