You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
4.0 KiB
96 lines
4.0 KiB
hi,
|
|
|
|
Now that we're writing articles and all..
|
|
this is my proposed approach to the new hbsc website, a static blog generated with pelican.
|
|
the advantages of this is that you create very fast, light websites and don't need to run any kind of CMS or other heavy stuff. Plus its a great way to over-engineer what could have been a very simple website.
|
|
|
|
it takes some getting used to, so here are some steps to get you going:
|
|
|
|
░█▀█░█░█░█▀▄░█░░░▀█▀░█▀▀░█░█░▀█▀░█▀█░█▀▀
|
|
░█▀▀░█░█░█▀▄░█░░░░█░░▀▀█░█▀█░░█░░█░█░█░█
|
|
░▀░░░▀▀▀░▀▀░░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀░▀░▀▀▀
|
|
workflow:
|
|
|
|
firstoff start by enabling the pelican virtualenv:
|
|
workon pelican
|
|
|
|
Follow this guide for setting up the virtualenv:
|
|
https://www.notionsandnotes.org/tech/web-development/pelican-static-blog-setup.html
|
|
|
|
If you run into any kind of problem where files / commands are missing, you're likely
|
|
not using the virtualenv. Deactive the virtualenv by running:
|
|
deactivate
|
|
|
|
write new posts by making new .md files in the directory
|
|
/opt/hbsc_site/raw/
|
|
|
|
If you wish to start from a template of a post:
|
|
cp /opt/hbsc_site/no_publish/template.md /opt/hbsc_site/raw/mypost.md
|
|
|
|
alternatively you can use make_post.py in /opt/hbsc_site/pelican to generate
|
|
a post template including dates like so:
|
|
python make_post.py hey_this_is_a_post
|
|
|
|
to generate the website go to hbsc_site/pelican and run:
|
|
make html
|
|
|
|
the files are written to /opt/hbsc_site/homebrewserver.club
|
|
|
|
if you're working on the theme it might be nice to open another terminal (login again or use screen/tmux) and run:
|
|
make regenerate
|
|
|
|
this will regenerate the website upon each file modification. very nice.
|
|
|
|
to finally publish:
|
|
make publish
|
|
|
|
this will copy the site to /var/www/html/
|
|
|
|
How to organize content:
|
|
raw/
|
|
├── extra <-- static stuff
|
|
│ └── robots.txt
|
|
├── fonts <-- static fonts
|
|
│ └── TerminusTTF-Italic-4.40.1.ttf
|
|
├── images <-- if you want images in your posts, add them here
|
|
│ └── myimage.png
|
|
├── pages <-- static pages
|
|
│ └── about.md
|
|
├── template.md <-- your posts
|
|
└── testing.md
|
|
|
|
|
|
|
|
░█▀▀░█░█░█▀█░▀█▀░█▀█░█░█
|
|
░▀▀█░░█░░█░█░░█░░█▀█░▄▀▄
|
|
░▀▀▀░░▀░░▀░▀░░▀░░▀░▀░▀░▀
|
|
|
|
You can write your posts either in markdown or restructured text.
|
|
|
|
For Markdown here's a useful cheatsheet:
|
|
https://sourceforge.net/p/pelican-edt/wiki/markdown_syntax/
|
|
|
|
further examples (of enabled plugins) are in /opt/hbsc_site/no_publish/template.md
|
|
|
|
|
|
|
|
|
|
░█▀▀░█▀▄░▀█▀░▀█▀░▀█▀░█▀█░█▀▀
|
|
░█▀▀░█░█░░█░░░█░░░█░░█░█░█░█
|
|
░▀▀▀░▀▀░░▀▀▀░░▀░░▀▀▀░▀░▀░▀▀▀
|
|
stuff:
|
|
|
|
change the template and css style by editing the files in
|
|
/opt/hbsc_site/pelican/themes/homebrewserver.club/
|
|
|
|
for things such as enabling plugins edit the conf files in
|
|
/opt/hbsc_site/pelican/
|
|
|
|
░▀█▀░█▄█░█▀█░█▀▄░█▀█░█░█░█▀▀░█▄█░█▀▀░█▀█░▀█▀
|
|
░░█░░█░█░█▀▀░█▀▄░█░█░▀▄▀░█▀▀░█░█░█▀▀░█░█░░█░
|
|
░▀▀▀░▀░▀░▀░░░▀░▀░▀▀▀░░▀░░▀▀▀░▀░▀░▀▀▀░▀░▀░░▀░
|
|
much room for it
|
|
|
|
like: lets track the whole thing with git?
|
|
I've added some stuff in the theme for syndication and SEO (see also: https://github.com/talha131/onCrashReboot/blob/master/content/Elegant%20-%20Pelican%20Theme/seo-social-media-tags.md)
|
|
this syndycation stuff can be found in /opt/hbsc_site/pelican/theme/homebrewserver.club/template/syndication.html
|
|
|