Giter VIP home page Giter VIP logo

blot-theme-jot's Introduction

Blot Theme: Jot

This is my personal theme for Blot. It's a fork of the Index theme.

Features

  • Light and dark themes(!!)
  • Navigational keyboard shortcuts (h, j, k, and l)
  • Hash ids for each header
  • is-active class for active menu links
  • Outlined footnotes & refs when :targeted
  • Canonicalized URLs
  • OpenGraph image <meta> from thumbnails
  • Display last-modified date in entries
  • instant.page for just-in-time preloading
  • /tags page to list all tags
  • Non-permalink RSS <guid>s
  • CSS hyphenation
  • Deploy script

Screenshots

Blog Light

Blog Dark

Post Light

Post Dark

  • deploy.sh

    Changes I make directly to this codebase modify a "staging" template I have enabled in Blot. To "deploy", I use the deploy.sh script to move files into an adjacent directory that is the "live" template within Blot. This allows me to use template preview URLs to view any changes before they impact live visitors, in an ideal world.

  • screenshots.sh

    Generate the screenshots featured in this README.

License

Blot, including the base Index theme, is licensed by David Merfield under CC0.

Modifications by myself, Paul Esch-Laurent, are licensed under MIT.

blot-theme-jot's People

Contributors

pinjasaur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sdball

blot-theme-jot's Issues

Create `lint.sh` script leveraging `proselint` via `nix-shell`

Would like a scripts/lint.sh to do some basic linting on posts. Things like spelling and grammar. Also, checking external links if that's not a huge PITA.

I think I can simply start with proselint and that'll do enough to start. Plus, I've wanted to try it out for a while, see: https://paul.af/fosdem-2021

I'd like to try out Nix for this as well, using the #! nix-shell shebang:

`cuetip` integration

Currently import cuetip but could do better with how it's themed for the blog and likely dropping the use of the tails/triangles as the math for aligning them is finnicky across fonts and font sizes.

Starting with a customize request payload of:

{
  "vars": {
    "namespace": {
      "value": "tooltip",
      "type": "string"
    },
    "class-prefix": {
      "value": "tooltip--",
      "type": "string"
    },
    "no-tail": {
      "value": "no-tail",
      "type": "string"
    },
    "default-position": {
      "value": "top",
      "type": "string"
    },
    "has-tail": {
      "value": "false",
      "type": "boolean"
    },
    "cursor": {
      "value": "inherit",
      "type": "keyword"
    },
    "z-index": {
      "value": "9999",
      "type": "number"
    },
    "color-foreground": {
      "value": "var(--bg)",
      "type": "color"
    },
    "color-background": {
      "value": "var(--accent)",
      "type": "color"
    },
    "padding": {
      "value": ".25em .4em",
      "type": "units"
    },
    "border-radius": {
      "value": "2px",
      "type": "units"
    },
    "tail-size": {
      "value": ".25em",
      "type": "units"
    },
    "offset": {
      "value": ".1em",
      "type": "units"
    }
  }
}

and then supplement with a few additional lines of CSS should be a good starting point I would think:

[data-tooltip] {
  text-decoration: underline dotted;
}
abbr[data-tooltip] {
  cursor: help;
}
[data-tooltip]:after {
  font-size: 1em;
  opacity: .9;
}

There's a much larger conversation to be had w.r.t. a11y i.e., using aria-label (see Pinjasaur/cuetip#3). I'm not sure how much benefit I'm necessarily gaining over the builtin footnotes and attr[title] markup.

Create a script to check for 404s

I think I ultimately only care about internal 404s. I generally do a best-effort when hyperlinking i.e. deeplink to Git commits or Archive.org snapshots.

Kagi's FastGPT:

write me a shell script to check for internal 404s by crawling a given domain

Output:

Here is a shell script that can be used to check for internal 404 errors on a given domain:

#!/bin/bash

# Usage: ./check_404.sh <domain>
domain=$1

# Check if a domain was provided
if [ -z "$domain" ]; then
    echo "Usage: $0 <domain>"
    exit 1
fi

# Set the output file name
output_file="404_errors_$domain.txt"

# Crawl the website and save the output
wget --spider --recursive --level=5 --no-verbose --output-file=$output_file $domain 2>&1 | grep "404 Not Found"

# Check the output file for 404 errors
if [ -s "$output_file" ]; then
    echo "The following internal 404 errors were found on $domain:"
    cat $output_file
else
    echo "No internal 404 errors were found on $domain."
fi

# Clean up the output file
rm $output_file

Here's how the script works:

The script takes a domain as a command-line argument.
It sets the output file name based on the domain.
It uses the wget command to crawl the website recursively up to 5 levels, and saves the output to the output file.
The script then searches the output file for any lines containing "404 Not Found", which indicates a 404 error.
If any 404 errors are found, the script prints them to the console. Otherwise, it prints a message indicating that no 404 errors were found.
Finally, the script deletes the output file.

To use the script, save it to a file (e.g., check_404.sh) and make it executable with chmod +x check_404.sh. Then, run the script with the domain as an argument:

./check_404.sh example.com

This will check the example.com domain for internal 404 errors and print the results to the console.

Note that this script only checks for internal 404 errors (i.e., errors on pages within the same domain). To check for external 404 errors (i.e., broken links to other domains), you may need to use a more sophisticated tool or a different approach.

Enable HJKL Shortcuts

Shortcut breakdown:

  • h next post
  • j scroll down
  • k scroll up
  • l prev post

Could store setting for shortcuts are enabled in localStorage, similar to the site theme.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.