remove public dir
This commit is contained in:
parent
ea7537565c
commit
5136ca3e91
@ -1,228 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
|
||||
# This script takes a markdown post, crafts the corresponding URL, checks if it's accessible,
|
||||
# takes a screenshot, and saves it to a specified location.
|
||||
# It can update the front matter of the post with the path to the generated image (-u | --update-front-matter option).
|
||||
# It's meant to be used as a pre-commit hook to generate social media cards for Zola sites using the tabi theme.
|
||||
# More details: https://osc.garden/blog/automating-social-media-cards-zola/
|
||||
|
||||
function help_function(){
|
||||
echo "This script automates the creation of social media cards for Zola websites."
|
||||
echo "It takes a Markdown post and saves its live screenshot to a specified location."
|
||||
echo ""
|
||||
echo "IMPORTANT! It needs to be run from the root of the Zola site."
|
||||
echo ""
|
||||
echo "Usage: social-cards-zola [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " -h, --help Show this help message and exit."
|
||||
echo " -b, --base_url URL The base URL where the Zola site is hosted. Default is http://127.0.0.1:1111."
|
||||
echo " -i, --input INPUT_PATH The relative path to the markdown file of the post/section you want to capture. Should be in the format 'content/blog/post_name.language.md'."
|
||||
echo " -k, --key KEY The front matter key to update. Default is 'social_media_card'."
|
||||
echo " -o, --output_path PATH The directory where the generated image will be saved."
|
||||
echo " -p, --print_output Print the path to the resulting screenshot at the end."
|
||||
echo " -u, --update-front-matter Update or add the 'social_media_card' key in the front matter of the Markdown file."
|
||||
echo
|
||||
echo "Examples:"
|
||||
echo " social-cards-zola --base_url https://example.com --input content/blog/my_post.md --output_path static/img/social_cards"
|
||||
echo " social-cards-zola -u -b http://127.0.0.1:1025 -i content/archive/_index.es.md -o static/img"
|
||||
exit 0
|
||||
}
|
||||
|
||||
function convert_filename_to_url() {
|
||||
# Remove .md extension.
|
||||
local post_name="${1%.md}"
|
||||
|
||||
# Remove "content/" prefix.
|
||||
local url="${post_name#content/}"
|
||||
|
||||
# Extract language code.
|
||||
local lang_code="${url##*.}"
|
||||
if [[ "$lang_code" == "$url" ]]; then
|
||||
lang_code="" # No language code.
|
||||
else
|
||||
lang_code="${lang_code}/" # Add trailing slash.
|
||||
url="${url%.*}" # Remove the language code from the URL.
|
||||
fi
|
||||
|
||||
# Handle co-located index.md by stripping it and using the directory as the URL.
|
||||
if [[ "$url" == */index ]]; then
|
||||
url="${url%/*}" # Remove the /index suffix.
|
||||
fi
|
||||
|
||||
# Remove "_index" suffix.
|
||||
if [[ "$url" == *"_index"* ]]; then
|
||||
url="${url%%_index*}"
|
||||
fi
|
||||
|
||||
# Return the final URL with a single trailing slash.
|
||||
full_url="${lang_code}${url}"
|
||||
echo "${full_url%/}/"
|
||||
}
|
||||
|
||||
function error_exit() {
|
||||
echo "ERROR: $1" >&2
|
||||
exit "${2:-1}"
|
||||
}
|
||||
|
||||
function validate_input_params() {
|
||||
missing_params=()
|
||||
if [[ -z "$base_url" ]]; then
|
||||
missing_params+=("base_url")
|
||||
fi
|
||||
if [[ -z "$input" ]]; then
|
||||
missing_params+=("input")
|
||||
fi
|
||||
if [[ -z "$output_path" ]]; then
|
||||
missing_params+=("output_path")
|
||||
fi
|
||||
|
||||
if [ ${#missing_params[@]} -ne 0 ]; then
|
||||
error_exit "The following required settings are missing: ${missing_params[*]}. Use -h or --help for usage."
|
||||
fi
|
||||
}
|
||||
|
||||
function check_dependencies() {
|
||||
for cmd in "curl" "shot-scraper"; do
|
||||
if ! command -v $cmd &> /dev/null; then
|
||||
error_exit "$cmd could not be found. Please install it."
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function fetch_status() {
|
||||
local retry_count=0
|
||||
local max_retries=5
|
||||
local status
|
||||
while [[ $retry_count -lt $max_retries ]]; do
|
||||
status=$(curl -s -o /dev/null -I -w "%{http_code}" "${base_url}${post_url}")
|
||||
if [[ "$status" -eq "200" ]]; then
|
||||
return
|
||||
fi
|
||||
retry_count=$((retry_count + 1))
|
||||
sleep 2
|
||||
done
|
||||
error_exit "Post $input is not accessible. Max retries ($max_retries) reached."
|
||||
}
|
||||
|
||||
function capture_screenshot() {
|
||||
temp_file=$(mktemp /tmp/social-zola.XXXXXX)
|
||||
trap 'rm -f "$temp_file"' EXIT
|
||||
shot-scraper --silent "${base_url}/${post_url}" -w 700 -h 400 --retina --quality 60 -o "$temp_file"
|
||||
}
|
||||
|
||||
function move_file() {
|
||||
local safe_filename=$(echo "${post_url%/}" | sed 's/[^a-zA-Z0-9]/_/g')
|
||||
|
||||
# Create the output directory if it doesn't exist.
|
||||
mkdir -p "$output_path"
|
||||
|
||||
image_filename="${output_path}/${safe_filename:-index}.jpg" # If the filename is empty, use "index".
|
||||
mv "$temp_file" "$image_filename" || error_exit "Failed to move the file to $image_filename"
|
||||
}
|
||||
|
||||
function update_front_matter {
|
||||
local md_file_path="$1"
|
||||
local image_output="${2#static/}"
|
||||
# Temporary file for awk processing
|
||||
temp_awk=$(mktemp /tmp/frontmatter.XXXXXX)
|
||||
|
||||
awk -v card_path="$image_output" '
|
||||
# Initialize flags for tracking state.
|
||||
BEGIN { in_extra=done=front_matter=extra_exists=0; }
|
||||
|
||||
# Function to insert the social_media_card path.
|
||||
function insert_card() { print "social_media_card = \"" card_path "\""; done=1; }
|
||||
|
||||
{
|
||||
# If card has been inserted, simply output remaining lines.
|
||||
if (done) { print; next; }
|
||||
|
||||
# Toggle front_matter flag at its start, denoted by +++
|
||||
if (/^\+\+\+/ && front_matter == 0) {
|
||||
front_matter = 1;
|
||||
print "+++";
|
||||
next;
|
||||
}
|
||||
|
||||
# Detect [extra] section and set extra_exists flag.
|
||||
if (/^\[extra\]/) { in_extra=1; extra_exists=1; print; next; }
|
||||
|
||||
# Update existing social_media_card.
|
||||
if (in_extra && /^social_media_card =/) { insert_card(); in_extra=0; next; }
|
||||
|
||||
# End of front matter or start of new section.
|
||||
if (in_extra && (/^\[[a-zA-Z_-]+\]/ || (/^\+\+\+/ && front_matter == 1))) {
|
||||
insert_card(); # Add the missing social_media_card.
|
||||
in_extra=0;
|
||||
}
|
||||
|
||||
# Insert missing [extra] section.
|
||||
if (/^\+\+\+/ && front_matter == 1 && in_extra == 0 && extra_exists == 0) {
|
||||
print "\n[extra]";
|
||||
insert_card();
|
||||
in_extra=0;
|
||||
front_matter = 0;
|
||||
print "+++";
|
||||
next;
|
||||
}
|
||||
|
||||
# Print all other lines as-is.
|
||||
print;
|
||||
}' "$md_file_path" > "$temp_awk"
|
||||
|
||||
# Move the temporary file back to the original markdown file.
|
||||
mv "$temp_awk" "$md_file_path"
|
||||
}
|
||||
|
||||
function main() {
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
help_function;;
|
||||
-b|--base_url)
|
||||
base_url="$2"
|
||||
shift 2;;
|
||||
-i|--input)
|
||||
input="$2"
|
||||
shift 2;;
|
||||
-o|--output_path)
|
||||
output_path="$2"
|
||||
shift 2;;
|
||||
-k|--key)
|
||||
front_matter_key="$2"
|
||||
shift 2;;
|
||||
-u|--update-front-matter)
|
||||
update="true"
|
||||
shift 1;;
|
||||
-p|--print_output)
|
||||
print_output="true"
|
||||
shift 1;;
|
||||
*)
|
||||
error_exit "Unknown option: $1";;
|
||||
esac
|
||||
done
|
||||
|
||||
validate_input_params
|
||||
check_dependencies
|
||||
|
||||
: "${base_url:="http://127.0.0.1:1111"}"
|
||||
: "${front_matter_key:="social_media_card"}"
|
||||
base_url="${base_url%/}/" # Ensure one trailing slash.
|
||||
post_url="$(convert_filename_to_url "$input")"
|
||||
|
||||
fetch_status
|
||||
capture_screenshot
|
||||
move_file
|
||||
|
||||
if [[ "$update" == "true" ]]; then
|
||||
update_front_matter "$input" "$image_filename"
|
||||
fi
|
||||
|
||||
if [[ "$print_output" == "true" ]]; then
|
||||
echo "$image_filename"
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
@ -1,250 +0,0 @@
|
||||
/*
|
||||
* theme "Dracula" generated by syntect
|
||||
*/
|
||||
|
||||
.z-code {
|
||||
color: #f8f8f2;
|
||||
background-color: #282a36;
|
||||
}
|
||||
|
||||
.z-comment {
|
||||
color: #6272a4;
|
||||
}
|
||||
.z-string {
|
||||
color: #f1fa8c;
|
||||
}
|
||||
.z-constant.z-numeric {
|
||||
color: #bd93f9;
|
||||
}
|
||||
.z-constant.z-language {
|
||||
color: #bd93f9;
|
||||
}
|
||||
.z-constant.z-character, .z-constant.z-other {
|
||||
color: #bd93f9;
|
||||
}
|
||||
.z-variable {
|
||||
}
|
||||
.z-variable.z-other.z-readwrite.z-instance {
|
||||
color: #ffb86c;
|
||||
}
|
||||
.z-constant.z-character.z-escaped, .z-constant.z-character.z-escape, .z-string .z-source, .z-string .z-source.z-ruby {
|
||||
color: #ff79c6;
|
||||
}
|
||||
.z-source.z-ruby .z-string.z-regexp.z-classic.z-ruby, .z-source.z-ruby .z-string.z-regexp.z-mod-r.z-ruby {
|
||||
color: #ff5555;
|
||||
}
|
||||
.z-keyword {
|
||||
color: #ff79c6;
|
||||
}
|
||||
.z-storage {
|
||||
color: #ff79c6;
|
||||
}
|
||||
.z-storage.z-type {
|
||||
color: #8be9fd;
|
||||
font-style: italic;
|
||||
}
|
||||
.z-storage.z-type.z-namespace {
|
||||
color: #8be9fd;
|
||||
font-style: italic;
|
||||
}
|
||||
.z-storage.z-type.z-class {
|
||||
color: #ff79c6;
|
||||
font-style: italic;
|
||||
}
|
||||
.z-entity.z-name.z-class {
|
||||
color: #8be9fd;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.z-meta.z-path {
|
||||
color: #66d9ef;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.z-entity.z-other.z-inherited-class {
|
||||
color: #8be9fd;
|
||||
text-decoration: underline;
|
||||
font-style: italic;
|
||||
}
|
||||
.z-entity.z-name.z-function {
|
||||
color: #50fa7b;
|
||||
}
|
||||
.z-variable.z-parameter {
|
||||
color: #ffb86c;
|
||||
font-style: italic;
|
||||
}
|
||||
.z-entity.z-name.z-tag {
|
||||
color: #ff79c6;
|
||||
}
|
||||
.z-entity.z-other.z-attribute-name {
|
||||
color: #50fa7b;
|
||||
}
|
||||
.z-support.z-function {
|
||||
color: #8be9fd;
|
||||
}
|
||||
.z-support.z-constant {
|
||||
color: #6be5fd;
|
||||
}
|
||||
.z-support.z-type, .z-support.z-class {
|
||||
color: #66d9ef;
|
||||
font-style: italic;
|
||||
}
|
||||
.z-support.z-other.z-variable {
|
||||
}
|
||||
.z-support.z-other.z-namespace {
|
||||
color: #66d9ef;
|
||||
font-style: italic;
|
||||
}
|
||||
.z-invalid {
|
||||
color: #f8f8f0;
|
||||
background-color: #ff79c6;
|
||||
}
|
||||
.z-invalid.z-deprecated {
|
||||
color: #f8f8f0;
|
||||
background-color: #bd93f9;
|
||||
}
|
||||
.z-meta.z-structure.z-dictionary.z-json .z-string.z-quoted.z-double.z-json {
|
||||
color: #cfcfc2;
|
||||
}
|
||||
.z-meta.z-diff, .z-meta.z-diff.z-header {
|
||||
color: #6272a4;
|
||||
}
|
||||
.z-markup.z-deleted {
|
||||
color: #ff79c6;
|
||||
}
|
||||
.z-markup.z-inserted {
|
||||
color: #50fa7b;
|
||||
}
|
||||
.z-markup.z-changed {
|
||||
color: #e6db74;
|
||||
}
|
||||
.z-constant.z-numeric.z-line-number.z-find-in-files {
|
||||
color: #bd93f9;
|
||||
}
|
||||
.z-entity.z-name.z-filename {
|
||||
color: #e6db74;
|
||||
}
|
||||
.z-message.z-error {
|
||||
color: #f83333;
|
||||
}
|
||||
.z-punctuation.z-definition.z-string.z-begin.z-json, .z-punctuation.z-definition.z-string.z-end.z-json {
|
||||
color: #eeeeee;
|
||||
}
|
||||
.z-meta.z-structure.z-dictionary.z-json .z-string.z-quoted.z-double.z-json {
|
||||
color: #8be9fd;
|
||||
}
|
||||
.z-meta.z-structure.z-dictionary.z-value.z-json .z-string.z-quoted.z-double.z-json {
|
||||
color: #f1fa8c;
|
||||
}
|
||||
.z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-value .z-string {
|
||||
color: #50fa7b;
|
||||
}
|
||||
.z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-value .z-string {
|
||||
color: #ffb86c;
|
||||
}
|
||||
.z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-value .z-string {
|
||||
color: #ff79c6;
|
||||
}
|
||||
.z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-value .z-string {
|
||||
color: #bd93f9;
|
||||
}
|
||||
.z-meta .z-meta .z-meta.z-structure.z-dictionary.z-value .z-string {
|
||||
color: #50fa7b;
|
||||
}
|
||||
.z-meta .z-meta.z-structure.z-dictionary.z-value .z-string {
|
||||
color: #ffb86c;
|
||||
}
|
||||
.z-markup.z-strike {
|
||||
color: #ffb86c;
|
||||
font-style: italic;
|
||||
}
|
||||
.z-markup.z-bold {
|
||||
color: #ffb86c;
|
||||
font-weight: bold;
|
||||
}
|
||||
.z-markup.z-italic {
|
||||
color: #ffb86c;
|
||||
font-style: italic;
|
||||
}
|
||||
.z-markup.z-heading {
|
||||
color: #8be9fd;
|
||||
}
|
||||
.z-punctuation.z-definition.z-list_item.z-markdown {
|
||||
color: #ff79c6;
|
||||
}
|
||||
.z-markup.z-quote {
|
||||
color: #6272a4;
|
||||
font-style: italic;
|
||||
}
|
||||
.z-punctuation.z-definition.z-blockquote.z-markdown {
|
||||
color: #6272a4;
|
||||
background-color: #6272a4;
|
||||
font-style: italic;
|
||||
}
|
||||
.z-meta.z-separator {
|
||||
color: #6272a4;
|
||||
}
|
||||
.z-text.z-html.z-markdown .z-markup.z-raw.z-inline {
|
||||
color: #50fa7b;
|
||||
}
|
||||
.z-markup.z-underline {
|
||||
color: #bd93f9;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.z-markup.z-raw.z-block {
|
||||
color: #cfcfc2;
|
||||
}
|
||||
.z-markup.z-raw.z-block.z-fenced.z-markdown .z-source {
|
||||
color: #f8f8f2;
|
||||
}
|
||||
.z-punctuation.z-definition.z-fenced.z-markdown, .z-variable.z-language.z-fenced.z-markdown {
|
||||
color: #6272a4;
|
||||
font-style: italic;
|
||||
}
|
||||
.z-variable.z-language.z-fenced.z-markdown {
|
||||
color: #6272a4;
|
||||
font-style: italic;
|
||||
}
|
||||
.z-punctuation.z-accessor {
|
||||
color: #ff79c6;
|
||||
}
|
||||
.z-meta.z-function.z-return-type {
|
||||
color: #ff79c6;
|
||||
}
|
||||
.z-punctuation.z-section.z-block.z-begin {
|
||||
color: #ffffff;
|
||||
}
|
||||
.z-punctuation.z-section.z-block.z-end {
|
||||
color: #ffffff;
|
||||
}
|
||||
.z-punctuation.z-section.z-embedded.z-begin {
|
||||
color: #ff79c6;
|
||||
}
|
||||
.z-punctuation.z-section.z-embedded.z-end {
|
||||
color: #ff79c6;
|
||||
}
|
||||
.z-punctuation.z-separator.z-namespace {
|
||||
color: #ff79c6;
|
||||
}
|
||||
.z-variable.z-function {
|
||||
color: #50fa7b;
|
||||
}
|
||||
.z-variable.z-other {
|
||||
color: #ffffff;
|
||||
}
|
||||
.z-variable.z-language {
|
||||
color: #bd93f9;
|
||||
}
|
||||
.z-entity.z-name.z-module.z-ruby {
|
||||
color: #8be9fd;
|
||||
}
|
||||
.z-entity.z-name.z-constant.z-ruby {
|
||||
color: #bd93f9;
|
||||
}
|
||||
.z-support.z-function.z-builtin.z-ruby {
|
||||
color: #ffffff;
|
||||
}
|
||||
.z-storage.z-type.z-namespace.z-cs {
|
||||
color: #ff79c6;
|
||||
}
|
||||
.z-entity.z-name.z-namespace.z-cs {
|
||||
color: #8be9fd;
|
||||
}
|
File diff suppressed because one or more lines are too long
10
public/elasticlunr.min.js
vendored
10
public/elasticlunr.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,119 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom" xmlns:tabi="https://github.com/welpo/tabi">
|
||||
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
|
||||
<xsl:template match="/">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<xsl:attribute name="data-theme">
|
||||
<xsl:value-of select="/atom:feed/tabi:metadata/tabi:default_theme"/>
|
||||
</xsl:attribute>
|
||||
<head>
|
||||
<title>
|
||||
<xsl:value-of select="/atom:feed/atom:title"/> • Feed
|
||||
</title>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<xsl:variable name="baseUrl" select="/atom:feed/tabi:metadata/tabi:base_url"/>
|
||||
<link rel="stylesheet" href="{$baseUrl}/main.css"/>
|
||||
<link rel="stylesheet" href="{/atom:feed/atom:link[@rel='extra-stylesheet']/@href}" />
|
||||
|
||||
</head>
|
||||
<body dir="auto">
|
||||
<div class="content">
|
||||
<main>
|
||||
<div class="info-box">
|
||||
<!-- This block replaces the text "About Feeds" with a hyperlink in the translated string -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(/atom:feed/tabi:metadata/tabi:about_feeds, 'About Feeds')">
|
||||
<xsl:value-of select="substring-before(/atom:feed/tabi:metadata/tabi:about_feeds, 'About Feeds')"/>
|
||||
<a href="https://aboutfeeds.com/" target="_blank">About Feeds</a>
|
||||
<xsl:value-of select="substring-after(/atom:feed/tabi:metadata/tabi:about_feeds, 'About Feeds')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="/atom:feed/tabi:metadata/tabi:about_feeds"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</div>
|
||||
<section id="banner-home-subtitle">
|
||||
<div class="padding-top home-title">
|
||||
<xsl:value-of select="/atom:feed/atom:title"/>
|
||||
</div>
|
||||
<p>
|
||||
<xsl:value-of select="/atom:feed/atom:subtitle"/>
|
||||
</p>
|
||||
<a class="readmore">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="/atom:feed/atom:link[@rel='alternate']/@href"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="/atom:feed/tabi:metadata/tabi:visit_the_site" />
|
||||
<xsl:if test="/atom:feed/tabi:metadata/tabi:current_section != /atom:feed/atom:title">
|
||||
<xsl:text>: </xsl:text>
|
||||
<xsl:value-of select="/atom:feed/tabi:metadata/tabi:current_section" />
|
||||
</xsl:if>
|
||||
<span class="arrow"> →</span>
|
||||
</a>
|
||||
<p></p>
|
||||
</section>
|
||||
<div class="padding-top listing-title bottom-divider">
|
||||
<h1><xsl:value-of select="/atom:feed/tabi:metadata/tabi:recent_posts" /></h1>
|
||||
</div>
|
||||
<xsl:variable name="post_listing_date" select="/atom:feed/tabi:metadata/tabi:post_listing_date"/>
|
||||
<div class="bloglist-container">
|
||||
<xsl:for-each select="/atom:feed/atom:entry">
|
||||
<section class="bloglist-meta bottom-divider">
|
||||
<ul>
|
||||
<xsl:variable name="show_date" select="$post_listing_date = 'date' or $post_listing_date = 'both'"/>
|
||||
<xsl:variable name="show_updated" select="$post_listing_date = 'updated' or $post_listing_date = 'both'"/>
|
||||
|
||||
<xsl:if test="$show_date">
|
||||
<li class="date">
|
||||
<xsl:value-of select="substring(atom:published, 0, 11)"/>
|
||||
</li>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$show_date and $show_updated">
|
||||
<li class="mobile-only">
|
||||
<xsl:value-of select="/atom:feed/tabi:metadata/tabi:separator"/>
|
||||
</li>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$show_updated">
|
||||
<li class="date">
|
||||
<xsl:variable name="update_string" select="/atom:feed/tabi:metadata/tabi:last_updated_on"/>
|
||||
<xsl:variable name="update_date" select="substring(atom:updated, 0, 11)"/>
|
||||
<xsl:value-of select="substring-before($update_string, '$DATE')"/>
|
||||
<xsl:value-of select="$update_date"/>
|
||||
<xsl:value-of select="substring-after($update_string, '$DATE')"/>
|
||||
</li>
|
||||
</xsl:if>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="bloglist-content bottom-divider">
|
||||
<div>
|
||||
<div class="bloglist-title">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="atom:link/@href"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="atom:title"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="description">
|
||||
<xsl:value-of select="atom:summary"/>
|
||||
</div>
|
||||
<a class="readmore" href="">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="atom:link/@href"/>
|
||||
</xsl:attribute>
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
</xsl:for-each>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 18 KiB |
Binary file not shown.
Before Width: | Height: | Size: 15 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
375
public/isso.css
375
public/isso.css
@ -1,375 +0,0 @@
|
||||
/* ========================================================================== */
|
||||
/* Generic styling */
|
||||
/* ========================================================================== */
|
||||
#isso-thread * {
|
||||
/* Reset */
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Thread heading area */
|
||||
/* ========================================================================== */
|
||||
#isso-thread {
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
color: var(--text-color);
|
||||
font-size: 0.9em;
|
||||
font-family: var(--sans-serif-font);
|
||||
}
|
||||
|
||||
h4.isso-thread-heading {
|
||||
padding-bottom: 0.2em;
|
||||
color: var(--text-color);
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.isso-feedlink {
|
||||
float: inline-end;
|
||||
padding-inline-start: 1em;
|
||||
}
|
||||
|
||||
.isso-feedlink a {
|
||||
vertical-align: bottom;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Comments */
|
||||
/* ========================================================================== */
|
||||
|
||||
.isso-comment {
|
||||
margin: 0 auto;
|
||||
max-width: 68em;
|
||||
}
|
||||
|
||||
.isso-preview .isso-comment {
|
||||
margin: 0;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.isso-comment:not(:first-of-type),
|
||||
.isso-follow-up .isso-comment {
|
||||
margin-block-end: 0.5em;
|
||||
border-top: 1px solid var(--divider-color);
|
||||
}
|
||||
|
||||
.isso-avatar {
|
||||
display: block;
|
||||
float: inline-start;
|
||||
margin: 0.95em 0.95em 0;
|
||||
}
|
||||
|
||||
.isso-avatar svg {
|
||||
border: 1px solid var(--divider-color);
|
||||
border-radius: 3px;
|
||||
width: 100%;
|
||||
max-width: 48px;
|
||||
height: 100%;
|
||||
max-height: 48px;
|
||||
}
|
||||
|
||||
.isso-text-wrapper {
|
||||
display: block;
|
||||
padding: 0.3em;
|
||||
}
|
||||
|
||||
.isso-follow-up {
|
||||
padding-inline-start: calc(7% + 20px);
|
||||
}
|
||||
|
||||
.isso-comment-footer {
|
||||
font-size: 0.95em;
|
||||
}
|
||||
|
||||
.isso-comment-header {
|
||||
font-size: 0.85em;
|
||||
}
|
||||
|
||||
.isso-comment-header a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Only for comment header, spacer between up-/downvote should have no padding */
|
||||
.isso-comment-header .isso-spacer {
|
||||
padding-inline: 6px;
|
||||
}
|
||||
|
||||
.isso-spacer,
|
||||
.isso-permalink,
|
||||
.isso-note,
|
||||
.isso-parent {
|
||||
color: var(--meta-color);
|
||||
font-weight: normal;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.isso-permalink:hover,
|
||||
.isso-note:hover,
|
||||
.isso-parent:hover {
|
||||
color: var(--hover-color);
|
||||
}
|
||||
|
||||
.isso-note {
|
||||
float: inline-end;
|
||||
}
|
||||
|
||||
.isso-author {
|
||||
color: var(--text-color);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.isso-page-author-suffix {
|
||||
color: var(--text-color-high-contrast);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Style author comments and replies */
|
||||
.isso-is-page-author>.isso-text-wrapper {
|
||||
background-color: var(--bg-1);
|
||||
}
|
||||
|
||||
.isso-textarea,
|
||||
.isso-preview {
|
||||
background-color: var(--bg-2);
|
||||
padding: 10px;
|
||||
width: 100%;
|
||||
color: var(--text-color);
|
||||
font-size: 0.8em;
|
||||
font-family: var(--sans-serif-font);
|
||||
}
|
||||
|
||||
.isso-text p {
|
||||
margin-top: -0.4em;
|
||||
}
|
||||
|
||||
.isso-text p:last-child {
|
||||
margin-block-end: 0.2em;
|
||||
}
|
||||
|
||||
.isso-text h1,
|
||||
.isso-text h2,
|
||||
.isso-text h3,
|
||||
.isso-text h4,
|
||||
.isso-text h5,
|
||||
.isso-text h6 {
|
||||
font-weight: bold;
|
||||
font-size: 130%;
|
||||
}
|
||||
|
||||
.isso-comment-footer {
|
||||
clear: left;
|
||||
color: var(--meta-color);
|
||||
font-size: 0.80em;
|
||||
}
|
||||
|
||||
.isso-feedlink,
|
||||
.isso-comment-footer a {
|
||||
margin: 0.4em;
|
||||
padding: 0.1em;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.isso-comment-footer .isso-votes {
|
||||
color: var(--meta-color);
|
||||
}
|
||||
|
||||
.isso-upvote svg,
|
||||
.isso-downvote svg {
|
||||
position: relative;
|
||||
top: .2em;
|
||||
}
|
||||
|
||||
.isso-upvote:hover svg,
|
||||
.isso-downvote:hover svg {
|
||||
fill: var(--hover-color);
|
||||
}
|
||||
|
||||
/* Reply postbox under existing comment */
|
||||
.isso-comment .isso-postbox {
|
||||
margin-top: 0.8em;
|
||||
}
|
||||
|
||||
.isso-comment.isso-no-votes>*>.isso-comment-footer .isso-votes {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Postbox */
|
||||
/* ========================================================================== */
|
||||
.isso-postbox {
|
||||
clear: right;
|
||||
margin: 0 auto 2em;
|
||||
}
|
||||
|
||||
.isso-form-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.isso-textarea,
|
||||
.isso-preview {
|
||||
margin-top: 0.2em;
|
||||
border: 1px solid var(--divider-color);
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.isso-textarea {
|
||||
outline: 0;
|
||||
width: 100%;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.isso-form-wrapper input[type=checkbox] {
|
||||
position: relative;
|
||||
bottom: 1px;
|
||||
vertical-align: middle;
|
||||
margin-inline-end: 0;
|
||||
}
|
||||
|
||||
.isso-notification-section {
|
||||
display: none;
|
||||
padding-top: .3em;
|
||||
padding-bottom: 10px;
|
||||
font-size: 0.90em;
|
||||
}
|
||||
|
||||
.isso-auth-section {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.isso-input-wrapper,
|
||||
.isso-post-action {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin: 0 auto;
|
||||
max-width: 35%;
|
||||
font-size: 0.8em;
|
||||
font-family: var(--sans-serif-font);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.isso-input-wrapper {
|
||||
margin-inline-end: 0.5em;
|
||||
}
|
||||
|
||||
.isso-input-wrapper input,
|
||||
.isso-post-action input {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.isso-input-wrapper label {
|
||||
display: inline-block;
|
||||
margin-top: auto;
|
||||
height: auto;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
.isso-input-wrapper input {
|
||||
border: 1px solid var(--divider-color);
|
||||
border-radius: 5px;
|
||||
background-color: var(--bg-2);
|
||||
padding: 0.3em;
|
||||
width: 100%;
|
||||
color: var(--text-color);
|
||||
line-height: 1.2em;
|
||||
font-family: var(--sans-serif-font);
|
||||
}
|
||||
|
||||
.isso-post-action input {
|
||||
cursor: pointer;
|
||||
margin: 0.1em;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
background-color: var(--primary-color);
|
||||
padding-inline: 1em;
|
||||
padding-block: 0.6em;
|
||||
color: var(--background-color);
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.isso-post-action {
|
||||
display: block;
|
||||
align-self: flex-end;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.isso-post-action>input:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Postbox (preview mode) */
|
||||
/* ========================================================================== */
|
||||
.isso-preview,
|
||||
.isso-post-action input[name="edit"],
|
||||
.isso-postbox.isso-preview-mode>.isso-form-wrapper input[name="preview"],
|
||||
.isso-postbox.isso-preview-mode>.isso-form-wrapper .isso-textarea {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.isso-postbox.isso-preview-mode>.isso-form-wrapper .isso-preview {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.isso-postbox.isso-preview-mode>.isso-form-wrapper input[name="edit"] {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.isso-preview {
|
||||
background: repeating-linear-gradient(-45deg,
|
||||
var(--bg-0),
|
||||
var(--bg-0) 10px,
|
||||
var(--bg-2) 10px,
|
||||
var(--bg-2) 20px);
|
||||
background-color: var(--bg-0);
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Animations */
|
||||
/* ========================================================================== */
|
||||
|
||||
/* "target" means the comment that's being linked to, for example:
|
||||
* https://example.com/blog/example/#isso-15
|
||||
*/
|
||||
.isso-target {
|
||||
animation: isso-target-fade 5s ease-out;
|
||||
}
|
||||
|
||||
@keyframes isso-target-fade {
|
||||
0% {
|
||||
background-color: var(--divider-color)
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Media queries */
|
||||
/* ========================================================================== */
|
||||
@media screen and (max-width:600px) {
|
||||
.isso-auth-section {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.isso-input-wrapper {
|
||||
display: block;
|
||||
margin: 0 0 .4em;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.isso-input-wrapper input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.isso-post-action {
|
||||
margin: 0.4em auto;
|
||||
width: 60%;
|
||||
}
|
||||
}
|
1
public/isso.min.css
vendored
1
public/isso.min.css
vendored
@ -1 +0,0 @@
|
||||
.isso-avatar svg,.isso-preview,.isso-textarea{border:1px solid var(--divider-color);width:100%}#isso-thread *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#isso-thread{margin:0 auto;padding:0;width:100%;color:var(--text-color);font-size:.9em;font-family:var(--sans-serif-font)}h4.isso-thread-heading{padding-bottom:.2em;color:var(--text-color);font-size:1.2rem}.isso-feedlink,.isso-note{float:right}.isso-feedlink a{vertical-align:bottom;font-size:.8em}.isso-comment{margin:0 auto;max-width:68em}.isso-preview .isso-comment{margin:0;padding-top:0}.isso-comment:not(:first-of-type),.isso-follow-up .isso-comment{margin-bottom:.5em;border-top:1px solid var(--divider-color)}.isso-avatar{display:block;float:left;margin:.95em .95em 0}.isso-avatar svg{border-radius:3px;max-width:48px;height:100%;max-height:48px}.isso-text-wrapper{display:block;padding:.3em}.isso-follow-up{padding-inline-start:calc(7% + 20px)}.isso-comment-header{font-size:.85em}.isso-comment-header a{text-decoration:none}.isso-comment-header .isso-spacer{padding:0 6px}.isso-note,.isso-parent,.isso-permalink,.isso-spacer{color:var(--meta-color);font-weight:400;text-shadow:none}.isso-note:hover,.isso-parent:hover,.isso-permalink:hover{color:var(--hover-color)}.isso-author{color:var(--text-color);font-weight:500}.isso-page-author-suffix{color:var(--text-color-high-contrast);font-weight:700}.isso-input-wrapper input,.isso-preview,.isso-textarea{background-color:var(--bg-2);color:var(--text-color);font-family:var(--sans-serif-font)}.isso-is-page-author>.isso-text-wrapper{background-color:var(--bg-1)}.isso-preview,.isso-textarea{padding:10px;font-size:.8em}.isso-comment-footer,.isso-comment-footer .isso-votes{color:var(--meta-color)}.isso-text p{margin-top:-.4em}.isso-text p:last-child{margin-bottom:.2em}.isso-text h1,.isso-text h2,.isso-text h3,.isso-text h4,.isso-text h5,.isso-text h6{font-weight:700;font-size:130%}.isso-comment-footer{clear:left;font-size:.8em}.isso-comment-footer a,.isso-feedlink{margin:.4em;padding:.1em;font-weight:700;text-decoration:none}.isso-downvote svg,.isso-upvote svg{position:relative;top:.2em}.isso-downvote:hover svg,.isso-upvote:hover svg{fill:var(--hover-color)}.isso-comment .isso-postbox{margin-top:.8em}.isso-comment.isso-no-votes>*>.isso-comment-footer .isso-votes,.isso-post-action input[name=edit],.isso-postbox.isso-preview-mode>.isso-form-wrapper .isso-textarea,.isso-postbox.isso-preview-mode>.isso-form-wrapper input[name=preview],.isso-preview{display:none}.isso-postbox{clear:right;margin:0 auto 2em}.isso-form-wrapper{display:flex;flex-direction:column}.isso-preview,.isso-textarea{margin-top:.2em;border-radius:5px}.isso-textarea{outline:0;width:100%;resize:none}.isso-form-wrapper input[type=checkbox]{position:relative;bottom:1px;vertical-align:middle;margin-inline-end:0}.isso-notification-section{display:none;padding-top:.3em;padding-bottom:10px;font-size:.9em}.isso-auth-section{display:flex;flex-direction:row}.isso-input-wrapper,.isso-post-action{display:flex;flex-direction:column;justify-content:flex-end;align-items:center;margin:0 auto;max-width:35%;font-size:.8em;font-family:var(--sans-serif-font);text-align:center}.isso-input-wrapper{margin-inline-end:.5em}.isso-input-wrapper input,.isso-post-action input{margin-top:auto}.isso-input-wrapper label{display:inline-block;margin-top:auto;height:auto;line-height:1.4em}.isso-input-wrapper input{border:1px solid var(--divider-color);border-radius:5px;padding:.3em;width:100%;line-height:1.2em}.isso-post-action input{cursor:pointer;margin:.1em;border:none;border-radius:5px;background-color:var(--primary-color);padding:.6em 1em;color:var(--background-color);font-size:.8rem}.isso-post-action{display:block;align-self:flex-end;margin:0 auto}.isso-post-action>input:hover{opacity:.8}.isso-postbox.isso-preview-mode>.isso-form-wrapper .isso-preview{display:block}.isso-postbox.isso-preview-mode>.isso-form-wrapper input[name=edit]{display:inline}.isso-preview{background:repeating-linear-gradient(-45deg,var(--bg-0),var(--bg-0) 10px,var(--bg-2) 10px,var(--bg-2) 20px);background-color:var(--bg-0)}.isso-target{animation:5s ease-out isso-target-fade}@keyframes isso-target-fade{0%{background-color:var(--divider-color)}}@media screen and (max-width:600px){.isso-auth-section{flex-direction:column;text-align:center}.isso-input-wrapper{display:block;margin:0 0 .4em;max-width:100%}.isso-input-wrapper input{width:100%}.isso-post-action{margin:.4em auto;width:60%}}
|
@ -1,36 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// Convert URLs in data-name to links.
|
||||
document.querySelectorAll('code[data-name]').forEach(function(code) {
|
||||
const name = code.getAttribute('data-name');
|
||||
if (name.startsWith('http')) {
|
||||
const link = document.createElement('a');
|
||||
link.href = name;
|
||||
link.className = 'source-path';
|
||||
link.textContent = name;
|
||||
code.insertBefore(link, code.firstChild);
|
||||
// Remove data-name to avoid overlap with Zola's native display.
|
||||
code.removeAttribute('data-name');
|
||||
code.parentElement?.removeAttribute('data-name');
|
||||
}
|
||||
});
|
||||
|
||||
// Legacy support for old shortcode. https://github.com/welpo/tabi/pull/489
|
||||
document.querySelectorAll('.code-source').forEach(function(marker) {
|
||||
const sourceUrl = marker.getAttribute('data-source');
|
||||
const nextPre = marker.nextElementSibling;
|
||||
if (nextPre?.tagName === 'PRE') {
|
||||
const code = nextPre.querySelector('code');
|
||||
if (code) {
|
||||
if (sourceUrl.startsWith('http')) {
|
||||
const link = document.createElement('a');
|
||||
link.href = sourceUrl;
|
||||
link.className = 'source-path';
|
||||
link.textContent = sourceUrl;
|
||||
code.insertBefore(link, code.firstChild);
|
||||
} else {
|
||||
code.setAttribute('data-name', sourceUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
1
public/js/codeBlockNameLinks.min.js
vendored
1
public/js/codeBlockNameLinks.min.js
vendored
@ -1 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll("code[data-name]").forEach(function(e){var t,a=e.getAttribute("data-name");a.startsWith("http")&&((t=document.createElement("a")).href=a,t.className="source-path",t.textContent=a,e.insertBefore(t,e.firstChild),e.removeAttribute("data-name"),e.parentElement?.removeAttribute("data-name"))}),document.querySelectorAll(".code-source").forEach(function(e){var t,a=e.getAttribute("data-source");"PRE"===(e=e.nextElementSibling)?.tagName&&(e=e.querySelector("code"))&&(a.startsWith("http")?((t=document.createElement("a")).href=a,t.className="source-path",t.textContent=a,e.insertBefore(t,e.firstChild)):e.setAttribute("data-name",a))})});
|
@ -1,47 +0,0 @@
|
||||
const copiedText = document.getElementById('copy-success').textContent;
|
||||
const initCopyText = document.getElementById('copy-init').textContent;
|
||||
|
||||
const changeIcon = (copyDiv, className) => {
|
||||
copyDiv.classList.add(className);
|
||||
copyDiv.setAttribute('aria-label', copiedText);
|
||||
setTimeout(() => {
|
||||
copyDiv.classList.remove(className);
|
||||
copyDiv.setAttribute('aria-label', initCopyText);
|
||||
}, 2500);
|
||||
};
|
||||
|
||||
const addCopyEventListenerToDiv = (copyDiv, block) => {
|
||||
copyDiv.addEventListener('click', () => copyCodeAndChangeIcon(copyDiv, block));
|
||||
};
|
||||
|
||||
const copyCodeAndChangeIcon = async (copyDiv, block) => {
|
||||
const code = block.querySelector('table')
|
||||
? getTableCode(block)
|
||||
: getNonTableCode(block);
|
||||
try {
|
||||
await navigator.clipboard.writeText(code);
|
||||
changeIcon(copyDiv, 'checked');
|
||||
} catch (error) {
|
||||
changeIcon(copyDiv, 'error');
|
||||
}
|
||||
};
|
||||
|
||||
const getNonTableCode = (block) => {
|
||||
return [...block.querySelectorAll('code')].map((code) => code.textContent).join('');
|
||||
};
|
||||
|
||||
const getTableCode = (block) => {
|
||||
return [...block.querySelectorAll('tr')]
|
||||
.map((row) => row.querySelector('td:last-child')?.innerText ?? '')
|
||||
.join('');
|
||||
};
|
||||
|
||||
document.querySelectorAll('pre:not(.mermaid)').forEach((block) => {
|
||||
const copyDiv = document.createElement('div');
|
||||
copyDiv.setAttribute('role', 'button');
|
||||
copyDiv.setAttribute('aria-label', initCopyText);
|
||||
copyDiv.setAttribute('title', initCopyText);
|
||||
copyDiv.className = 'copy-code';
|
||||
block.prepend(copyDiv);
|
||||
addCopyEventListenerToDiv(copyDiv, block);
|
||||
});
|
1
public/js/copyCodeToClipboard.min.js
vendored
1
public/js/copyCodeToClipboard.min.js
vendored
@ -1 +0,0 @@
|
||||
const copiedText=document.getElementById("copy-success").textContent,initCopyText=document.getElementById("copy-init").textContent,changeIcon=(e,t)=>{e.classList.add(t),e.setAttribute("aria-label",copiedText),setTimeout(()=>{e.classList.remove(t),e.setAttribute("aria-label",initCopyText)},2500)},addCopyEventListenerToDiv=(e,t)=>{e.addEventListener("click",()=>copyCodeAndChangeIcon(e,t))},copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"checked")}catch(e){changeIcon(t,"error")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre:not(.mermaid)").forEach(e=>{var t=document.createElement("div");t.setAttribute("role","button"),t.setAttribute("aria-label",initCopyText),t.setAttribute("title",initCopyText),t.className="copy-code",e.prepend(t),addCopyEventListenerToDiv(t,e)});
|
@ -1,44 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
// Utility function: Base64 Decoding.
|
||||
function decodeBase64(encodedString) {
|
||||
try {
|
||||
// Can't use atob() directly because it doesn't support non-ascii characters.
|
||||
// And non-ascii characters are allowed in email addresses and domains.
|
||||
// See https://en.wikipedia.org/wiki/Email_address#Internationalization
|
||||
// Code below adapted from Jackie Han: https://stackoverflow.com/a/64752311
|
||||
const byteString = atob(encodedString);
|
||||
|
||||
// Convert byteString to an array of char codes.
|
||||
const charCodes = [...byteString].map((char) => char.charCodeAt(0));
|
||||
|
||||
// Use TypedArray.prototype.set() to copy the char codes into a Uint8Array.
|
||||
const bytes = new Uint8Array(charCodes.length);
|
||||
bytes.set(charCodes);
|
||||
|
||||
const decoder = new TextDecoder('utf-8');
|
||||
return decoder.decode(bytes);
|
||||
} catch (e) {
|
||||
console.error('Failed to decode Base64 string: ', e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Utility function: Update href of an element with a decoded email.
|
||||
function updateEmailHref(element) {
|
||||
const encodedEmail = element.getAttribute('data-encoded-email');
|
||||
const decodedEmail = decodeBase64(encodedEmail);
|
||||
|
||||
if (decodedEmail) {
|
||||
element.setAttribute('href', `mailto:${decodedEmail}`);
|
||||
} else {
|
||||
// If the decoding fails, hide the email link.
|
||||
element.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch and process email elements with the "data-encoded-email" attribute.
|
||||
const encodedEmailElements = document.querySelectorAll('[data-encoded-email]');
|
||||
encodedEmailElements.forEach(updateEmailHref);
|
||||
})();
|
1
public/js/decodeMail.min.js
vendored
1
public/js/decodeMail.min.js
vendored
@ -1 +0,0 @@
|
||||
!function(){"use strict";document.querySelectorAll("[data-encoded-email]").forEach(function(e){var t=function(e){try{var t=[...atob(e)].map(e=>e.charCodeAt(0)),r=new Uint8Array(t.length);return r.set(t),new TextDecoder("utf-8").decode(r)}catch(e){return console.error("Failed to decode Base64 string: ",e),null}}(e.getAttribute("data-encoded-email"));t?e.setAttribute("href","mailto:"+t):e.style.display="none"})}();
|
@ -1,99 +0,0 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const cards = document.querySelectorAll('.card');
|
||||
const filterLinks = document.querySelectorAll('.filter-controls a');
|
||||
const allProjectsFilter = document.querySelector('#all-projects-filter');
|
||||
if (!cards.length || !filterLinks.length) return;
|
||||
allProjectsFilter.style.display = 'block';
|
||||
|
||||
// Create a Map for O(1) lookups of links by filter value.
|
||||
const linkMap = new Map(
|
||||
Array.from(filterLinks).map(link => [link.dataset.filter, link])
|
||||
);
|
||||
|
||||
// Pre-process cards data for faster filtering.
|
||||
const cardData = Array.from(cards).map(card => ({
|
||||
element: card,
|
||||
tags: card.dataset.tags?.toLowerCase().split(',').filter(Boolean) ?? []
|
||||
}));
|
||||
|
||||
function getTagSlugFromUrl(url) {
|
||||
return url.split('/').filter(Boolean).pop();
|
||||
}
|
||||
|
||||
function getFilterFromHash() {
|
||||
if (!window.location.hash) return 'all';
|
||||
const hash = decodeURIComponent(window.location.hash.slice(1));
|
||||
const matchingLink = Array.from(filterLinks).find(link =>
|
||||
getTagSlugFromUrl(link.getAttribute('href')) === hash
|
||||
);
|
||||
return matchingLink?.dataset.filter ?? 'all';
|
||||
}
|
||||
|
||||
function setActiveFilter(filterValue, updateHash = true) {
|
||||
if (updateHash) {
|
||||
if (filterValue === 'all') {
|
||||
history.pushState(null, '', window.location.pathname);
|
||||
} else {
|
||||
const activeLink = linkMap.get(filterValue);
|
||||
if (activeLink) {
|
||||
const tagSlug = getTagSlugFromUrl(activeLink.getAttribute('href'));
|
||||
history.pushState(null, '', `#${tagSlug}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
const isAll = filterValue === 'all';
|
||||
const display = isAll ? '' : 'none';
|
||||
const ariaHidden = isAll ? 'false' : 'true';
|
||||
requestAnimationFrame(() => {
|
||||
filterLinks.forEach(link => {
|
||||
const isActive = link.dataset.filter === filterValue;
|
||||
link.classList.toggle('active', isActive);
|
||||
link.setAttribute('aria-pressed', isActive);
|
||||
});
|
||||
if (isAll) {
|
||||
cardData.forEach(({ element }) => {
|
||||
element.style.display = display;
|
||||
element.setAttribute('aria-hidden', ariaHidden);
|
||||
});
|
||||
} else {
|
||||
cardData.forEach(({ element, tags }) => {
|
||||
const shouldShow = tags.includes(filterValue);
|
||||
element.style.display = shouldShow ? '' : 'none';
|
||||
element.setAttribute('aria-hidden', !shouldShow);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const filterContainer = filterLinks[0].parentElement.parentElement;
|
||||
filterContainer.addEventListener('click', e => {
|
||||
const link = e.target.closest('a');
|
||||
if (!link) return;
|
||||
e.preventDefault();
|
||||
const filterValue = link.dataset.filter;
|
||||
if (filterValue) setActiveFilter(filterValue);
|
||||
});
|
||||
|
||||
filterContainer.addEventListener('keydown', e => {
|
||||
const link = e.target.closest('a');
|
||||
if (!link) return;
|
||||
if (e.key === ' ' || e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
link.click();
|
||||
}
|
||||
});
|
||||
|
||||
filterLinks.forEach(link => {
|
||||
link.setAttribute('role', 'button');
|
||||
link.setAttribute('aria-pressed', link.classList.contains('active'));
|
||||
});
|
||||
|
||||
window.addEventListener('popstate', () => {
|
||||
setActiveFilter(getFilterFromHash(), false);
|
||||
});
|
||||
|
||||
const initialFilter = getFilterFromHash();
|
||||
if (initialFilter !== 'all') {
|
||||
setActiveFilter(initialFilter, false);
|
||||
}
|
||||
});
|
1
public/js/filterCards.min.js
vendored
1
public/js/filterCards.min.js
vendored
@ -1 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded",()=>{var t=document.querySelectorAll(".card");const l=document.querySelectorAll(".filter-controls a");var e=document.querySelector("#all-projects-filter");if(t.length&&l.length){e.style.display="block";const s=new Map(Array.from(l).map(t=>[t.dataset.filter,t])),i=Array.from(t).map(t=>({element:t,tags:t.dataset.tags?.toLowerCase().split(",").filter(Boolean)??[]}));function o(t){return t.split("/").filter(Boolean).pop()}function a(){if(!window.location.hash)return"all";const e=decodeURIComponent(window.location.hash.slice(1));return Array.from(l).find(t=>o(t.getAttribute("href"))===e)?.dataset.filter??"all"}function r(a,t=!0){t&&("all"===a?history.pushState(null,"",window.location.pathname):(t=s.get(a))&&(t=o(t.getAttribute("href")),history.pushState(null,"","#"+t)));const e="all"===a,r=e?"":"none",n=e?"false":"true";requestAnimationFrame(()=>{l.forEach(t=>{var e=t.dataset.filter===a;t.classList.toggle("active",e),t.setAttribute("aria-pressed",e)}),e?i.forEach(({element:t})=>{t.style.display=r,t.setAttribute("aria-hidden",n)}):i.forEach(({element:t,tags:e})=>{e=e.includes(a),t.style.display=e?"":"none",t.setAttribute("aria-hidden",!e)})})}(e=l[0].parentElement.parentElement).addEventListener("click",t=>{var e=t.target.closest("a");e&&(t.preventDefault(),t=e.dataset.filter)&&r(t)}),e.addEventListener("keydown",t=>{var e=t.target.closest("a");!e||" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),e.click())}),l.forEach(t=>{t.setAttribute("role","button"),t.setAttribute("aria-pressed",t.classList.contains("active"))}),window.addEventListener("popstate",()=>{r(a(),!1)}),"all"!==(t=a())&&r(t,!1)}});
|
@ -1,33 +0,0 @@
|
||||
// Assign unique IDs to the footnote references based on their hashes.
|
||||
function assignReferenceIds() {
|
||||
const references = document.querySelectorAll('.footnote-reference');
|
||||
for (const ref of references) {
|
||||
ref.id = `ref:${ref.children[0].hash.substring(1)}`;
|
||||
}
|
||||
}
|
||||
|
||||
// Create backlinks for each footnote definition if a corresponding reference exists.
|
||||
function createFootnoteBacklinks() {
|
||||
const footnotes = document.querySelectorAll('.footnote-definition');
|
||||
for (const footnote of footnotes) {
|
||||
const backlinkId = `ref:${footnote.id}`;
|
||||
|
||||
// Skip if there's no corresponding reference in the text (i.e. the footnote doesn't reference anything).
|
||||
if (!document.getElementById(backlinkId)) continue;
|
||||
|
||||
const backlink = document.createElement('a');
|
||||
backlink.href = `#${backlinkId}`;
|
||||
backlink.className = 'footnote-backlink';
|
||||
backlink.textContent = '↩';
|
||||
footnote.lastElementChild.appendChild(backlink);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialise the handlers for the footnote references and definitions.
|
||||
function initFootnotes() {
|
||||
assignReferenceIds();
|
||||
createFootnoteBacklinks();
|
||||
}
|
||||
|
||||
// Wait for the window to load, then execute the main function.
|
||||
window.addEventListener('load', initFootnotes);
|
1
public/js/footnoteBacklinks.min.js
vendored
1
public/js/footnoteBacklinks.min.js
vendored
@ -1 +0,0 @@
|
||||
function assignReferenceIds(){for(const e of document.querySelectorAll(".footnote-reference"))e.id="ref:"+e.children[0].hash.substring(1)}function createFootnoteBacklinks(){for(const n of document.querySelectorAll(".footnote-definition")){var e,t="ref:"+n.id;document.getElementById(t)&&((e=document.createElement("a")).href="#"+t,e.className="footnote-backlink",e.textContent="↩",n.lastElementChild.appendChild(e))}}function initFootnotes(){assignReferenceIds(),createFootnoteBacklinks()}window.addEventListener("load",initFootnotes);
|
@ -1,81 +0,0 @@
|
||||
function setGiscusTheme(newTheme) {
|
||||
// Get the giscus iframe.
|
||||
const frame = document.querySelector('iframe.giscus-frame');
|
||||
|
||||
if (frame) {
|
||||
// If the iframe exists, send a message to set the theme.
|
||||
frame.contentWindow.postMessage(
|
||||
{ giscus: { setConfig: { theme: newTheme } } },
|
||||
'https://giscus.app'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Function to initialize Giscus. This function is run when the window loads.
|
||||
function initGiscus() {
|
||||
// Get the div that will contain the comments.
|
||||
const commentsDiv = document.querySelector('.comments');
|
||||
if (commentsDiv) {
|
||||
// Get the various settings from data attributes on the div.
|
||||
const repo = commentsDiv.getAttribute('data-repo');
|
||||
const repoId = commentsDiv.getAttribute('data-repo-id');
|
||||
const category = commentsDiv.getAttribute('data-category');
|
||||
const categoryId = commentsDiv.getAttribute('data-category-id');
|
||||
const strictTitleMatching = commentsDiv.getAttribute('data-strict');
|
||||
const term = commentsDiv.getAttribute('data-term');
|
||||
const reactionsEnabled = commentsDiv.getAttribute('data-reactions-enabled');
|
||||
const inputPosition = commentsDiv.getAttribute('data-input-position');
|
||||
const lightTheme = commentsDiv.getAttribute('data-light-theme');
|
||||
const darkTheme = commentsDiv.getAttribute('data-dark-theme');
|
||||
const lang = commentsDiv.getAttribute('data-lang');
|
||||
const lazyLoading = commentsDiv.getAttribute('data-lazy-loading');
|
||||
|
||||
// Create a new script tag that will load the Giscus script.
|
||||
const script = document.createElement('script');
|
||||
script.src = 'https://giscus.app/client.js';
|
||||
script.async = true;
|
||||
|
||||
// Set the various settings as data attributes on the script tag.
|
||||
script.setAttribute('data-repo', repo);
|
||||
script.setAttribute('data-repo-id', repoId);
|
||||
script.setAttribute('data-category', category);
|
||||
script.setAttribute('data-category-id', categoryId);
|
||||
script.setAttribute('data-term', term);
|
||||
script.setAttribute('data-strict', strictTitleMatching);
|
||||
script.setAttribute('data-reactions-enabled', reactionsEnabled);
|
||||
script.setAttribute('data-emit-metadata', '0');
|
||||
script.setAttribute('data-input-position', inputPosition);
|
||||
script.setAttribute('data-lang', lang);
|
||||
script.setAttribute('crossorigin', 'anonymous');
|
||||
|
||||
// Set the mapping if it is provided.
|
||||
const mapping = commentsDiv.getAttribute('data-mapping');
|
||||
if (mapping) {
|
||||
script.setAttribute('data-mapping', mapping);
|
||||
}
|
||||
|
||||
// Choose the correct theme based on the current theme of the document.
|
||||
const currentTheme =
|
||||
document.documentElement.getAttribute('data-theme') || 'light';
|
||||
const selectedTheme = currentTheme === 'dark' ? darkTheme : lightTheme;
|
||||
script.setAttribute('data-theme', selectedTheme);
|
||||
|
||||
// Set the loading attribute if lazy loading is enabled.
|
||||
if (lazyLoading === 'true') {
|
||||
script.setAttribute('data-loading', 'lazy');
|
||||
}
|
||||
|
||||
// Add the script tag to the div.
|
||||
commentsDiv.appendChild(script);
|
||||
|
||||
// Listen for theme changes and update the Giscus theme when they occur.
|
||||
window.addEventListener('themeChanged', (event) => {
|
||||
const selectedTheme =
|
||||
event.detail.theme === 'dark' ? darkTheme : lightTheme;
|
||||
setGiscusTheme(selectedTheme);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize Giscus.
|
||||
initGiscus();
|
1
public/js/giscus.min.js
vendored
1
public/js/giscus.min.js
vendored
@ -1 +0,0 @@
|
||||
function setGiscusTheme(t){var e=document.querySelector("iframe.giscus-frame");e&&e.contentWindow.postMessage({giscus:{setConfig:{theme:t}}},"https://giscus.app")}function initGiscus(){var t=document.querySelector(".comments");if(t){var e=t.getAttribute("data-repo"),a=t.getAttribute("data-repo-id"),i=t.getAttribute("data-category"),r=t.getAttribute("data-category-id"),d=t.getAttribute("data-strict"),s=t.getAttribute("data-term"),u=t.getAttribute("data-reactions-enabled"),n=t.getAttribute("data-input-position");const b=t.getAttribute("data-light-theme"),A=t.getAttribute("data-dark-theme");var o=t.getAttribute("data-lang"),c=t.getAttribute("data-lazy-loading"),g=document.createElement("script"),e=(g.src="https://giscus.app/client.js",g.async=!0,g.setAttribute("data-repo",e),g.setAttribute("data-repo-id",a),g.setAttribute("data-category",i),g.setAttribute("data-category-id",r),g.setAttribute("data-term",s),g.setAttribute("data-strict",d),g.setAttribute("data-reactions-enabled",u),g.setAttribute("data-emit-metadata","0"),g.setAttribute("data-input-position",n),g.setAttribute("data-lang",o),g.setAttribute("crossorigin","anonymous"),t.getAttribute("data-mapping")),a=(e&&g.setAttribute("data-mapping",e),document.documentElement.getAttribute("data-theme")||"light"),i="dark"===a?A:b;g.setAttribute("data-theme",i),"true"===c&&g.setAttribute("data-loading","lazy"),t.appendChild(g),window.addEventListener("themeChanged",t=>{setGiscusTheme("dark"===t.detail.theme?A:b)})}}initGiscus();
|
@ -1,44 +0,0 @@
|
||||
function initHyvorTalk() {
|
||||
// Get the div that will contain the comments.
|
||||
const commentsDiv = document.querySelector('.comments');
|
||||
if (commentsDiv) {
|
||||
// Get the various settings from data attributes on the div.
|
||||
const websiteId = commentsDiv.getAttribute('data-website-id');
|
||||
const pageId = commentsDiv.getAttribute('data-page-id');
|
||||
const pageLanguage = commentsDiv.getAttribute('data-page-language');
|
||||
const loading = commentsDiv.getAttribute('data-loading');
|
||||
const pageAuthor = commentsDiv.getAttribute('data-page-author');
|
||||
|
||||
// Create a new script tag that will load the Hyvor Talk script.
|
||||
const script = document.createElement('script');
|
||||
script.src = 'https://talk.hyvor.com/embed/embed.js';
|
||||
script.async = true;
|
||||
script.type = 'module';
|
||||
document.head.appendChild(script);
|
||||
|
||||
// Create a new Hyvor Talk comments tag.
|
||||
const comments = document.createElement('hyvor-talk-comments');
|
||||
comments.setAttribute('website-id', websiteId);
|
||||
comments.setAttribute('page-id', pageId);
|
||||
comments.setAttribute('page-language', pageLanguage);
|
||||
comments.setAttribute('loading', loading);
|
||||
comments.setAttribute('page-author', pageAuthor);
|
||||
|
||||
// Choose the correct theme based on the current theme of the document.
|
||||
const currentTheme =
|
||||
document.documentElement.getAttribute('data-theme') || 'light';
|
||||
comments.setAttribute('colors', currentTheme);
|
||||
|
||||
// Add the Hyvor Talk comments tag to the div.
|
||||
commentsDiv.appendChild(comments);
|
||||
|
||||
// Listen for theme changes and update the Hyvor Talk theme when they occur.
|
||||
window.addEventListener('themeChanged', (event) => {
|
||||
const selectedTheme = event.detail.theme;
|
||||
comments.setAttribute('colors', selectedTheme);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize HyvorTalk.
|
||||
initHyvorTalk();
|
1
public/js/hyvortalk.min.js
vendored
1
public/js/hyvortalk.min.js
vendored
@ -1 +0,0 @@
|
||||
function initHyvorTalk(){var t=document.querySelector(".comments");if(t){var e=t.getAttribute("data-website-id"),a=t.getAttribute("data-page-id"),i=t.getAttribute("data-page-language"),d=t.getAttribute("data-loading"),r=t.getAttribute("data-page-author"),n=document.createElement("script");n.src="https://talk.hyvor.com/embed/embed.js",n.async=!0,n.type="module",document.head.appendChild(n);const o=document.createElement("hyvor-talk-comments");o.setAttribute("website-id",e),o.setAttribute("page-id",a),o.setAttribute("page-language",i),o.setAttribute("loading",d),o.setAttribute("page-author",r);n=document.documentElement.getAttribute("data-theme")||"light";o.setAttribute("colors",n),t.appendChild(o),window.addEventListener("themeChanged",t=>{t=t.detail.theme;o.setAttribute("colors",t)})}}initHyvorTalk();
|
@ -1,25 +0,0 @@
|
||||
(function () {
|
||||
// Get the default theme from the HTML data-theme attribute.
|
||||
const defaultTheme = document.documentElement.getAttribute('data-theme');
|
||||
|
||||
// Set the data-default-theme attribute only if defaultTheme is not null.
|
||||
if (defaultTheme) {
|
||||
document.documentElement.setAttribute('data-default-theme', defaultTheme);
|
||||
}
|
||||
|
||||
// Attempt to retrieve the current theme from the browser's local storage.
|
||||
const storedTheme = localStorage.getItem('theme');
|
||||
|
||||
if (storedTheme) {
|
||||
document.documentElement.setAttribute('data-theme', storedTheme);
|
||||
} else if (defaultTheme) {
|
||||
document.documentElement.setAttribute('data-theme', defaultTheme);
|
||||
} else {
|
||||
// If no theme is found in local storage and no default theme is set, use user's system preference.
|
||||
const isSystemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
document.documentElement.setAttribute(
|
||||
'data-theme',
|
||||
isSystemDark ? 'dark' : 'light'
|
||||
);
|
||||
}
|
||||
})();
|
1
public/js/initializeTheme.min.js
vendored
1
public/js/initializeTheme.min.js
vendored
@ -1 +0,0 @@
|
||||
!function(){var t=document.documentElement.getAttribute("data-theme"),e=(t&&document.documentElement.setAttribute("data-default-theme",t),localStorage.getItem("theme"));e?document.documentElement.setAttribute("data-theme",e):t?document.documentElement.setAttribute("data-theme",t):(e=window.matchMedia("(prefers-color-scheme: dark)").matches,document.documentElement.setAttribute("data-theme",e?"dark":"light"))}();
|
@ -1,81 +0,0 @@
|
||||
// Function to initialise Isso.
|
||||
function initIsso() {
|
||||
// Get the div that will contain the comments.
|
||||
const commentsDiv = document.querySelector('.comments');
|
||||
if (commentsDiv) {
|
||||
// Get the lazy-loading setting from the div.
|
||||
const lazyLoading = commentsDiv.getAttribute('data-lazy-loading') === 'true';
|
||||
|
||||
// If lazy-loading is enabled, create an Intersection Observer and use it.
|
||||
if (lazyLoading) {
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
// Loop over the entries.
|
||||
entries.forEach((entry) => {
|
||||
// If the element is in the viewport, initialize Isso.
|
||||
if (entry.isIntersecting) {
|
||||
loadIsso(commentsDiv);
|
||||
// Once the Isso is loaded, we don't need to observe the element anymore.
|
||||
observer.unobserve(commentsDiv);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Start observing the comments div.
|
||||
observer.observe(commentsDiv);
|
||||
} else {
|
||||
// If lazy-loading is not enabled, initialise Isso immediately.
|
||||
loadIsso(commentsDiv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Function to load Isso.
|
||||
function loadIsso(commentsDiv) {
|
||||
// Get the various settings from data attributes on the div.
|
||||
const endpointUrl = commentsDiv.getAttribute('data-endpoint-url');
|
||||
const pageId = commentsDiv.getAttribute('data-isso-id');
|
||||
const title = commentsDiv.getAttribute('data-title');
|
||||
const lang = commentsDiv.getAttribute('data-page-language');
|
||||
const maxCommentsTop = commentsDiv.getAttribute('data-max-comments-top');
|
||||
const maxCommentsNested = commentsDiv.getAttribute('data-max-comments-nested');
|
||||
const avatar = commentsDiv.getAttribute('data-avatar');
|
||||
const voting = commentsDiv.getAttribute('data-voting');
|
||||
const hashes = commentsDiv.getAttribute('data-page-author-hashes');
|
||||
|
||||
// Create a new script tag that will load the Isso script.
|
||||
const script = document.createElement('script');
|
||||
script.src = endpointUrl + 'js/embed.min.js';
|
||||
script.async = true;
|
||||
|
||||
// Set the various settings as data attributes on the script tag.
|
||||
script.setAttribute('data-isso', endpointUrl);
|
||||
script.setAttribute('data-isso-lang', lang);
|
||||
script.setAttribute('data-isso-max-comments-top', maxCommentsTop);
|
||||
script.setAttribute('data-isso-max-comments-nested', maxCommentsNested);
|
||||
script.setAttribute('data-isso-avatar', avatar);
|
||||
script.setAttribute('data-isso-vote', voting);
|
||||
script.setAttribute('data-isso-page-author-hashes', hashes);
|
||||
script.setAttribute('data-isso-css', 'false');
|
||||
|
||||
// Set the id and data-isso-id of the Isso thread.
|
||||
const section = document.createElement('section');
|
||||
section.id = 'isso-thread';
|
||||
section.setAttribute('data-isso-id', pageId);
|
||||
section.setAttribute('data-title', title);
|
||||
commentsDiv.appendChild(section);
|
||||
|
||||
// Add the script tag to the div.
|
||||
commentsDiv.appendChild(script);
|
||||
|
||||
// Create a link tag for the Isso CSS.
|
||||
const link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
link.href = '/isso.min.css';
|
||||
|
||||
// Add the CSS link tag to the head of the document.
|
||||
document.head.appendChild(link);
|
||||
}
|
||||
|
||||
// Initialize Isso.
|
||||
initIsso();
|
1
public/js/isso.min.js
vendored
1
public/js/isso.min.js
vendored
@ -1 +0,0 @@
|
||||
function initIsso(){const e=document.querySelector(".comments");if(e)if("true"===e.getAttribute("data-lazy-loading")){const a=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(loadIsso(e),a.unobserve(e))})});a.observe(e)}else loadIsso(e)}function loadIsso(t){var e=t.getAttribute("data-endpoint-url"),a=t.getAttribute("data-isso-id"),s=t.getAttribute("data-title"),i=t.getAttribute("data-page-language"),o=t.getAttribute("data-max-comments-top"),r=(t.getAttribute("data-max-comments-nested"),t.getAttribute("data-avatar")),d=t.getAttribute("data-voting"),n=t.getAttribute("data-page-author-hashes"),u=document.createElement("script");u.src=e+"js/embed.min.js",u.async=!0,u.setAttribute("data-isso",e),u.setAttribute("data-isso-lang",i),u.setAttribute("data-isso-max-comments-top",o),u.setAttribute("data-isso-avatar",r),u.setAttribute("data-isso-vote",d),u.setAttribute("data-isso-page-author-hashes",n),u.setAttribute("data-isso-css","false"),(e=document.createElement("section")).id="isso-thread",e.setAttribute("data-isso-id",a),e.setAttribute("data-title",s),t.appendChild(e),t.appendChild(u),(i=document.createElement("link")).rel="stylesheet",i.type="text/css",i.href="/isso.min.css",document.head.appendChild(i)}initIsso();
|
1
public/js/katex.min.js
vendored
1
public/js/katex.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,26 +0,0 @@
|
||||
// Wait for the full HTML document to be parsed and ready.
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Retrieve the button element.
|
||||
const loadCommentsButton = document.querySelector('#load-comments');
|
||||
|
||||
// If the button exists…
|
||||
if (loadCommentsButton) {
|
||||
// Add a "click" event listener to the button.
|
||||
loadCommentsButton.addEventListener('click', () => {
|
||||
// Create a new "script" HTML element.
|
||||
const script = document.createElement('script');
|
||||
|
||||
// Set the source of the script to the URL in the button's "data-script-src" attribute.
|
||||
script.src = loadCommentsButton.dataset.scriptSrc;
|
||||
|
||||
// Load asynchronously.
|
||||
script.async = true;
|
||||
|
||||
// Add the script element to the end of the document body, which causes the script to start loading and executing.
|
||||
document.body.appendChild(script);
|
||||
|
||||
// Hide the button after it's clicked.
|
||||
loadCommentsButton.style.display = 'none';
|
||||
});
|
||||
}
|
||||
});
|
1
public/js/loadComments.min.js
vendored
1
public/js/loadComments.min.js
vendored
@ -1 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded",()=>{const t=document.querySelector("#load-comments");t&&t.addEventListener("click",()=>{var e=document.createElement("script");e.src=t.dataset.scriptSrc,e.async=!0,document.body.appendChild(e),t.style.display="none"})});
|
@ -1,280 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `Danish` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
;
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.da = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.da.trimmer,
|
||||
lunr.da.stopWordFilter,
|
||||
lunr.da.stemmer
|
||||
);
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.da.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.da.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.da.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.da.trimmer, 'trimmer-da');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.da.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function DanishStemmer() {
|
||||
var a_0 = [new Among("hed", -1, 1), new Among("ethed", 0, 1),
|
||||
new Among("ered", -1, 1), new Among("e", -1, 1),
|
||||
new Among("erede", 3, 1), new Among("ende", 3, 1),
|
||||
new Among("erende", 5, 1), new Among("ene", 3, 1),
|
||||
new Among("erne", 3, 1), new Among("ere", 3, 1),
|
||||
new Among("en", -1, 1), new Among("heden", 10, 1),
|
||||
new Among("eren", 10, 1), new Among("er", -1, 1),
|
||||
new Among("heder", 13, 1), new Among("erer", 13, 1),
|
||||
new Among("s", -1, 2), new Among("heds", 16, 1),
|
||||
new Among("es", 16, 1), new Among("endes", 18, 1),
|
||||
new Among("erendes", 19, 1), new Among("enes", 18, 1),
|
||||
new Among("ernes", 18, 1), new Among("eres", 18, 1),
|
||||
new Among("ens", 16, 1), new Among("hedens", 24, 1),
|
||||
new Among("erens", 24, 1), new Among("ers", 16, 1),
|
||||
new Among("ets", 16, 1), new Among("erets", 28, 1),
|
||||
new Among("et", -1, 1), new Among("eret", 30, 1)
|
||||
],
|
||||
a_1 = [
|
||||
new Among("gd", -1, -1), new Among("dt", -1, -1),
|
||||
new Among("gt", -1, -1), new Among("kt", -1, -1)
|
||||
],
|
||||
a_2 = [
|
||||
new Among("ig", -1, 1), new Among("lig", 0, 1),
|
||||
new Among("elig", 1, 1), new Among("els", -1, 1),
|
||||
new Among("l\u00F8st", -1, 2)
|
||||
],
|
||||
g_v = [17, 65, 16, 1, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128
|
||||
],
|
||||
g_s_ending = [239, 254, 42, 3,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16
|
||||
],
|
||||
I_x, I_p1, S_ch, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function r_mark_regions() {
|
||||
var v_1, c = sbp.cursor + 3;
|
||||
I_p1 = sbp.limit;
|
||||
if (0 <= c && c <= sbp.limit) {
|
||||
I_x = c;
|
||||
while (true) {
|
||||
v_1 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 248)) {
|
||||
sbp.cursor = v_1;
|
||||
break;
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
if (v_1 >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 248)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
}
|
||||
I_p1 = sbp.cursor;
|
||||
if (I_p1 < I_x)
|
||||
I_p1 = I_x;
|
||||
}
|
||||
}
|
||||
|
||||
function r_main_suffix() {
|
||||
var among_var, v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_0, 32);
|
||||
sbp.limit_backward = v_1;
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (sbp.in_grouping_b(g_s_ending, 97, 229))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_consonant_pair() {
|
||||
var v_1 = sbp.limit - sbp.cursor,
|
||||
v_2;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_2 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.find_among_b(a_1, 4)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_2;
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
} else
|
||||
sbp.limit_backward = v_2;
|
||||
}
|
||||
}
|
||||
|
||||
function r_other_suffix() {
|
||||
var among_var, v_1 = sbp.limit - sbp.cursor,
|
||||
v_2, v_3;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "st")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ig"))
|
||||
sbp.slice_del();
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_2 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_2, 5);
|
||||
sbp.limit_backward = v_2;
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
r_consonant_pair();
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("l\u00F8s");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_undouble() {
|
||||
var v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_v, 97, 248)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
S_ch = sbp.slice_to(S_ch);
|
||||
sbp.limit_backward = v_1;
|
||||
if (sbp.eq_v_b(S_ch))
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_main_suffix();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_consonant_pair();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_other_suffix();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_undouble();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.da.stemmer, 'stemmer-da');
|
||||
|
||||
/* stop word filter function */
|
||||
lunr.da.stopWordFilter = function(token) {
|
||||
if (lunr.da.stopWordFilter.stopWords.indexOf(token) === -1) {
|
||||
return token;
|
||||
}
|
||||
};
|
||||
|
||||
lunr.da.stopWordFilter.stopWords = new lunr.SortedSet();
|
||||
lunr.da.stopWordFilter.stopWords.length = 95;
|
||||
|
||||
// The space at the beginning is crucial: It marks the empty string
|
||||
// as a stop word. lunr.js crashes during search when documents
|
||||
// processed by the pipeline still contain the empty string.
|
||||
lunr.da.stopWordFilter.stopWords.elements = ' ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været'.split(' ');
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.da.stopWordFilter, 'stopWordFilter-da');
|
||||
};
|
||||
}))
|
1
public/js/lunr/lunr.da.min.js
vendored
1
public/js/lunr/lunr.da.min.js
vendored
@ -1 +0,0 @@
|
||||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(r){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var e,t,i;r.da=function(){this.pipeline.reset(),this.pipeline.add(r.da.trimmer,r.da.stopWordFilter,r.da.stemmer)},r.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",r.da.trimmer=r.trimmerSupport.generateTrimmer(r.da.wordCharacters),r.Pipeline.registerFunction(r.da.trimmer,"trimmer-da"),r.da.stemmer=(e=r.stemmerSupport.Among,t=r.stemmerSupport.SnowballProgram,i=new function(){var n,s,o,d=[new e("hed",-1,1),new e("ethed",0,1),new e("ered",-1,1),new e("e",-1,1),new e("erede",3,1),new e("ende",3,1),new e("erende",5,1),new e("ene",3,1),new e("erne",3,1),new e("ere",3,1),new e("en",-1,1),new e("heden",10,1),new e("eren",10,1),new e("er",-1,1),new e("heder",13,1),new e("erer",13,1),new e("s",-1,2),new e("heds",16,1),new e("es",16,1),new e("endes",18,1),new e("erendes",19,1),new e("enes",18,1),new e("ernes",18,1),new e("eres",18,1),new e("ens",16,1),new e("hedens",24,1),new e("erens",24,1),new e("ers",16,1),new e("ets",16,1),new e("erets",28,1),new e("et",-1,1),new e("eret",30,1)],i=[new e("gd",-1,-1),new e("dt",-1,-1),new e("gt",-1,-1),new e("kt",-1,-1)],a=[new e("ig",-1,1),new e("lig",0,1),new e("elig",1,1),new e("els",-1,1),new e("løst",-1,2)],u=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],l=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],c=new t;function m(){var e,r=c.limit-c.cursor;c.cursor>=s&&(e=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,c.find_among_b(i,4)?(c.bra=c.cursor,c.limit_backward=e,c.cursor=c.limit-r,c.cursor>c.limit_backward&&(c.cursor--,c.bra=c.cursor,c.slice_del())):c.limit_backward=e)}this.setCurrent=function(e){c.setCurrent(e)},this.getCurrent=function(){return c.getCurrent()},this.stem=function(){var e,r=c.cursor;if(function(){var e,r=c.cursor+3;if(s=c.limit,0<=r&&r<=c.limit){for(n=r;;){if(e=c.cursor,c.in_grouping(u,97,248)){c.cursor=e;break}if((c.cursor=e)>=c.limit)return;c.cursor++}for(;!c.out_grouping(u,97,248);){if(c.cursor>=c.limit)return;c.cursor++}(s=c.cursor)<n&&(s=n)}}(),c.limit_backward=r,c.cursor=c.limit,c.cursor>=s&&(r=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,e=c.find_among_b(d,32),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:c.in_grouping_b(l,97,229)&&c.slice_del()}c.cursor=c.limit,m(),c.cursor=c.limit;var i,t,r=c.limit-c.cursor;if(c.ket=c.cursor,c.eq_s_b(2,"st")&&(c.bra=c.cursor,c.eq_s_b(2,"ig"))&&c.slice_del(),c.cursor=c.limit-r,c.cursor>=s&&(r=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,i=c.find_among_b(a,5),c.limit_backward=r,i))switch(c.bra=c.cursor,i){case 1:c.slice_del(),t=c.limit-c.cursor,m(),c.cursor=c.limit-t;break;case 2:c.slice_from("løs")}return c.cursor=c.limit,c.cursor>=s&&(e=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,c.out_grouping_b(u,97,248)?(c.bra=c.cursor,o=c.slice_to(o),c.limit_backward=e,c.eq_v_b(o)&&c.slice_del()):c.limit_backward=e),!0}},function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}),r.Pipeline.registerFunction(r.da.stemmer,"stemmer-da"),r.da.stopWordFilter=function(e){if(-1===r.da.stopWordFilter.stopWords.indexOf(e))return e},r.da.stopWordFilter.stopWords=new r.SortedSet,r.da.stopWordFilter.stopWords.length=95,r.da.stopWordFilter.stopWords.elements=" ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" "),r.Pipeline.registerFunction(r.da.stopWordFilter,"stopWordFilter-da")}});
|
@ -1,380 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `German` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
;
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.de = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.de.trimmer,
|
||||
lunr.de.stopWordFilter,
|
||||
lunr.de.stemmer
|
||||
);
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.de.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.de.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.de.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.de.trimmer, 'trimmer-de');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.de.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function GermanStemmer() {
|
||||
var a_0 = [new Among("", -1, 6), new Among("U", 0, 2),
|
||||
new Among("Y", 0, 1), new Among("\u00E4", 0, 3),
|
||||
new Among("\u00F6", 0, 4), new Among("\u00FC", 0, 5)
|
||||
],
|
||||
a_1 = [
|
||||
new Among("e", -1, 2), new Among("em", -1, 1),
|
||||
new Among("en", -1, 2), new Among("ern", -1, 1),
|
||||
new Among("er", -1, 1), new Among("s", -1, 3),
|
||||
new Among("es", 5, 2)
|
||||
],
|
||||
a_2 = [new Among("en", -1, 1),
|
||||
new Among("er", -1, 1), new Among("st", -1, 2),
|
||||
new Among("est", 2, 1)
|
||||
],
|
||||
a_3 = [new Among("ig", -1, 1),
|
||||
new Among("lich", -1, 1)
|
||||
],
|
||||
a_4 = [new Among("end", -1, 1),
|
||||
new Among("ig", -1, 2), new Among("ung", -1, 1),
|
||||
new Among("lich", -1, 3), new Among("isch", -1, 2),
|
||||
new Among("ik", -1, 2), new Among("heit", -1, 3),
|
||||
new Among("keit", -1, 4)
|
||||
],
|
||||
g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 8, 0, 32, 8
|
||||
],
|
||||
g_s_ending = [117, 30, 5],
|
||||
g_st_ending = [
|
||||
117, 30, 4
|
||||
],
|
||||
I_x, I_p2, I_p1, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function habr1(c1, c2, v_1) {
|
||||
if (sbp.eq_s(1, c1)) {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 252)) {
|
||||
sbp.slice_from(c2);
|
||||
sbp.cursor = v_1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_prelude() {
|
||||
var v_1 = sbp.cursor,
|
||||
v_2, v_3, v_4, v_5;
|
||||
while (true) {
|
||||
v_2 = sbp.cursor;
|
||||
sbp.bra = v_2;
|
||||
if (sbp.eq_s(1, "\u00DF")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
sbp.slice_from("ss");
|
||||
} else {
|
||||
if (v_2 >= sbp.limit)
|
||||
break;
|
||||
sbp.cursor = v_2 + 1;
|
||||
}
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
while (true) {
|
||||
v_3 = sbp.cursor;
|
||||
while (true) {
|
||||
v_4 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 252)) {
|
||||
v_5 = sbp.cursor;
|
||||
sbp.bra = v_5;
|
||||
if (habr1("u", "U", v_4))
|
||||
break;
|
||||
sbp.cursor = v_5;
|
||||
if (habr1("y", "Y", v_4))
|
||||
break;
|
||||
}
|
||||
if (v_4 >= sbp.limit) {
|
||||
sbp.cursor = v_3;
|
||||
return;
|
||||
}
|
||||
sbp.cursor = v_4 + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function habr2() {
|
||||
while (!sbp.in_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_mark_regions() {
|
||||
I_p1 = sbp.limit;
|
||||
I_p2 = I_p1;
|
||||
var c = sbp.cursor + 3;
|
||||
if (0 <= c && c <= sbp.limit) {
|
||||
I_x = c;
|
||||
if (!habr2()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (I_p1 < I_x)
|
||||
I_p1 = I_x;
|
||||
if (!habr2())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_postlude() {
|
||||
var among_var, v_1;
|
||||
while (true) {
|
||||
v_1 = sbp.cursor;
|
||||
sbp.bra = v_1;
|
||||
among_var = sbp.find_among(a_0, 6);
|
||||
if (!among_var)
|
||||
return;
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("y");
|
||||
break;
|
||||
case 2:
|
||||
case 5:
|
||||
sbp.slice_from("u");
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_from("a");
|
||||
break;
|
||||
case 4:
|
||||
sbp.slice_from("o");
|
||||
break;
|
||||
case 6:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_R1() {
|
||||
return I_p1 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R2() {
|
||||
return I_p2 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_standard_suffix() {
|
||||
var among_var, v_1 = sbp.limit - sbp.cursor,
|
||||
v_2, v_3, v_4;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_1, 7);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "s")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (sbp.eq_s_b(3, "nis"))
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (sbp.in_grouping_b(g_s_ending, 98, 116))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_2, 4);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (sbp.in_grouping_b(g_st_ending, 98, 116)) {
|
||||
var c = sbp.cursor - 3;
|
||||
if (sbp.limit_backward <= c && c <= sbp.limit) {
|
||||
sbp.cursor = c;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_4, 8);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ig")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
v_4 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(2, "er")) {
|
||||
sbp.cursor = sbp.limit - v_4;
|
||||
if (!sbp.eq_s_b(2, "en"))
|
||||
break;
|
||||
}
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1())
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 4:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_3, 2);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2() && among_var == 1)
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_prelude();
|
||||
sbp.cursor = v_1;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_standard_suffix();
|
||||
sbp.cursor = sbp.limit_backward;
|
||||
r_postlude();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.de.stemmer, 'stemmer-de');
|
||||
|
||||
/* stop word filter function */
|
||||
lunr.de.stopWordFilter = function(token) {
|
||||
if (lunr.de.stopWordFilter.stopWords.indexOf(token) === -1) {
|
||||
return token;
|
||||
}
|
||||
};
|
||||
|
||||
lunr.de.stopWordFilter.stopWords = new lunr.SortedSet();
|
||||
lunr.de.stopWordFilter.stopWords.length = 232;
|
||||
|
||||
// The space at the beginning is crucial: It marks the empty string
|
||||
// as a stop word. lunr.js crashes during search when documents
|
||||
// processed by the pipeline still contain the empty string.
|
||||
lunr.de.stopWordFilter.stopWords.elements = ' aber alle allem allen aller alles als also am an ander andere anderem anderen anderer anderes anderm andern anderr anders auch auf aus bei bin bis bist da damit dann das dasselbe dazu daß dein deine deinem deinen deiner deines dem demselben den denn denselben der derer derselbe derselben des desselben dessen dich die dies diese dieselbe dieselben diesem diesen dieser dieses dir doch dort du durch ein eine einem einen einer eines einig einige einigem einigen einiger einiges einmal er es etwas euch euer eure eurem euren eurer eures für gegen gewesen hab habe haben hat hatte hatten hier hin hinter ich ihm ihn ihnen ihr ihre ihrem ihren ihrer ihres im in indem ins ist jede jedem jeden jeder jedes jene jenem jenen jener jenes jetzt kann kein keine keinem keinen keiner keines können könnte machen man manche manchem manchen mancher manches mein meine meinem meinen meiner meines mich mir mit muss musste nach nicht nichts noch nun nur ob oder ohne sehr sein seine seinem seinen seiner seines selbst sich sie sind so solche solchem solchen solcher solches soll sollte sondern sonst um und uns unse unsem unsen unser unses unter viel vom von vor war waren warst was weg weil weiter welche welchem welchen welcher welches wenn werde werden wie wieder will wir wird wirst wo wollen wollte während würde würden zu zum zur zwar zwischen über'.split(' ');
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.de.stopWordFilter, 'stopWordFilter-de');
|
||||
};
|
||||
}))
|
1
public/js/lunr/lunr.de.min.js
vendored
1
public/js/lunr/lunr.de.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,444 +0,0 @@
|
||||
/*!
|
||||
* Lunr languages, `Dutch` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
;
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.du = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.du.trimmer,
|
||||
lunr.du.stopWordFilter,
|
||||
lunr.du.stemmer
|
||||
);
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.du.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.du.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.du.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.du.trimmer, 'trimmer-du');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.du.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function DutchStemmer() {
|
||||
var a_0 = [new Among("", -1, 6), new Among("\u00E1", 0, 1),
|
||||
new Among("\u00E4", 0, 1), new Among("\u00E9", 0, 2),
|
||||
new Among("\u00EB", 0, 2), new Among("\u00ED", 0, 3),
|
||||
new Among("\u00EF", 0, 3), new Among("\u00F3", 0, 4),
|
||||
new Among("\u00F6", 0, 4), new Among("\u00FA", 0, 5),
|
||||
new Among("\u00FC", 0, 5)
|
||||
],
|
||||
a_1 = [new Among("", -1, 3),
|
||||
new Among("I", 0, 2), new Among("Y", 0, 1)
|
||||
],
|
||||
a_2 = [
|
||||
new Among("dd", -1, -1), new Among("kk", -1, -1),
|
||||
new Among("tt", -1, -1)
|
||||
],
|
||||
a_3 = [new Among("ene", -1, 2),
|
||||
new Among("se", -1, 3), new Among("en", -1, 2),
|
||||
new Among("heden", 2, 1), new Among("s", -1, 3)
|
||||
],
|
||||
a_4 = [
|
||||
new Among("end", -1, 1), new Among("ig", -1, 2),
|
||||
new Among("ing", -1, 1), new Among("lijk", -1, 3),
|
||||
new Among("baar", -1, 4), new Among("bar", -1, 5)
|
||||
],
|
||||
a_5 = [
|
||||
new Among("aa", -1, -1), new Among("ee", -1, -1),
|
||||
new Among("oo", -1, -1), new Among("uu", -1, -1)
|
||||
],
|
||||
g_v = [17, 65,
|
||||
16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
||||
],
|
||||
g_v_I = [1, 0, 0,
|
||||
17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
||||
],
|
||||
g_v_j = [
|
||||
17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
||||
],
|
||||
I_p2, I_p1, B_e_found, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function r_prelude() {
|
||||
var among_var, v_1 = sbp.cursor,
|
||||
v_2, v_3;
|
||||
while (true) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among(a_0, 11);
|
||||
if (among_var) {
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("a");
|
||||
continue;
|
||||
case 2:
|
||||
sbp.slice_from("e");
|
||||
continue;
|
||||
case 3:
|
||||
sbp.slice_from("i");
|
||||
continue;
|
||||
case 4:
|
||||
sbp.slice_from("o");
|
||||
continue;
|
||||
case 5:
|
||||
sbp.slice_from("u");
|
||||
continue;
|
||||
case 6:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
break;
|
||||
sbp.cursor++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
sbp.bra = v_1;
|
||||
if (sbp.eq_s(1, "y")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
sbp.slice_from("Y");
|
||||
} else
|
||||
sbp.cursor = v_1;
|
||||
while (true) {
|
||||
v_2 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 232)) {
|
||||
v_3 = sbp.cursor;
|
||||
sbp.bra = v_3;
|
||||
if (sbp.eq_s(1, "i")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 232)) {
|
||||
sbp.slice_from("I");
|
||||
sbp.cursor = v_2;
|
||||
}
|
||||
} else {
|
||||
sbp.cursor = v_3;
|
||||
if (sbp.eq_s(1, "y")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
sbp.slice_from("Y");
|
||||
sbp.cursor = v_2;
|
||||
} else if (habr1(v_2))
|
||||
break;
|
||||
}
|
||||
} else if (habr1(v_2))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function habr1(v_1) {
|
||||
sbp.cursor = v_1;
|
||||
if (v_1 >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_mark_regions() {
|
||||
I_p1 = sbp.limit;
|
||||
I_p2 = I_p1;
|
||||
if (!habr2()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (I_p1 < 3)
|
||||
I_p1 = 3;
|
||||
if (!habr2())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
|
||||
function habr2() {
|
||||
while (!sbp.in_grouping(g_v, 97, 232)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 232)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_postlude() {
|
||||
var among_var;
|
||||
while (true) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among(a_1, 3);
|
||||
if (among_var) {
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("y");
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("i");
|
||||
break;
|
||||
case 3:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_R1() {
|
||||
return I_p1 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R2() {
|
||||
return I_p2 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_undouble() {
|
||||
var v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.find_among_b(a_2, 3)) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_e_ending() {
|
||||
var v_1;
|
||||
B_e_found = false;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "e")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_v, 97, 232)) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.slice_del();
|
||||
B_e_found = true;
|
||||
r_undouble();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_en_ending() {
|
||||
var v_1;
|
||||
if (r_R1()) {
|
||||
v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_v, 97, 232)) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (!sbp.eq_s_b(3, "gem")) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.slice_del();
|
||||
r_undouble();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_standard_suffix() {
|
||||
var among_var, v_1 = sbp.limit - sbp.cursor,
|
||||
v_2, v_3, v_4, v_5, v_6;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_3, 5);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (r_R1())
|
||||
sbp.slice_from("heid");
|
||||
break;
|
||||
case 2:
|
||||
r_en_ending();
|
||||
break;
|
||||
case 3:
|
||||
if (r_R1() && sbp.out_grouping_b(g_v_j, 97, 232))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
r_e_ending();
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(4, "heid")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "c")) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "en")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
r_en_ending();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_4, 6);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ig")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
v_4 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_4;
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
r_undouble();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (r_R2()) {
|
||||
v_5 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_5;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
r_e_ending();
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 5:
|
||||
if (r_R2() && B_e_found)
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (sbp.out_grouping_b(g_v_I, 73, 232)) {
|
||||
v_6 = sbp.limit - sbp.cursor;
|
||||
if (sbp.find_among_b(a_5, 4) && sbp.out_grouping_b(g_v, 97, 232)) {
|
||||
sbp.cursor = sbp.limit - v_6;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_prelude();
|
||||
sbp.cursor = v_1;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_standard_suffix();
|
||||
sbp.cursor = sbp.limit_backward;
|
||||
r_postlude();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.du.stemmer, 'stemmer-du');
|
||||
|
||||
/* stop word filter function */
|
||||
lunr.du.stopWordFilter = function(token) {
|
||||
if (lunr.du.stopWordFilter.stopWords.indexOf(token) === -1) {
|
||||
return token;
|
||||
}
|
||||
};
|
||||
|
||||
lunr.du.stopWordFilter.stopWords = new lunr.SortedSet();
|
||||
lunr.du.stopWordFilter.stopWords.length = 103;
|
||||
|
||||
// The space at the beginning is crucial: It marks the empty string
|
||||
// as a stop word. lunr.js crashes during search when documents
|
||||
// processed by the pipeline still contain the empty string.
|
||||
lunr.du.stopWordFilter.stopWords.elements = ' aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou'.split(' ');
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.du.stopWordFilter, 'stopWordFilter-du');
|
||||
};
|
||||
}))
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user