Blockdox.com
The prototype company website https://blockdoxcom-staging.netlify.com is a static site generated by Pelican . Deployments and hosting are managed by Netlify. Currently Netlify is using a personal account (marcus@blockdox.com) but will be migrated to a team account when we go to production.
The code and content that are used by Netlify are currently in a private Github repo because Netlify CMS does not support Git Gateway
for Bitbucket, and we would have to have a Bitbucket account for every content editor :(
Please request repository access from marcus@blockdox.com
Content is stored in the code repo and managed by Netlify CMS. To access the CMS advise for an invite. When you accept the invite by clicking the link in your email you will be able to set a password, then you can follow the link below to edit content.
Netfly CMS provides content editing of pages and articles. Netlify CMS commits changes directly to the repo on Publish. Netlify triggers a deployment automatically when the repo changes. This takes anything from a few seconds to a couple of minutes.
Note: content can also be edited by committing changes in Github, however it’s easy to make mistakes which stop the CMS from working properly.
Git Gateway
Netlify CMS is configured to use the Git Gateway which facilitates connecting the CMS to the content in Git. Git Gatway is not supported for the Bitbucket backend, so this site is managed in Github.
Developer Getting Started
It's a good idea to skim read the Pelican Docs
Setup a python virtual environment with pyenv and virtualenv
pyenv virtualenv blockdoxcom
pyenv local blockdox.com
Install pelican and dependencies
pip install -r requirements.txt
Run pelican to read from the content
directory and generate the site in the output
directory - runs pelican content
make html
Run the pelican server to view the site at http://localhost:8000/ - runs pelican --listen
make serve
Working on the theme
To be used by pelican the theme has to be installed see Pelican Themes docs
pelican-themes -i \path\to\theme
Then it can be added in pelicanconf.yml
Then the content can be generated
make html
So far I have had to remove then reinstall the theme and regenerate content to review changes but there may be a better way of editing the theme. Try:
make devserver
Stay in sync!
The content can be edited in the CMS, so git pull
frequently to stay in sync.
File Structure and configuration
pelicanconf.yml
is the main config file which can be overridden locally by pelicanconf-local.yml
. See pelicanconf-local.yml.example
Netlify CMS files are in content/admin. The CMS is a single page React app included from a CDN in /content/admin/index.html
. Netlify CMS is a generic CMS and is coupled to the structure and workflow of Pelican via config in /content/admin/config.yml
├── Makefile
├── README.md
├── content # THE CONTENT EDITED IN THE CMS
│ ├── admin # NETLIFY CMS
│ │ ├── config.yml # CONFIG FILE FOR NETLIFY CMS
│ │ └── index.html
│ ├── articles # ARTICLES FROM ANY CATEGORY
│ │ ├── ...
│ ├── extra # OTHER STATIC RESOURCES e.g favicon
│ │ └── ...
│ ├── images # UPLOADED IMAGES
│ │ ├── ...
│ └── pages # BASIC PAGES (NO CATEGORY)
│ └── ...
├── netlify-deploy.sh # DEPLOY SCRIPT CONFIGURED TO RUN ON DEPLOY IN NETLIFY
├── output # PUBLISHED WEB SITE
│ ├── ...
├── pelicanconf.py # MAIN PELICAN CONFIG
├── pelicanconf_local.example.py
├── pelicanconf_local.py # CREATE THIS FILE TO OVERRIDE CONFIG LOCALLY
├── plugins # PELICAN PLUGINS
│ └── i18n_subsites
│ ├── ...
├── publishconf.py
├── requirements.txt
├── tasks.py
└── themes # PELICAN THEMES
├── bootstrap-next # THEME BASE FOR BLOCKDOX.COM
│ ├── ...
TODO
Themes are from Pelican Themes
Plugins are from Pelican Plugins
These are copied and committed into the repo for now which is NAUGHTY. We should remove the plugins and themes and workout how to install them from git in the deploy script so that we don't have a copy of them in this repo.