Abridge is a fast and lightweight Zola theme using semantic html, only ~6kb css before svg icons, no mandatory JS[*](https://github.com/Jieiku/abridge#contributing-and-philosophy), and perfect [Lighthouse](https://web.dev/measure/?url=https%3A%2F%2Fabridge.netlify.app) and [Observatory](https://observatory.mozilla.org/analyze/abridge.netlify.app) scores.
There is also an [Abridge-minimal](https://github.com/jieiku/abridge.css) Theme which is used to showcase the [abridge.css framework](https://github.com/Jieiku/abridge.css/tree/master/dist)
Maintainence of this project is made possible by all the <ahref="https://github.com/Jieiku/abridge/graphs/contributors">contributors</a> and <ahref="https://github.com/sponsors/Jieiku">sponsors</a>. If you'd like to sponsor this project and have your avatar or company logo appear below <ahref="https://github.com/sponsors/Jieiku">click here</a>. 💖
Abridge comes with two "Skins" each with their own auto, dark, and light modes.
Auto mode automatically displays a dark or light version depending on browser/OS settings.
The skin used on [the Demo](https://abridge.netlify.app/) uses primarily orange colors.
It is defined here: `/themes/abridge/sass/abridge.scss`
There is also other variations, that you will see defined in this same directory.
To change colors or fonts all you need to do is edit these files or duplicate them and create your own skin.
Then in the root of your site type `zola build` which will regenerate your site, this is similar to what zola serve does, except it does not facilitate serving the site.
Most Options in the config.toml are self documenting, meaning between the name of the config value and the notes in the file it is usually obvious what an option is for.
-`footer_credit_override` - Can be used to customize the footer credit, useful to add icons to the text, etc.
-`logo = { file="logo.svg", width="42", height="42", alt="Abridge", text="bridge" }` - Defines the graphical logo with optional text to follow the logo.
-`textlogo` - A purely Text based logo, this will be used if logo is commented out, if both are commented out then config.title is used.
-`security_header_referrer` - This is mostly used for tracking, the default is set to "strict-origin-when-cross-origin" [info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy)
-`banner` - Image to use in seo related cards, this will be the fallback image if the individual articles does not provide one, still a work in progress.
-`js_search_index = "search_index.en.js"` - The search index file to include in the header, comment out to disable.
-`js_search = "search.min.js"` - The search script file to include in the header, comment out to disable.
-`rss_atom_feed = "atom.xml"` - The atom.xml rss file to include in the header.
-`stylesheet = "abridge.css"` - The stylesheet file to include in the header.
-`fontawesome =` - Uncomment to enable fontawesome library, this will include the file in the header.
-`fonts =` - Uncomment to load external fonts, they will be loaded in the header.
-`math` - Set to true to load the Katex library, enabling the use of the [katex shortcode](https://abridge.netlify.app/overview-math/)
-`math_auto_render` - This allows you to define a section of math notation using only $$ $$ symbols instead of using the katex shortcode directly.
-`keywords =` - This is used for SEO.
-`seo =` - This is used for SEO, for the social media related tags, eg: opengraph, facebook, twitter if set to false it disables them all.
-`extra.social` - These are the options for the social icons in the footer, and a couple are also used in SEO related meta tags.
Most SEO Tags have been added as well as some important head tags for browser compatibility.
You can review the SEO tags in the head macro located at `templates/macros/head.html`, all configurable values should be in config.toml under config.extra or in the content markdown files.
In your post markdown file you should set a title less than 60 characters and a description between 80 and 160 characters in length. The description is what is displayed in search results below the page title. Anywhere that you do not set a page description, the primary site config.description will be used instead.
You should also set page specific keywords unless your keywords defined in config.toml suffice, any keywords that you add to the page are in addition to the ones defined in config.toml, so do not add those same keywords to your page keywords.
You can optionally also set a page specific image for search results by using page.extra.thumbnail. OpenGraph recommends 1200 x 630 (1.9:1). Twitter recommends 2:1 for large and 1:1 for small. If you do not set a page specific thumbnail then the banner defined in config.toml will be used instead.
Refer to [overview-images](https://raw.githubusercontent.com/Jieiku/abridge/master/content/overview-images/index.md) for an example:
```md
+++
title = "Image Shortcodes"
description = "Images can be embeded directly using markdown `![Ferris](ferris.svg)`, but using a shortcode prevents CLS by explicitly setting the width and height."
date = 2021-05-19
[taxonomies]
categories = ["Features"]
tags = ["shortcodes","images"]
[extra]
toc = true
keywords = "Image, Markdown, Shortcodes, Hover"
thumbnail = "ferris-gesture.png"
+++
```
There are tools you can use to test your page SEO metadata, such as: [smallseotools.com](https://smallseotools.com/meta-tags-analyzer/)
### KaTeX and CSP
KaTeX unfortunately requires `script-src 'unsafe-inline'` in the Content Security Policy. This is a security vulnerability, so the demo site will not render KaTeX correctly because the demo site uses best security practices.
KaTeX js is designed to work even with dynamic content, but because Zola is a SSG it seems to me the best solution is to avoid using this javascript all-together, process our markdown files similar to how KaTeX autorender does, but do it during zola build. insert some `<span class="KaTeX_Main">` ...etc so that we basically render it during the build process. If complex mathematics were part of my daily life then I might be motivated to write such code for Zola.
You will also see [this page](https://abridge.netlify.app/overview-math/) rendered correctly if you git clone this repo and use zola serve because then there will be no Content Security Policy in place.
Optionally you can serve a single js file for the search instead of a separate index by combining the two:
(although I am not sure how to accomplish this if your using the theme as a submodule, maybe you can use a git action for this command depending on your hosting provider.)