From 85f2c8d0d69ac0195bf6a20e396077dee0e9aefa Mon Sep 17 00:00:00 2001 From: Bradley Taunt Date: Fri, 19 Jan 2024 13:19:41 -0500 Subject: Initial commit for new cgit platform --- pages/index.md | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++ pages/tweaks.md | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 185 insertions(+) create mode 100644 pages/index.md create mode 100644 pages/tweaks.md (limited to 'pages') diff --git a/pages/index.md b/pages/index.md new file mode 100644 index 0000000..c8b5eb2 --- /dev/null +++ b/pages/index.md @@ -0,0 +1,88 @@ +--- +title: pblog +toc: false +--- + +Peanut butter sandwich + +## Pandoc static blog generator + +`pblog` comes packed with an incredible list of features: + +- 5-second configuration +- Write all your posts and pages in Markdown +- Valid RSS 2.0 feed (customized design too!) + +and it also *doesn't* ship with a lot of other features: + +- No advanced template layouts +- No themes +- No categories / tagging systems +- No comments +- No auto rebuilds for local testing + +But you can add these things yourself with a little know-how and patience! The goal of `pblog` is to remain as bare-bones as possible, so these "extras" are left out intentionally. + +## Live Demo + +This very website is a live demo! Mind blowing, right? Take a look at the [automated blog list](/blog) to see some blog posts. + +## Requirements + +#### On MacOS / BSD Systems + +- [rsync](https://linux.die.net/man/1/rsync) +- [coreutils](https://www.gnu.org/software/coreutils/) +- [xsltproc](http://xmlsoft.org/xslt/xsltproc.html) +- [Pandoc](https://pandoc.org/installing.html) + +#### On Linux + +- [rsync](https://linux.die.net/man/1/rsync) +- [xsltproc](http://xmlsoft.org/xslt/xsltproc.html) +- [Pandoc](https://pandoc.org/installing.html) + +## Getting Started + +1. Clone the project repo: [https://git.sr.ht/~bt/pblog](https://git.sr.ht/~bt/pblog) +2. Edit the variables at the top of the `pblog.sh` file +3. **!! Pay close attention to the `OS` variable to set your correct operating system !!** +4. Edit the posts in `posts` and pages in `pages` to your own +5. Run `make` from the root directory +6. Upload the contents of the `_output` folder to your server +7. Profit!!! + +For a more in-depth look, take a look at the article [Introducing pblog](/blog/pblog-intro.html) + +## Base Settings + +#### Table of Contents + +By default `pblog` ships with TOC (Table of Contents) enabled. You can disable this on each individual page or post by editing the `TOC `variable in `pblog.sh` to `false`: + +```yaml +TOC: false +``` + +#### Code Highlighting + +`pblog` uses the standard syntax highlighting provided with Pandoc. To disable this, set the `SYNTAX` variable to `false` in `pblog.sh`: + +```yaml +SYNTAX: false +``` + +## Extras + +- Add all media files (images, videos, etc.) under the `media` folder +- Customize the look of your blog by editing the included `style.css` +- Looking for fancier *image manipulation*? Take a look at [this detailed post to get setup](/tweaks.html) + +You can share your **pblog** websites by emailing me at the address listed below and I'll add them here. + +brad at bt {dot} ht + +## Websites Using `pblog` + +- [pblog.bt.ht](https://pblog.bt.ht) (this site!) +- [ng5p.com](https://www.ng5p.com) diff --git a/pages/tweaks.md b/pages/tweaks.md new file mode 100644 index 0000000..a83e90d --- /dev/null +++ b/pages/tweaks.md @@ -0,0 +1,97 @@ +--- +title: Tweaks +toc: true +--- + +## Tweaks Explained + +"Tweaks" are extra features that are not packaged within the default `pblog` project. If you have your own tweaks you would like to include, be sure to [open a patch](https://git.sr.ht/~bt/pblog). + +--- + +
+ +## Magick Images + +#### by: [Matthew Graybosch](https://matthewgraybosch.com) + +This tweak gives you the ability to automatically convert PNG and JPG images to WEBP and AVIF files when used with the `picture` HTML element. + +**Requirements**: + +- Download and install [ImageMagick](https://imagemagick.org/script/download.php) + +Then change your base `makefile` to reflect the following: + +```bash +.SUFFIXES: .png .jpg .webp .avif + +.jpg.webp: + magick -quality 80 "$<" "$@" + +.jpg.avif: + magick -quality 80 "$<" "$@" + +.png.webp: + magick -quality 80 "$<" "$@" + +.png.avif: + magick -quality 80 "$<" "$@" + +JPEGS!=find media/ -name '*.jpg' +PNGS!=find media/ -name '*.png' + +JPEG_WEBP=${JPEGS:.jpg=.webp} +JPEG_AVIF=${JPEGS:.jpg=.avif} + +PNG_WEBP=${PNGS:.png=.webp} +PNG_AVIF=${PNGS:.png=.avif} + +.DEFAULT: build + +.PHONY: build +build: $(JPEG_WEBP) $(JPEG_AVIF) $(PNG_WEBP) $(PNG_AVIF) + bash pblog.sh > _output/feed.xml + xsltproc _output/feed.xml | tail -n +2 > _output/blog/index.html + +serve: build + python3 -m http.server --directory _output/ + +clean: + rm _output/* rss/* $(JPEG_WEBP) $(JPEG_AVIF) $(PNG_WEBP) $(PNG_AVIF) +``` + +That's it. Enjoy! + +--- + +
+ +## Hiding Table of Contents "Heading" + +#### by [Bradley Taunt](https://tdarb.org) + +By default the include *Table of Contents* displays a title and styled section. To disable this, simply edit the `style.css` file and comment out or delete the following: + +```css +#TOC { + border: 1px solid; + position: relative; +} +#TOC:before { + border-bottom: 1px solid; + content: 'Table of Contents'; + display: block; + font-weight: bold; + padding: 5px; + position: relative; +} +``` + +--- + +
+ +## Adding navigation to blog index and RSS feed + +In order to include any main navigation (or other custom elements for that matter) on the main blog index page and RSS `feed.xml`, simply edit the `rss.xml` file in the root directory. Be sure to add your elements / content inside the `body` tag near the bottom of the page. -- cgit v1.2.3-54-g00ecf