Thanks to visit codestin.com
Credit goes to github.com

Skip to content

pzelnip/www.codependentcodr.com

 
 

Repository files navigation

CodependentCodr - The Source

This is the source that powers https://www.codependentcodr.com

Overview

Site is generated using Pelican, and hosted in AWS.

Pelican Tidbits

By in large I just ran the pelican-quickstart and have tweaked a few things here and there as I work on the site. Some of the things I've changed that might be novel:

Tasks.json

Being a VS Code user, I created a tasks.json file which has a handful of tasks for things like starting the dev server, uploading to S3, etc.

Because of the way the project is set up you need the path to the virtual environment where pelican is installed (you need to be able to call the activate script in the virtual environment before the actual command). I created a config value in my workspace config for this called pelican.activatePath. This however, does give a warning in VS Code (since it's an "Unknown configuration setting"), but I can't think of a better way to have the tasks point at the virtual environment where Pelican is installed.

Linting

In the Makefile I added targets for running markdownlint and pylint. A push to S3 first runs these linters over the stuff in the repo and a non-zero result stops the deployment. While not as robust as a proper CI/CD pipeline with Jenkins or such, this is good enough for my needs and was super quick to set up.

Config for the markdown linter is in .markdownlint.json. For the most part I just added exceptions that were needed so that Pelican's metadata didn't trigger markdownlint warnings.

For Pylint I don't use any special config (just default out of the box config).

Dockerfile

To support the linting stuff, rather than enforcing I have the tools installed, I create a Docker image & install the tools to it. This means if you want to do the same all you need is Docker, no need for npm, etc.

The clean target of the Makefile also removes any previously built codependentcodr images.

AWS CLI

Instead of s3cmd (which is what the generated Makefile uses), I changed to use the AWS CLI because A) it's better, and B) I already had it installed.

Git SHA in Footer

I hacked together some stuff in pelicanconf.py to get the git SHA & throw it into a variable. This is then displayed in the page footer, which I find useful for sanity checking what revision is running.

Github Corners Configurable Colour

Flex (the theme I use) has support for Github Corners, but the colour isn't configurable. I modified the theme to use a config value GITHUB_CORNER_BG_COLOR which sets the background colour of the github corners icon (in my config I set it to the same value as the BG colour of buttons from the theme).

Hosting

As mentioned, I have the site set up in AWS. All the generated content goes into a S3 bucket, and then I have a Cloudfront distribution in front of that. I pretty much only have CF for the purposes of getting an SSL cert in place (I doubt I have many readers around the world, so not like I need a CDN). The cert is from AWS Certificate Manager. Unlike most tutorials (and probably to my detriment), I don't manage DNS with Route 53, but instead through the registrar I purchased the domain from (https://namecheap.com).

About

Website for www.codependentcodr.com

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •