Compare commits
45 Commits
master
...
sandpoints
Author | SHA1 | Date |
---|---|---|
Marcell Mars | 6ea76dca6b | |
Marcell Mars | 9a190e9d95 | |
Marcell Mars | e5aab7f744 | |
Marcell Mars | db9a3bf1bb | |
Marcell Mars | 4c7af733c6 | |
Marcell Mars | 10c67230a6 | |
Marcell Mars | f864c9764f | |
Marcell Mars | 6bb117b2f5 | |
Marcell Mars | 07549ecf34 | |
Marcell Mars | 6b345bfa41 | |
Marcell Mars | 390f2e4b84 | |
Marcell Mars | e49420bf86 | |
Marcell Mars | acd6796414 | |
Marcell Mars | 45bcf3f642 | |
Marcell Mars | fedc45de60 | |
Marcell Mars | 8c493c5928 | |
Marcell Mars | 2cf0849d9d | |
Marcell Mars | a97515ee0d | |
Marcell Mars | d9e2e81632 | |
Marcell Mars | 3497a2d3c6 | |
Marcell Mars | d8aa67b621 | |
Sean Dockray | f112e8fa52 | |
Sean Dockray | 1ce60da9cf | |
Sean Dockray | f959140f2a | |
Marcell Mars | 0344d646f8 | |
Sean Dockray | a8abce8c5f | |
Sean Dockray | cdd8980adb | |
Marcell Mars | f186abf1ba | |
Marcell Mars | 20139e8d68 | |
Sean Dockray | 9344b91d0f | |
Sean Dockray | e920fbfaf4 | |
Sean Dockray | a11a7f791c | |
Marcell Mars | 25724fd9f4 | |
Marcell Mars | e47baa31cd | |
Marcell Mars | 410ccdd2c0 | |
Marcell Mars | 4467eb49dd | |
Marcell Mars | 66c4a84f10 | |
Marcell Mars | fd32482866 | |
Marcell Mars | 5ca9d432b7 | |
Marcell Mars | eae85ceb05 | |
Marcell Mars | 9cb68e45d5 | |
Marcell Mars | 2e29830ba0 | |
Marcell Mars | 5b82576849 | |
Marcell Mars | e3efd7c3e2 | |
Marcell Mars | fd78b9e4e3 |
|
@ -0,0 +1,28 @@
|
|||
baseURL = "http://localhost:8000"
|
||||
languageCode = "en-us"
|
||||
title = "Pirate Care"
|
||||
theme = "sandpoints"
|
||||
relativeurls = true
|
||||
disableKinds = ["RSS", "sitemap"]
|
||||
|
||||
[params]
|
||||
description = "Network of activists, researchers and practitioners against the criminalisation of solidarity & for a common care infrastructure."
|
||||
images = ["/images/piratecaqre.png"]
|
||||
title = "Pirate Care Syllabus"
|
||||
giturl = "http://localhost:3000/gitea/pirate-care-syllabus"
|
||||
home = "syllabus"
|
||||
catalogprefix = "hyper://18f79903cb7ce4f1f3c05449418505a296bb2c4e851f7dc9444cf87ed45fb194/"
|
||||
|
||||
[outputFormats]
|
||||
[outputFormats.js]
|
||||
isPlainText = true
|
||||
mediaType = "application/javascript"
|
||||
|
||||
[outputs]
|
||||
list = ["html", "js"]
|
||||
|
||||
[markup]
|
||||
[markup.tableOfContents]
|
||||
endLevel=4
|
||||
ordered = true
|
||||
startLevel = 1
|
|
@ -1,14 +1,17 @@
|
|||
baseURL = "https://syllabus.pirate.care"
|
||||
languageCode = "en-us"
|
||||
title = "Pirate Care"
|
||||
theme = "piratecare"
|
||||
theme = "sandpoints"
|
||||
relativeurls = true
|
||||
disableKinds = ["RSS", "sitemap", "taxonomy"]
|
||||
disableKinds = ["RSS", "sitemap"]
|
||||
|
||||
[params]
|
||||
description = "Network of activists, researchers and practitioners against the criminalisation of solidarity & for a common care infrastructure."
|
||||
images = ["/images/piratecaqre.png"]
|
||||
title = "Pirate Care Syllabus"
|
||||
giturl = "https://git.memoryoftheworld.org/PirateCare/Syllabus"
|
||||
home = "syllabus"
|
||||
catalogprefix = "/library/"
|
||||
|
||||
[outputFormats]
|
||||
[outputFormats.js]
|
||||
|
@ -21,5 +24,5 @@ disableKinds = ["RSS", "sitemap", "taxonomy"]
|
|||
[markup]
|
||||
[markup.tableOfContents]
|
||||
endLevel=4
|
||||
ordered = false
|
||||
ordered = true
|
||||
startLevel = 1
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
title: "Pirate Care"
|
||||
has_topics: ["piratecareintroduction.md", "criminalizationofsolidarity.md", "searescue.md", "housingstruggles.md", "commoningcare.md", "psychosocialautonomy.md", "communitysafetyandcontextualfluidity.md", "transhackfeminism.md", "hormonestoxicityandbodysovereignty.md", "fosteringequityanddiversityinthehackermakerscene.md", "politicisingpiracy.md", "coronanotes.md"]
|
||||
---
|
||||
|
||||
# Pirate Care, a syllabus
|
||||
|
||||
*We live in a world where captains get arrested for saving people’s lives on the sea; where a person downloading scientific articles faces 35 years in jail; where people risk charges for bringing contraceptives to those who otherwise couldn’t get them. Folks are getting in trouble for giving food to the poor, medicine to the sick, water to the thirsty, shelter to the homeless. And yet our heroines care and disobey. They are pirates.*
|
||||
|
||||
---
|
||||
|
||||
Pirate Care is a research process - primarily based in the transnational European space - that maps the increasingly present forms of activism at the intersection of “care” and “piracy”, which in new and interesting ways are trying to intervene in one of the most important challenges of our time, that is, the ‘crisis of care’ in all its multiple and interconnected dimensions.
|
||||
|
||||
These practices are experimenting with self-organisation, alternative approaches to social reproduction and the commoning of tools, technologies and knowledges. Often they act disobediently in expressed non-compliance with laws, regulations and executive orders that ciriminalise the duty of care by imposing exclusions along the lines of class, gender, race or territory. They are not shying risk of persecution in providing unconditional solidarity to those who are the most exploited, discriminated against and condemned to the status of disposable populations.
|
||||
|
||||
The Pirate Care Syllabus we present here for the first time is a tool for supporting and activating collective processes of learning from these practices. We encourage everyone to freely use this syllabus to learn and organise processes of learning and to freely adapt, rewrite and expand it to reflect their own experience and serve their own pedagogies.
|
||||
|
||||
|
||||
> 8th March 2020 - Please Note:
|
||||
> The Pirate Care Syllabus is still work in progress. Some topics and sessions are still under development,
|
||||
> more will be created during the residency at the Kunsthalle (beginning of April) and beyond.
|
||||
|
||||
|
||||
# Care, a political notion
|
||||
|
||||
1. Caring is not intrinsically “nice”, it always involve power relations. Processes of discipline, exclusion and harm can operate inside the matrix of care.
|
||||
|
||||
2. Care labour holds the capacity to disobey power and increase our collective freedom. This is why when it is organised in capitalist, patriarchal and racist ways, it does not work for most living beings. We are in a global crisis of care.
|
||||
|
||||
3. There are no wrong people. Yet, caring for the “wrong” people is more and more socially discouraged, made difficult and criminalized. For many, the crisis of care has been there for a very long time.
|
||||
|
||||
4. Caring is labour. it is necessary and it is skilled labour.
|
||||
|
||||
5. Care labour is shared unfairly and violently in most societies, along lines of gender, provenance, race, class, ability, and age. Some are forced to care, while some defend their privilege of expecting service. This has to change.
|
||||
|
||||
6. Caring labour needs full access to resources, knowledge, tools and technologies. When these are taken away, we must claim them back.
|
||||
|
||||
|
||||
...
|
||||
|
||||
**Contact:** info@pirate.care
|
|
@ -0,0 +1,194 @@
|
|||
#! python
|
||||
"""
|
||||
This is an alternative to `git_hooks_post-receive.sh`.
|
||||
The post commit hook in Gitea would include something like the following to ensure this script is called.
|
||||
|
||||
#!/bin/sh
|
||||
read oldrev newrev ref
|
||||
python "D:\dev\websites\sandpoints-dev\custom_syadmin\git_hooks_post-receive.py" \
|
||||
--git_repo "D:\dev\websites\pirate-care-syllabus\gitea\gitea-repositories\gitea\pirate-care-syllabus.git" \
|
||||
--website "D:\dev\websites\testing-ground\sandpoints" \
|
||||
--website_preview "D:\dev\websites\testing-ground\sandpoints\_preview" \
|
||||
--library "D:\dev\websites\pirate-care-syllabus\_library" \
|
||||
--tmp_dir "D:\tmp\tmp" \
|
||||
--oldrev $oldrev \
|
||||
--newrev $newrev \
|
||||
--ref $ref
|
||||
|
||||
To test this script from the command line without relying on a commit hook being triggered, use:
|
||||
|
||||
python "D:\dev\websites\sandpoints-dev\custom_syadmin\git_hooks_post-receive.py" --ref refs/heads/master --git_repo "D:\dev\websites\pirate-care-syllabus\gitea\gitea-repositories\gitea\pirate-care-syllabus.git" --website D:\\dev\\websites\\testing-ground\\sandpoints --website_preview D:\\dev\\websites\\testing-ground\\sandpoints\\_preview --tmp_dir D:\\tmp\\tmp --git_url "http://localhost:3000/gitea/pirate-care-syllabus" --base_url "http://localhost:8000"
|
||||
|
||||
Just a mental note to read refs from the post-receive hook like this:
|
||||
|
||||
oldrev,newrev,refname = sys.stdin.readline().strip().split(' ')
|
||||
|
||||
"""
|
||||
import os
|
||||
import argparse
|
||||
import random
|
||||
import string
|
||||
import subprocess
|
||||
import shutil
|
||||
import stat
|
||||
from datetime import datetime
|
||||
import logging
|
||||
|
||||
logging.basicConfig(level = logging.DEBUG, filename = "/tmp/git_hooks.log")
|
||||
|
||||
# format for dates
|
||||
date_format = "%m/%d/%Y, %H:%M:%S"
|
||||
|
||||
# Set the variables we'll be allowing for (as CL arg or environment variable)
|
||||
vars = {
|
||||
'oldrev': False, # set programmatically by git hook
|
||||
'newrev': False, # set programmatically by git hook
|
||||
'ref': False, # set programmatically by git hook
|
||||
'library': '_library',
|
||||
'website': '_website',
|
||||
'website_preview': '_websitepreview',
|
||||
'git_repo': False,
|
||||
'base_url': False, #override the site's base
|
||||
'git_url': False,
|
||||
'git_path': 'git',
|
||||
'hugo_path': 'hugo',
|
||||
'tmp_dir': '/tmp',
|
||||
'force': False,
|
||||
'branch': None,
|
||||
'preview_branch': None,
|
||||
}
|
||||
|
||||
# logging time
|
||||
start_time = datetime.now().strftime(date_format)
|
||||
|
||||
def random_string(length=3):
|
||||
""" Generates a random string """
|
||||
letters = string.ascii_lowercase
|
||||
return ''.join(random.choice(letters) for i in range(length))
|
||||
|
||||
|
||||
def get_value(name, default=False):
|
||||
""" Variables can be set as environment variable or in command line """
|
||||
if hasattr(args, name.lower()) and getattr(args, name.lower()) is not None:
|
||||
print('CLI:', name, getattr(args, name.lower()))
|
||||
return getattr(args, name.lower())
|
||||
elif name.upper() in os.environ:
|
||||
print('env:', name, os.environ[name.upper()])
|
||||
return os.environ[name.upper()]
|
||||
else:
|
||||
print('default:', name, default)
|
||||
return default
|
||||
|
||||
|
||||
def cmd(parts, cwd=None, env=None):
|
||||
""" Executes a shell command and returns the output """
|
||||
print(f"Command: {' '.join(parts)} ({cwd})")
|
||||
return subprocess.check_output(parts, cwd=cwd, env=env, universal_newlines=True).strip()
|
||||
|
||||
|
||||
def rmrf(path, keep_dir=False):
|
||||
""" Use safe-rm for recursive removal """
|
||||
""" @TODO: make it safer """
|
||||
def remove_readonly(func, path, excinfo):
|
||||
os.chmod(path, stat.S_IWRITE)
|
||||
func(path)
|
||||
# Try removal.
|
||||
if keep_dir and os.path.exists(path) and len(os.path.realpath(path)) > 1:
|
||||
for root, dirs, files in os.walk(path):
|
||||
for f in files:
|
||||
os.unlink(os.path.join(root, f))
|
||||
for d in dirs:
|
||||
shutil.rmtree(os.path.join(root, d), onerror=remove_readonly)
|
||||
elif os.path.exists(path) and len(os.path.realpath(path)) > 1:
|
||||
shutil.rmtree(path, onerror=remove_readonly)
|
||||
else:
|
||||
print("Either the path doesn't exist or you are trying to delete the root directory(?!):", path)
|
||||
|
||||
|
||||
def clobber(filepath, data, append=False):
|
||||
""" Equivalent of > or >> when append is True """
|
||||
mode = 'a' if append else 'w'
|
||||
with open(filepath, mode) as f:
|
||||
f.write(data)
|
||||
|
||||
|
||||
def build_site(dest, tmp, branch=None, hugo_environment='gitea'):
|
||||
""" builds the website to "dest" using "tmp" as an intermediate location """
|
||||
global GIT_PATH, GIT_REPO, HUGO_PATH
|
||||
if branch:
|
||||
print("Cloning branch: ", branch)
|
||||
cmd([GIT_PATH, 'clone', '--branch', branch, '.', tmp], cwd=GIT_REPO)
|
||||
#print(' '.join([GIT_PATH, 'archive', '--format', 'tar', branch, '|', 'tar', '-x', '-C', tmp]))
|
||||
#subprocess.call(' '.join([GIT_PATH, 'archive', '--format', 'tar', branch, '|', 'tar', '-x', '-C', tmp]), shell=True, cwd=GIT_REPO)
|
||||
else:
|
||||
cmd([GIT_PATH, 'clone', '.', tmp], cwd=GIT_REPO)
|
||||
rmrf(os.path.join(tmp, '.git'))
|
||||
rmrf(dest, keep_dir=True)
|
||||
try:
|
||||
if not os.path.exists(dest):
|
||||
os.makedirs(dest)
|
||||
print("Build destination created: ", dest)
|
||||
else:
|
||||
print("Build destination exists: ", dest)
|
||||
except:
|
||||
print(f"Error creating the directory: {dest}")
|
||||
lcl = f'{tmp}/last-commit-log.html'
|
||||
clobber(lcl, '<html><head><meta charset="utf-8"></head><body><pre>')
|
||||
# overriding hugo config for development environments
|
||||
env = os.environ.copy()
|
||||
if BASE_URL:
|
||||
env["HUGO_PARAMS_BASEURL"] = BASE_URL
|
||||
if GIT_URL:
|
||||
env["HUGO_PARAMS_GITURL"] = GIT_URL
|
||||
# run the hugo command
|
||||
hugo_output = cmd([HUGO_PATH, '--templateMetrics', '-e', hugo_environment, '-d', dest], cwd=tmp, env=env)
|
||||
clobber(lcl, hugo_output, append=True)
|
||||
now_time = datetime.now().strftime(date_format)
|
||||
clobber(lcl, f"\n{start_time}\n{now_time}", append=True)
|
||||
clobber(lcl, f"</pre></body></html>", append=True)
|
||||
shutil.move(lcl, dest)
|
||||
|
||||
|
||||
# Parsing command line arguments
|
||||
parser = argparse.ArgumentParser()
|
||||
for v in vars:
|
||||
parser.add_argument(f"--{v.lower()}")
|
||||
args = parser.parse_args()
|
||||
logging.info(args)
|
||||
|
||||
# Load all variables from command line arguments or environment variables
|
||||
for v in vars:
|
||||
globals()[v.upper()] = get_value(v.lower(), vars[v])
|
||||
|
||||
# set up directories
|
||||
os.makedirs(WEBSITE, exist_ok=True)
|
||||
os.makedirs(WEBSITE_PREVIEW, exist_ok=True)
|
||||
TMP_WEBSITE = os.path.join(TMP_DIR, 'website', random_string())
|
||||
TMP_WEBSITE_PREVIEW = os.path.join(TMP_DIR, 'websitepreview', random_string())
|
||||
os.makedirs(TMP_WEBSITE, exist_ok=True)
|
||||
os.makedirs(TMP_WEBSITE_PREVIEW, exist_ok=True)
|
||||
|
||||
# start working
|
||||
# Check if someone edited the publish trigger
|
||||
published = False
|
||||
refs = cmd([GIT_PATH, 'diff-tree', '--no-commit-id', '--name-only', REF], cwd=GIT_REPO).split("\n")
|
||||
for r in refs:
|
||||
if FORCE or r == "PUBLISH.trigger.md":
|
||||
build_site(WEBSITE, TMP_WEBSITE, branch=BRANCH)
|
||||
published = True
|
||||
# Check if there is a !publish!
|
||||
if not published:
|
||||
refs = cmd([GIT_PATH, 'show', '--format="%s"', '-s'], cwd=GIT_REPO).split(' ')
|
||||
for r in refs:
|
||||
if r == "!publish!":
|
||||
build_site(WEBSITE, TMP_WEBSITE, branch=BRANCH)
|
||||
published = True
|
||||
# Let the world know if there hasn't been a publish
|
||||
if not published:
|
||||
print("The site wasn't build because there was no publish trigger, nor was it forced.")
|
||||
# create preview version
|
||||
build_site(WEBSITE_PREVIEW, TMP_WEBSITE_PREVIEW, branch=PREVIEW_BRANCH, hugo_environment='preview')
|
||||
|
||||
# Clean up temp directories
|
||||
rmrf(TMP_WEBSITE)
|
||||
rmrf(TMP_WEBSITE_PREVIEW)
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"name": "svelte-app",
|
||||
"version": "1.0.0",
|
||||
"devDependencies": {
|
||||
"@fullhuman/postcss-purgecss": "^1.3.0",
|
||||
"postcss": "^7.0.21",
|
||||
"postcss-load-config": "^2.1.0",
|
||||
"rollup": "^1.12.0",
|
||||
"rollup-plugin-commonjs": "^10.0.0",
|
||||
"rollup-plugin-livereload": "^1.0.0",
|
||||
"rollup-plugin-node-resolve": "^5.2.0",
|
||||
"rollup-plugin-svelte": "^5.0.3",
|
||||
"rollup-plugin-terser": "^5.3.0",
|
||||
"rollup-plugin-uglify": "^6.0.4",
|
||||
"simple-svelte-autocomplete": "^1.1.1",
|
||||
"svelte": "^3.0.0",
|
||||
"svelte-preprocess": "^3.2.0-alpha.2",
|
||||
"tailwindcss": "^1.1.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"sirv-cli": "^0.4.4"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"dev": "rollup -c -w",
|
||||
"start": "sirv public --single",
|
||||
"start:dev": "sirv public --single --dev"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
import svelte from 'rollup-plugin-svelte';
|
||||
import resolve from 'rollup-plugin-node-resolve';
|
||||
import commonjs from 'rollup-plugin-commonjs';
|
||||
import livereload from 'rollup-plugin-livereload';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import sveltePreprocess from 'svelte-preprocess';
|
||||
|
||||
//import rollup_start_dev from './rollup_start_dev';
|
||||
|
||||
const production = !process.env.ROLLUP_WATCH;
|
||||
|
||||
export default {
|
||||
input: 'svelte/main.js',
|
||||
output: {
|
||||
sourcemap: true,
|
||||
format: 'iife',
|
||||
name: 'app',
|
||||
file: 'public/js/svelte.js'
|
||||
},
|
||||
plugins: [
|
||||
svelte({
|
||||
preprocess: sveltePreprocess({ postcss: true }),
|
||||
// enable run-time checks when not in production
|
||||
dev: !production,
|
||||
// we'll extract any component CSS out into
|
||||
// a separate file — better for performance
|
||||
css: css => {
|
||||
css.write('public/css/svelte.css');
|
||||
}
|
||||
}),
|
||||
|
||||
// If you have external dependencies installed from
|
||||
// npm, you'll most likely need these plugins. In
|
||||
// some cases you'll need additional configuration —
|
||||
// consult the documentation for details:
|
||||
// https://github.com/rollup/rollup-plugin-commonjs
|
||||
resolve({
|
||||
browser: true,
|
||||
dedupe: importee => importee === 'svelte' || importee.startsWith('svelte/')
|
||||
}),
|
||||
commonjs(),
|
||||
|
||||
// In dev mode, call `npm run start:dev` once
|
||||
// the bundle has been generated
|
||||
//!production && rollup_start_dev,
|
||||
|
||||
// Watch the `public` directory and refresh the
|
||||
// browser on changes when not in production
|
||||
!production && livereload('public'),
|
||||
|
||||
// If we're building for production (npm run build
|
||||
// instead of npm run dev), minify
|
||||
production && terser()
|
||||
],
|
||||
watch: {
|
||||
clearScreen: false
|
||||
}
|
||||
};
|
Before Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 7.0 KiB |
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square150x150logo src="/mstile-150x150.png"/>
|
||||
<TileColor>#da532c</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
</browserconfig>
|
Before Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 992 B |
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
||||
width="100.000000pt" height="100.000000pt" viewBox="0 0 100.000000 100.000000"
|
||||
preserveAspectRatio="xMidYMid meet">
|
||||
<metadata>
|
||||
Created by potrace 1.11, written by Peter Selinger 2001-2013
|
||||
</metadata>
|
||||
<g transform="translate(0.000000,100.000000) scale(0.100000,-0.100000)"
|
||||
fill="#000000" stroke="none">
|
||||
<path d="M420 655 c0 -32 -2 -35 -30 -35 l-30 0 0 -95 0 -95 -35 0 c-33 0 -35
|
||||
2 -35 35 0 32 -2 35 -30 35 -28 0 -30 -3 -30 -35 0 -32 2 -35 30 -35 l30 0 0
|
||||
-95 0 -95 -30 0 c-27 0 -30 3 -30 30 0 27 -3 30 -30 30 -27 0 -30 -3 -30 -30
|
||||
0 -27 3 -30 30 -30 27 0 30 -3 30 -30 0 -27 3 -30 30 -30 27 0 30 3 30 30 0
|
||||
28 3 30 35 30 l35 0 0 95 0 95 30 0 30 0 0 -125 0 -125 -30 0 c-28 0 -30 -3
|
||||
-30 -35 0 -32 2 -35 30 -35 28 0 30 3 30 35 0 33 2 35 35 35 l35 0 0 125 0
|
||||
125 30 0 30 0 0 -125 0 -125 29 0 c26 0 30 -4 33 -32 3 -29 7 -33 36 -36 32
|
||||
-3 33 -2 30 30 -3 29 -7 33 -35 36 l-33 3 0 125 0 124 35 0 35 0 0 -95 0 -95
|
||||
30 0 c27 0 30 -3 30 -30 0 -28 3 -30 35 -30 32 0 35 2 35 30 0 27 3 30 30 30
|
||||
27 0 30 3 30 30 0 27 -3 30 -30 30 -27 0 -30 -3 -30 -30 0 -28 -3 -30 -35 -30
|
||||
l-35 0 0 94 0 95 33 3 c28 3 32 6 32 33 0 27 -3 30 -30 30 -27 0 -30 -4 -33
|
||||
-32 -3 -29 -7 -33 -33 -33 l-29 0 0 94 0 95 -32 3 c-29 3 -33 7 -36 36 l-3 32
|
||||
-95 0 -94 0 0 -35z m70 -125 c0 -28 -3 -30 -35 -30 -32 0 -35 2 -35 30 0 28 3
|
||||
30 35 30 32 0 35 -2 35 -30z m120 0 c0 -27 -3 -30 -30 -30 -27 0 -30 3 -30 30
|
||||
0 27 3 30 30 30 27 0 30 -3 30 -30z"/>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.6 KiB |
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"name": "",
|
||||
"short_name": "",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/android-chrome-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"theme_color": "#ffffff",
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
<script>
|
||||
console.log("minimal svelte attached to <body>")
|
||||
</script>
|
|
@ -0,0 +1,10 @@
|
|||
import App from './App.svelte';
|
||||
|
||||
const app = new App({
|
||||
target: document.body,
|
||||
props: {
|
||||
name: 'world'
|
||||
}
|
||||
});
|
||||
|
||||
export default app;
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
title: "{{ replace .Name "-" " " | title }}"
|
||||
---
|
|
@ -1,11 +0,0 @@
|
|||
const themeDir = __dirname + '/../../../';
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
require('postcss-import')({
|
||||
path: [themeDir]
|
||||
}),
|
||||
require('tailwindcss')(themeDir + 'assets/css/tailwind.config.js'),
|
||||
require('autoprefixer'),
|
||||
]
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
const themeDir = __dirname + '/../../';
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
require('postcss-import')({
|
||||
path: [themeDir]
|
||||
}),
|
||||
require('tailwindcss')(themeDir + 'assets/css/tailwind.config.js'),
|
||||
// Configuration of purgecss for Tailwindcss
|
||||
// see https://tailwindcss.com/docs/controlling-file-size/#setting-up-purgecss
|
||||
require('@fullhuman/postcss-purgecss')({
|
||||
// Specify the paths to all of the template files in your project
|
||||
content: [
|
||||
themeDir + 'layouts/**/*.html',
|
||||
themeDir + 'exampleSite/content/**/*.html',
|
||||
'layouts/**/*.html',
|
||||
'content/**/*.html',
|
||||
],
|
||||
// Include any special characters you're using in this regular expression
|
||||
defaultExtractor: content => content.match(/[A-Za-z0-9-_:\/]+/g) || [],
|
||||
fontFace: true
|
||||
}),
|
||||
require('autoprefixer')({
|
||||
grid: true
|
||||
}),
|
||||
require('postcss-reporter'),
|
||||
]
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/* paged.js style */
|
||||
|
||||
@page {
|
||||
size: A4;
|
||||
}
|
||||
|
||||
@page :first {
|
||||
@bottom {
|
||||
content: none;
|
||||
}
|
||||
}
|
||||
|
||||
@page {
|
||||
margin-bottom: 5mm;
|
||||
@top {
|
||||
color: #996561;
|
||||
font-size: 1rem;
|
||||
font-family: 'VG5000-Regular';
|
||||
content: element(topic);
|
||||
}
|
||||
|
||||
@bottom {
|
||||
color: #996561;
|
||||
font-size: 0.5rem;
|
||||
font-family: 'VG5000-Regular';
|
||||
content: "▒▒ 🐟 ▒ ▒▒▒ 🐙 ▒▒▒🏃 ▒▒☄▒ PAGE: " counter(page) " ▒ ▒▒▒▒ ⚡ ▒🔍▒ ☠ ▒ ▒▒▒";
|
||||
}
|
||||
}
|
||||
|
||||
@page topic:first {
|
||||
@top {
|
||||
content: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
@apply bg-CoconutCream text-Revolver font-playfair;
|
||||
}
|
||||
|
||||
.runningTopic {
|
||||
position: running(topic);
|
||||
}
|
||||
|
||||
.topic {
|
||||
break-before: page;
|
||||
page: topic;
|
||||
}
|
||||
|
||||
.title-text {
|
||||
@apply font-playfair text-6xl text-AuChico mb-20;
|
||||
}
|
||||
|
||||
.title-pretext {
|
||||
@apply font-vg5000 text-2xl text-AuChico;
|
||||
}
|
||||
|
||||
.topic-text {
|
||||
@apply font-playfair text-4xl text-AuChico mb-20;
|
||||
}
|
||||
|
||||
.topic-pretext {
|
||||
@apply font-vg5000 text-2xl text-AuChico;
|
||||
}
|
||||
|
||||
article ul li:before {
|
||||
content: "";
|
||||
}
|
||||
|
||||
.toc::after {
|
||||
text-align: right;
|
||||
float: right;
|
||||
content: target-counter(attr(href url), page, decimal-leading-zero);
|
||||
}
|
||||
}
|
|
@ -1,173 +0,0 @@
|
|||
@font-face {
|
||||
font-family: 'PlayfairDisplay Black';
|
||||
font-weight: 400;
|
||||
src: url("../fonts/PlayfairDisplay-Black.woff") format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'PlayfairDisplay Italic';
|
||||
font-weight: 400;
|
||||
src: url("../fonts/PlayfairDisplay-Italic.woff") format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'PlayfairDisplay BlackItalic';
|
||||
font-weight: 400;
|
||||
src: url("../fonts/PlayfairDisplay-BlackItalic.woff") format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'PlayfairDisplay Bold';
|
||||
font-weight: 400;
|
||||
src: url("../fonts/PlayfairDisplay-Bold.woff") format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'PlayfairDisplay BoldItalic';
|
||||
font-weight: 400;
|
||||
src: url("../fonts/PlayfairDisplay-BoldItalic.woff") format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'PlayfairDisplay Regular';
|
||||
font-weight: 400;
|
||||
src: url("../fonts/PlayfairDisplay-Regular.woff") format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'PlayfairDisplay SC-Regular';
|
||||
font-weight: 400;
|
||||
src: url("../fonts/PlayfairDisplaySC-Regular.woff") format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'VG5000-Regular';
|
||||
font-weight: 400;
|
||||
src: url("../fonts/VG5000-Regular_web.woff") format('woff');
|
||||
}
|
||||
|
||||
button, [type=button] {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: 1.2em;
|
||||
@apply bg-CoconutCream;
|
||||
}
|
||||
|
||||
img {
|
||||
@apply py-2;
|
||||
}
|
||||
|
||||
/* purgecss ignore */
|
||||
h1 {
|
||||
@apply text-3xl;
|
||||
break-after: avoid;
|
||||
}
|
||||
|
||||
/* purgecss ignore */
|
||||
h2 {
|
||||
@apply text-2xl;
|
||||
break-after: avoid;
|
||||
}
|
||||
|
||||
/* purgecss ignore */
|
||||
h3 {
|
||||
@apply text-xl;
|
||||
break-after: avoid;
|
||||
}
|
||||
|
||||
/* purgecss ignore */
|
||||
blockquote {
|
||||
@apply italic;
|
||||
}
|
||||
|
||||
p {
|
||||
@apply pb-2 leading-tight;
|
||||
}
|
||||
|
||||
footer {
|
||||
@apply font-vg5000 text-xs text-Revolver;
|
||||
}
|
||||
|
||||
article ul {
|
||||
@apply relative list-none ml-0 pl-3;
|
||||
}
|
||||
|
||||
article ul li:before {
|
||||
@apply font-vg5000 text-AuChico text-xs left-0 absolute pt-2 pb-2;
|
||||
content: "•";
|
||||
}
|
||||
|
||||
article li {
|
||||
@apply pl-2;
|
||||
}
|
||||
|
||||
a {
|
||||
@apply text-AuChico;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
@apply underline;
|
||||
}
|
||||
|
||||
.edit-button {
|
||||
@apply border-b-4 border-CoconutCream px-1 bg-AuChico mb-2 font-vg5000 text-CoconutCream;
|
||||
}
|
||||
|
||||
.edit-button:hover {
|
||||
@apply bg-CoconutCream text-AuChico border-b-2 border-AuChico;
|
||||
}
|
||||
|
||||
.title-text {
|
||||
@apply font-playfair text-4xl text-AuChico;
|
||||
}
|
||||
|
||||
.title-pretext {
|
||||
@apply font-vg5000 text-base text-AuChico;
|
||||
}
|
||||
.content-text {
|
||||
@apply font-playfair text-xl text-Revolver;
|
||||
}
|
||||
|
||||
.sidebar-title {
|
||||
@apply font-vg5000 text-base text-AuChico;
|
||||
}
|
||||
|
||||
.sidebar-list {
|
||||
@apply font-vg5000 text-xl text-AuChico;
|
||||
}
|
||||
|
||||
.logo {
|
||||
@apply font-vg5000 text-xl text-AuChico pt-2;
|
||||
}
|
||||
|
||||
/* dropdown menu */
|
||||
|
||||
.ddmenu .sidebar-title {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ddmenu input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ddmenu .hiddendiv {
|
||||
@apply pb-1 hidden;
|
||||
}
|
||||
|
||||
.ddmenu input:not(:checked) ~ .hiddendiv {
|
||||
@apply block pb-4;
|
||||
}
|
||||
|
||||
#TableOfContents {
|
||||
@apply font-vg5000 text-xl text-AuChico -ml-2;
|
||||
}
|
||||
|
||||
#TableOfContents ul {
|
||||
@apply ml-2;
|
||||
}
|
||||
|
||||
#TableOfContents li:before {
|
||||
content: "> ";
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
/* Tailwind base - put variables under: tailwind.config.js */
|
||||
@import "node_modules/tailwindcss/base";
|
||||
@import "node_modules/tailwindcss/components";
|
||||
@import "node_modules/tailwindcss/utilities";
|
||||
@import "assets/css/site.css";
|
||||
@import "assets/css/print.css";
|
|
@ -1,20 +0,0 @@
|
|||
module.exports = {
|
||||
theme: {
|
||||
screens: {
|
||||
'md': {'max': '767px'},
|
||||
'lg': {'min': '768px'}
|
||||
},
|
||||
fontFamily: {
|
||||
'vg5000': ['"VG5000-Regular"', 'sans'],
|
||||
'playfair': ['"PlayfairDisplay Regular"', 'sans']
|
||||
},
|
||||
colors: {
|
||||
CoconutCream: '#F2F6D5',
|
||||
AuChico: '#996561',
|
||||
Revolver: '#29102F'
|
||||
},
|
||||
extend: {}
|
||||
},
|
||||
variants: {},
|
||||
plugins: []
|
||||
};
|
|
@ -1,42 +0,0 @@
|
|||
{{- $text_link := .Text -}}
|
||||
{{- if strings.HasPrefix .Destination "bib:" -}}
|
||||
{{- $destination := (substr .Destination 4) -}}
|
||||
{{- if index $.Page.Site.Data.books.piratecarecollection $destination -}}
|
||||
{{- $b := index $.Page.Site.Data.books.piratecarecollection $destination -}}
|
||||
{{- if not $text_link -}}
|
||||
<span>{{- delimit $b.authors ", " " & " -}}{{- with $b.pubdate -}}, {{- substr . 0 4}}{{- end -}}.<a href="/library/BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with $b.title}} title="{{- . -}}"{{- end -}} target="_blank"><i>‘{{- $b.title -}}’</i></a>. {{- with $b.publisher -}}{{- . -}}.{{- end -}}</span>
|
||||
{{- else -}}
|
||||
<a href="/library/BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with $b.title}} title="{{- . -}}"{{- end -}} target="_blank">{{- $text_link -}}</a>
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
<a href="/library/BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with .Title}} title="{{- . -}}"{{- end -}}>{{- $text_link -}}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">bib:{{- $destination -}} not found</span></a>
|
||||
{{- end -}}
|
||||
{{- else if strings.HasPrefix .Destination "session:" -}}
|
||||
{{- $s_destination := printf "/session/%s" (substr .Destination 8) -}}
|
||||
{{- if $.Page.Site.GetPage $s_destination -}}
|
||||
{{- $session := $.Page.Site.GetPage $s_destination -}}
|
||||
{{- if not $text_link -}}
|
||||
<a href="{{- $session.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with $session.Title}} title="{{- $session.Title -}}"{{- end -}}>{{- $session.Title -}}</a>
|
||||
{{- else -}}
|
||||
<a href="{{- $session.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with .Title}} title="{{- . -}}"{{- end -}}>{{- $text_link -}}</a>
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
<a href="{{- $s_destination -}}/{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}">{{- $text_link -}}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">session:{{- $s_destination -}} not found</span></a>
|
||||
{{- end -}}
|
||||
{{- else if strings.HasPrefix .Destination "topic:" -}}
|
||||
{{- $t_destination := printf "/topic/%s" (substr .Destination 6) -}}
|
||||
{{- if $.Page.Site.GetPage $t_destination -}}
|
||||
{{- $topic := $.Page.Site.GetPage $t_destination -}}
|
||||
{{- if not $text_link -}}
|
||||
<a href="{{- $topic.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with $topic.Title}} title="{{- $topic.Title -}}"{{- end -}}>{{- $topic.Title -}}</a>
|
||||
{{- else -}}
|
||||
<a href="{{- $topic.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with .Title}} title="{{- . -}}"{{- end -}}>{{- $text_link -}}</a>
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
<a href="{{- $t_destination -}}/{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}">{{- $text_link -}}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">topic:{{- $t_destination -}} not found</span></a>
|
||||
{{- end -}}
|
||||
{{- else if findRE "^.*static" .Destination -}}
|
||||
<img src="{{- (replaceRE "^.*static" "" .Destination ) | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} />
|
||||
{{- else -}}
|
||||
<img src="{{- .Destination | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} />
|
||||
{{- end -}}
|
|
@ -1,28 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
{{- $filePath := .File -}}
|
||||
{{- $gitUrl := .Site.Data.myvars.giturl -}}
|
||||
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-us{{ end }}">
|
||||
{{- partial "head.html" . -}}
|
||||
{{ partialCached "css.html" . }}
|
||||
<body class="mx-4">
|
||||
{{ with .Site.Data.myvars.edit }}
|
||||
<div class="flex justify-between sticky top-0 static border-b-8 z-10 border-CoconutCream bg-AuChico px-1 pt-2">
|
||||
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_edit/master/content/{{ $filePath }}">edit_this</a>
|
||||
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_new/master/content/topic/">add_new_topic</a>
|
||||
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_new/master/content/session/">add_new_session</a>
|
||||
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_edit/master/PUBLISH.trigger.md">publish</a>
|
||||
<a class="edit-button" target="_blank" href="{{ $gitUrl }}"> ? </a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- partial "header.html" . -}}
|
||||
<main class="lg:flex mb-4 pt-2 justify-between md:flex-row">
|
||||
<aside class="lg:w-2/5 pr-4 pt-16 lg:sticky lg:top-0 lg:static h-full mb-6 md:w-full">
|
||||
{{- block "sidebar" . }}{{- end }}
|
||||
</aside>
|
||||
<article class="lg:w-3/5 pt-32 md:w-full">
|
||||
{{- block "main" . }}{{- end }}
|
||||
</article>
|
||||
</main>
|
||||
{{- partial "footer.html" . -}}
|
||||
</body>
|
||||
</html>
|
|
@ -1,36 +0,0 @@
|
|||
{{ define "sidebar" }}
|
||||
{{$currentNode := . }}
|
||||
<div class="leading-none mb-12">
|
||||
<span class="title-pretext">syllabus ⦚ </span><span class="title-text pt-6">{{ .Title }}</span>
|
||||
</div>
|
||||
|
||||
{{ if ne (trim .Page.TableOfContents "\n") "<nav id=\"TableOfContents\"></nav>" }}
|
||||
<div class="ddmenu">
|
||||
<input id="toggly-toc" type="checkbox" >
|
||||
<label for="toggly-toc" class="sidebar-title" tabindex="1">▒▒ table of contents ▽</label>
|
||||
<div class="hiddendiv">
|
||||
<div class="mt-4">
|
||||
{{ .Page.TableOfContents }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="ddmenu">
|
||||
<input id="toggly" type="checkbox">
|
||||
<label for="toggly" class="sidebar-title mb-1" tabindex="1">▒▒ has topics ▽</label>
|
||||
<div class="hiddendiv">
|
||||
<ul class="mt-4">
|
||||
{{ range .Params.has_topics }}
|
||||
{{ with $.GetPage (printf "%s%s" "/topic/" . ) }}
|
||||
<li><a class="sidebar-list text-base" href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">> {{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<div class="content-text">{{ .Content }}</div>
|
||||
{{ end }}
|
|
@ -1,6 +0,0 @@
|
|||
{{ define "main" }}
|
||||
<article>
|
||||
<div class="font-vg5000"><a href="{{ .Permalink }}">{{ .Title }}</a></div>
|
||||
<div class="font-playfair">{{ .Content }}</div>
|
||||
</article>
|
||||
{{ end }}
|
|
@ -1,42 +0,0 @@
|
|||
{{ $text_link := .Text }}
|
||||
{{ if strings.HasPrefix .Destination "bib:" }}
|
||||
{{ $destination := (substr .Destination 4) }}
|
||||
{{ if index $.Page.Site.Data.books.piratecarecollection $destination }}
|
||||
{{ $b := index $.Page.Site.Data.books.piratecarecollection $destination }}
|
||||
{{ if not $text_link }}
|
||||
<span>{{ delimit $b.authors ", " " & " }}{{ with $b.pubdate }}, {{ substr . 0 4}}{{ end }}.<a href="/library/BROWSE_LIBRARY.html#/book/{{ $destination }}"{{ with $b.title}} title="{{ . }}"{{ end }} target="_blank"><i>‘{{ $b.title }}’</i></a>. {{ with $b.publisher }}{{ . }}.{{ end }}</span>
|
||||
{{ else }}
|
||||
<a href="/library/BROWSE_LIBRARY.html#/book/{{ $destination }}"{{ with $b.title}} title="{{ . }}"{{ end }} target="_blank">{{ $text_link }}</a>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<a href="/library/BROWSE_LIBRARY.html#/book/{{ $destination }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ $text_link }}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">bib:{{ $destination }} not found</span></a>
|
||||
{{ end }}
|
||||
{{ else if strings.HasPrefix .Destination "session:" }}
|
||||
{{ $s_destination := (substr .Destination 8) }}
|
||||
{{ if $.Page.Site.GetPage $s_destination }}
|
||||
{{ $session := $.Page.Site.GetPage $s_destination }}
|
||||
{{ if not $text_link }}
|
||||
<a href="/session/{{ $s_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with $session.Title}} title="{{ $session.Title }}"{{ end }}>{{ $session.Title }}</a>
|
||||
{{ else }}
|
||||
<a href="/session/{{ $s_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ $text_link }}</a>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<a href="/session/{{ $s_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $text_link }}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">session:{{ $s_destination }} not found</span></a>
|
||||
{{ end }}
|
||||
{{ else if strings.HasPrefix .Destination "topic:" }}
|
||||
{{ $t_destination := (substr .Destination 6) }}
|
||||
{{ if $.Page.Site.GetPage $t_destination }}
|
||||
{{ $topic := $.Page.Site.GetPage $t_destination }}
|
||||
{{ if not $text_link }}
|
||||
<a href="/topic/{{ $t_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with $topic.Title}} title="{{ $topic.Title }}"{{ end }}>{{ $topic.Title }}</a>
|
||||
{{ else }}
|
||||
<a href="/topic/{{ $t_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ $text_link }}</a>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<a href="/topic/{{ $t_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $text_link }}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">topic:{{ $t_destination }} not found</span></a>
|
||||
{{ end }}
|
||||
{{ else if findRE "^.*static" .Destination }}
|
||||
<img src="{{ (replaceRE "^.*static" "" .Destination ) | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />
|
||||
{{ else }}
|
||||
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />
|
||||
{{ end }}
|
|
@ -1,28 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
{{- $filePath := .File -}}
|
||||
{{- $gitUrl := .Site.Data.myvars.giturl -}}
|
||||
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-us{{ end }}">
|
||||
{{- partial "head.html" . -}}
|
||||
{{ partialCached "css.html" . }}
|
||||
<body class="mx-4">
|
||||
{{ with .Site.Data.myvars.edit }}
|
||||
<div class="flex justify-between sticky top-0 static border-b-8 z-10 border-CoconutCream bg-AuChico px-1 pt-2">
|
||||
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_edit/master/content/{{ $filePath }}">edit_this</a>
|
||||
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_new/master/content/{{ $filePath.Dir }}">{{ $filePath.Dir }}add_new</a>
|
||||
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_new/master/content">add_new</a>
|
||||
<a class="edit-button" target="_blank" href="{{ $gitUrl }}/_edit/master/PUBLISH.trigger.md">publish</a>
|
||||
<a class="edit-button" target="_blank" href="{{ $gitUrl }}"> ? </a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- partial "header.html" . -}}
|
||||
<main class="lg:flex mb-4 pt-2 justify-between md:flex-row">
|
||||
<aside class="lg:w-2/5 pr-4 pt-16 lg:sticky lg:top-0 lg:static h-full mb-6 md:w-full">
|
||||
{{- block "sidebar" . }}{{- end }}
|
||||
</aside>
|
||||
<article class="lg:w-3/5 pt-32 md:w-full">
|
||||
{{- block "main" . }}{{- end }}
|
||||
</article>
|
||||
</main>
|
||||
{{- partial "footer.html" . -}}
|
||||
</body>
|
||||
</html>
|
|
@ -1,22 +0,0 @@
|
|||
{{ define "sidebar" }}
|
||||
{{$currentNode := . }}
|
||||
<div class="leading-none mb-12">
|
||||
<span class="title-pretext">download ⦚ </span><span class="title-text pt-6">{{ .Title }}</span>
|
||||
</div>
|
||||
|
||||
{{ if ne (trim .Page.TableOfContents "\n") "<nav id=\"TableOfContents\"></nav>" }}
|
||||
<div class="ddmenu">
|
||||
<input id="toggly-toc" type="checkbox" >
|
||||
<label for="toggly-toc" class="sidebar-title" tabindex="1">▒▒ table of contents ▽</label>
|
||||
<div class="hiddendiv">
|
||||
<div class="mt-4">
|
||||
{{ .Page.TableOfContents }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<div class="content-text">{{ .Content }}</div>
|
||||
{{ end }}
|
|
@ -1,6 +0,0 @@
|
|||
{{ define "main" }}
|
||||
<article>
|
||||
<div class="font-vg5000"><a href="{{ .Permalink }}">{{ .Title }}</a></div>
|
||||
<div class="font-playfair">{{ .Content }}</div>
|
||||
</article>
|
||||
{{ end }}
|
|
@ -1 +0,0 @@
|
|||
{{ define "main" }}SECTIONS=[{{ range .Site.Sections }}{"section": "{{ trim .File.Dir "/" }}", "items": [{{ range .Pages }}"{{ .File.BaseFileName }}", {{ end }}]}, {{ end }}];{{ end }}
|
|
@ -1,27 +0,0 @@
|
|||
{{ if eq hugo.Environment "gitea" }}
|
||||
<link rel="stylesheet" href="/css/styles.css">
|
||||
{{ else if .Site.IsServer }}
|
||||
{{ $style := resources.Get "css/styles.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}">
|
||||
{{ else }}
|
||||
{{ $flist := newScratch }}
|
||||
{{ $flist.Set "initial" "nop" }}
|
||||
{{ range (readDir "public/css") }}
|
||||
{{ $finfo := os.Stat (printf "%s%s" "public/css/" .Name) }}
|
||||
{{ $flist.SetInMap "css_files" (printf "%s" $finfo.ModTime) .Name }}
|
||||
{{ $flist.Set "initial" "yay" }}
|
||||
{{ end }}
|
||||
|
||||
{{ $css := "nop" }}
|
||||
|
||||
{{ if eq ($flist.Get "initial") "yay" }}
|
||||
{{ $css = (index (last 1 ( $flist.GetSortedMapValues "css_files" )) 0) }}
|
||||
{{ end }}
|
||||
|
||||
{{ if in $css "css" }}
|
||||
<link rel="stylesheet" href="{{ "/css/" }}{{ $css }}">
|
||||
{{ else }}
|
||||
{{ $style := resources.Get "css/styles.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
|
@ -1,4 +0,0 @@
|
|||
<footer>
|
||||
▒▒▒ ▒ <a href="https://creativecommons.org/licenses/by-sa/4.0/"> ☠</a> 2019-2020 <a href="mailto:info@pirate.care">Piratecare</a> ▒Markdown♻HTML ✈ <a href="https://gohugo.io/" rel="nofollow">Hugo</a> ▒Commits♻<a href="https://git-scm.com/">Git</a> 🐟 <a href="https://gitea.io/">Gitea</a> ▒▒ 🐟 ▒ Print ⚗ <a href="https://pagedjs.org">paged.js</a> ▒▒▒ 🐙  ▒▒▒▒▒▒🏃  ▒▒☄▒▒▒▒   ▒ ⚡  ▒▒▒  ▒▒▒▒▒▒ ▒▒▒▒🔍▒  ☠ ▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒▒ 🐟▒ ☄ ▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒ ▒ ▒ ▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒ ▲ ▒▒▒▒▒▒ ▒▒ ▒ ▒ ▒ ▒▒        ▒        ▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒ ▒ ▒ ▒ ▒▒▒▒▒▒▒▒▒▒ ⚧ ▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒ ◎ ▒▒▒▒▒ ▒▒▒▒ ▒▒▒▒▒▒▒▒                ▒▒ ▒▒▒▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒ ♻ ▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 🏃 ▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ ▒ ▒ ▒ ▒▒▒▒▒▒▒ 🌑 ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒ ▒▒▒▒▒▒▒▒▒▒▒        ▒▒ ▒▒▒▒▒▒▒▒▒ ⚡ ▒▒▒▒▒▒▒▒Design 🖼 <a href="https://www.maddalenafragnito.com">Maddu</a> 🐈▒▒▒▒▒▒ ◎
|
||||
</footer>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
{{ if .Description }}
|
||||
<meta name="description" content="{{ .Description }}" />
|
||||
{{ end }}
|
||||
{{ if .Keywords }}
|
||||
<meta name="keywords" content="{{ delimit .Keywords "," }}" />
|
||||
{{ end }}
|
||||
{{ if .Params.Author }}
|
||||
<meta name="author" content="{{ .Params.Author}}" />
|
||||
{{ end }}
|
||||
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
|
||||
{{ hugo.Generator }}
|
||||
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||
<link rel="manifest" href="/site.webmanifest">
|
||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#996561">
|
||||
|
||||
<title>{{ block "title" . }}{{- .Title }} - {{ .Site.Title -}}{{ end }}</title>
|
||||
</head>
|
|
@ -1,5 +0,0 @@
|
|||
<header class="flex justify-between bg-CoconutCream">
|
||||
<a href="{{ .Site.Home.RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}" class="logo pt-3 cursor-pointer">pirate.care.syllabus  ▒▒▒ 🐙  </a>
|
||||
<a href="/library/BROWSE_LIBRARY.html" target="_blank" class="logo pt-3 cursor-pointer">library.</a>
|
||||
</div>
|
||||
</header>
|
|
@ -1,11 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-us{{ end }}">
|
||||
{{- partial "head.html" . -}}
|
||||
{{- partial "pagedjs.html" . -}}
|
||||
{{ partial "css.html" . }}
|
||||
<body>
|
||||
<article>
|
||||
{{- block "main" . }}{{- end }}
|
||||
</article>
|
||||
</body>
|
||||
</html>
|
|
@ -1,53 +0,0 @@
|
|||
{{ define "main" }}
|
||||
<div class="frontpage">
|
||||
<div class="pb-6"> <span class="title-pretext">syllabus ⦚ </span><span class="title-text">{{ .Site.Home.Title }}</span></div>
|
||||
|
||||
<div class="sidebar-title mb-1 pt-16 mb-4">▒▒ has topics ▽</div>
|
||||
<ul class="mt-8">
|
||||
{{ range .Site.Home.Params.has_topics }}
|
||||
{{ with $.GetPage (printf "%s%s" "/topic/" . ) }}
|
||||
<li><a class="sidebar-list text-base toc" href="#{{ .File.LogicalName }}">> {{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
{{ range .Site.Home.Params.has_topics }}
|
||||
{{ with $.GetPage (printf "%s%s" "/topic/" . ) }}
|
||||
<div class="topic" id="{{ .File.LogicalName }}"><div class="runningTopic"><a href="#{{ .File.LogicalName }}"> topic ⦚ {{ .Title }}</a></div>
|
||||
<div><span class="topic-pretext">topic ⦚ </span><span class="topic-text pt-6">{{ .Title }}</span></div>
|
||||
<div class="sidebar-title mb-1 pt-16">▒▒ has sessions ▽</div>
|
||||
<ul class="mt-4">
|
||||
{{ range .Params.has_sessions }}
|
||||
{{ with $.GetPage (printf "%s%s" "/session/" . ) }}
|
||||
<li><a class="sidebar-list text-base toc" href="#{{ .File.LogicalName }}">> {{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
<div>{{ .Content }}</div>
|
||||
|
||||
{{ range .Params.has_sessions }}
|
||||
{{ with $.GetPage (printf "%s%s" "/session/" . ) }}
|
||||
{{ $session := . }}
|
||||
<div class="topic" id="{{ .File.LogicalName }}"><div class="runningTopic"><a href="#{{ .File.LogicalName }}">session ⦚ {{ .Title }}</a></div>
|
||||
<div><span class="topic-pretext">session ⦚ </span><span class="topic-text pt-6">{{ .Title }}</span></div>
|
||||
<div class="sidebar-title mb-1 pt-16">▒▒ is in ▽</div>
|
||||
<ul class="mt-4">
|
||||
{{ range where $.Site.RegularPages ".Section" "topic" }}
|
||||
{{ if in .Params.has_sessions $session.File.LogicalName }}
|
||||
<li><a class="sidebar-list text-base" href="#{{ .File.LogicalName }}">↖ topic ⦚ {{ .Title }}</a></li>
|
||||
{{ else if in .Params.is_in $session.File.LogicalName }}
|
||||
<li><a class="sidebar-list text-base" href="#{{ .File.LogicalName }}">↖ topic ⦚ {{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
<div class="pt-16">{{ .Content }} </div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
|
@ -1,7 +0,0 @@
|
|||
{{ define "main" }}
|
||||
<div class="sidebar-title mb-1 pb-8">▒▒ all sessions:</div>
|
||||
{{ range .Data.Pages }}
|
||||
<div><a class="sidebar-list text-base" href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">> {{ .Title }}</a></div>
|
||||
{{ end }}
|
||||
<div class="pb-8"></div>
|
||||
{{ end }}
|
|
@ -1,40 +0,0 @@
|
|||
{{ define "sidebar" }}
|
||||
<div class="leading-none mb-12">
|
||||
<span class="title-pretext">session ⦚ </span><span class="title-text pt-6">{{ .Title }}</span>
|
||||
</div>
|
||||
|
||||
{{ if ne (trim .Page.TableOfContents "\n") "<nav id=\"TableOfContents\"></nav>" }}
|
||||
<div class="ddmenu">
|
||||
<input id="toggly-toc" type="checkbox" >
|
||||
<label for="toggly-toc" class="sidebar-title" tabindex="1">▒▒ table of contents ▽</label>
|
||||
<div class="hiddendiv">
|
||||
<div class="mt-4">
|
||||
{{ .Page.TableOfContents }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="ddmenu">
|
||||
<input id="toggly-isin" type="checkbox">
|
||||
<label for="toggly-isin" class="sidebar-title mt-4 mb-1" tabindex="1">▒▒ is in ▽</label>
|
||||
<div class="hiddendiv">
|
||||
<ul class="mt-4">
|
||||
{{ $currentSession := . }}
|
||||
{{ range where $.Site.RegularPages ".Section" "topic" }}
|
||||
{{ if in .Params.has_sessions $currentSession.File.LogicalName }}
|
||||
<li><a class="sidebar-list text-base" href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">↖ topic ⦚ {{ .Title }}</a></li>
|
||||
{{ else if in $currentSession.Params.is_in .File.LogicalName }}
|
||||
<li><a class="sidebar-list text-base" href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">↖ topic ⦚ {{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{define "main" }}
|
||||
<article>
|
||||
<div class="content-text">{{ .Content }}</div>
|
||||
</article>
|
||||
{{ end }}
|
|
@ -1,7 +0,0 @@
|
|||
{{ define "main" }}
|
||||
<div class="sidebar-title mb-1 pb-8">▒▒ all topics:</div>
|
||||
{{ range .Data.Pages }}
|
||||
<div><a class="sidebar-list text-base" href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">> {{ .Title }}</a></div>
|
||||
{{ end }}
|
||||
<div class="pb-8"></div>
|
||||
{{ end }}
|
|
@ -1,55 +0,0 @@
|
|||
{{ define "sidebar" }}
|
||||
{{ $currentNode := . }}
|
||||
<div class="leading-none mb-12">
|
||||
<span class="title-pretext">topic ⦚ </span><span class="title-text pt-6">{{ .Title }}</span>
|
||||
</div>
|
||||
|
||||
{{ if ne (trim .Page.TableOfContents "\n") "<nav id=\"TableOfContents\"></nav>" }}
|
||||
<div class="ddmenu">
|
||||
<input id="toggly-toc" type="checkbox" >
|
||||
<label for="toggly-toc" class="sidebar-title" tabindex="1">▒▒ table of contents ▽</label>
|
||||
<div class="hiddendiv">
|
||||
<div class="mt-4">
|
||||
{{ .Page.TableOfContents }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="ddmenu">
|
||||
<input id="toggly-sessions" type="checkbox">
|
||||
<label for="toggly-sessions" class="sidebar-title mb-1" tabindex="1">▒▒ has sessions ▽</label>
|
||||
<div class="hiddendiv">
|
||||
<ul class="mt-4">
|
||||
{{ range .Params.has_sessions }}
|
||||
{{ with $.GetPage (printf "%s%s" "/session/" . ) }}
|
||||
<li><a class="sidebar-list text-base" href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">> {{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ddmenu">
|
||||
<input id="toggly-isin" type="checkbox">
|
||||
<label for="toggly-isin" class="sidebar-title mt-4 mb-1" tabindex="1">▒▒ is in ▽</label>
|
||||
<div class="hiddendiv">
|
||||
<ul class="mt-4">
|
||||
<li><a class="sidebar-list text-base" href="{{ .Site.Home.RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">↖ syllabus ⦚ {{ .Site.Home.Title }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{define "main" }}
|
||||
<article>
|
||||
{{ if eq .Params.last_modified "top" }}
|
||||
<div class="font-playfair italic text-base">Last modified: {{ dateFormat "Monday, Jan 2, 2006" .Lastmod }}</div>
|
||||
{{ end }}
|
||||
<div class="content-text">{{ .Content }}</div>
|
||||
{{ if eq .Params.last_modified "bottom" }}
|
||||
<div class="font-playfair italic text-base">Last modified: {{ dateFormat "Monday, Jan 2, 2006" .Lastmod }}</div>
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
|
@ -1 +0,0 @@
|
|||
../acorn/bin/acorn
|
|
@ -1 +0,0 @@
|
|||
../autoprefixer/bin/autoprefixer
|
|
@ -1 +0,0 @@
|
|||
../browserslist/cli.js
|
|
@ -1 +0,0 @@
|
|||
../cssesc/bin/cssesc
|
|
@ -1 +0,0 @@
|
|||
../detective/bin/detective.js
|
|
@ -1 +0,0 @@
|
|||
../esprima/bin/esparse.js
|
|
@ -1 +0,0 @@
|
|||
../esprima/bin/esvalidate.js
|
|
@ -1 +0,0 @@
|
|||
../js-yaml/bin/js-yaml.js
|
|
@ -1 +0,0 @@
|
|||
../postcss-cli/bin/postcss
|
|
@ -1 +0,0 @@
|
|||
../purgecss/bin/purgecss
|
|
@ -1 +0,0 @@
|
|||
../tailwindcss/lib/cli.js
|
|
@ -1 +0,0 @@
|
|||
../tailwindcss/lib/cli.js
|
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2020 Full Human
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,89 +0,0 @@
|
|||
# PostCSS Purgecss
|
||||
![David (path)](https://img.shields.io/david/FullHuman/purgecss?path=packages%2Fpostcss-purgecss&style=for-the-badge)
|
||||
![Dependabot](https://img.shields.io/badge/dependabot-enabled-%23024ea4?style=for-the-badge)
|
||||
![npm](https://img.shields.io/npm/v/@fullhuman/postcss-purgecss?style=for-the-badge)
|
||||
![npm](https://img.shields.io/npm/dw/@fullhuman/postcss-purgecss?style=for-the-badge)
|
||||
![GitHub](https://img.shields.io/github/license/FullHuman/purgecss?style=for-the-badge)
|
||||
|
||||
[PostCSS] plugin for PurgeCSS.
|
||||
|
||||
[PostCSS]: https://github.com/postcss/postcss
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
npm i -D @fullhuman/postcss-purgecss
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const purgecss = require('@fullhuman/postcss-purgecss')
|
||||
postcss([
|
||||
purgecss({
|
||||
content: ['./src/**/*.html']
|
||||
})
|
||||
])
|
||||
```
|
||||
|
||||
See [PostCSS] docs for examples for your environment.
|
||||
|
||||
## Options
|
||||
|
||||
All of the options of purgecss are available to use with the plugins.
|
||||
You will find below the main options available. For the complete list, go to the [purgecss documentation website](https://www.purgecss.com/configuration.html#options).
|
||||
|
||||
### `content` (**required**)
|
||||
Type: `string | Object`
|
||||
|
||||
You can specify content that should be analyzed by Purgecss with an array of filenames or globs. The files can be HTML, Pug, Blade, etc.
|
||||
|
||||
### `extractors`
|
||||
Type: `Array<Object>`
|
||||
|
||||
Purgecss can be adapted to suit your needs. If you notice a lot of unused CSS is not being removed, you might want to use a custom extractor.
|
||||
More information about extractors [here](https://www.purgecss.com/extractors.html).
|
||||
|
||||
### `whitelist`
|
||||
Type: `Array<string>`
|
||||
|
||||
You can whitelist selectors to stop Purgecss from removing them from your CSS. This can be accomplished with the options whitelist and whitelistPatterns.
|
||||
|
||||
### `whitelistPatterns`
|
||||
Type: `Array<RegExp>`
|
||||
|
||||
You can whitelist selectors based on a regular expression with whitelistPatterns.
|
||||
|
||||
### `rejected`
|
||||
Type: `boolean`
|
||||
Default value: `false`
|
||||
|
||||
If true, purged selectors will be captured and rendered as PostCSS messages.
|
||||
Use with a PostCSS reporter plugin like [`postcss-reporter`](https://github.com/postcss/postcss-reporter)
|
||||
to print the purged selectors to the console as they are processed.
|
||||
|
||||
### `keyframes`
|
||||
Type: `boolean`
|
||||
Default value: `false`
|
||||
|
||||
If you are using a CSS animation library such as animate.css, you can remove unused keyframes by setting the keyframes option to true.
|
||||
|
||||
#### `fontFace`
|
||||
Type: `boolean`
|
||||
Default value: `false`
|
||||
|
||||
If there are any unused @font-face rules in your css, you can remove them by setting the fontFace option to true.
|
||||
|
||||
## Contributing
|
||||
|
||||
Please read [CONTRIBUTING.md](./../../CONTRIBUTING.md) for details on our code of
|
||||
conduct, and the process for submitting pull requests to us.
|
||||
|
||||
## Versioning
|
||||
|
||||
postcss-purgecss use [SemVer](http://semver.org/) for versioning.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the MIT License - see the [LICENSE](./../../LICENSE) file
|
||||
for details.
|
31
themes/piratecare/node_modules/@fullhuman/postcss-purgecss/lib/postcss-purgecss.d.ts
generated
vendored
|
@ -1,31 +0,0 @@
|
|||
import postcss from "postcss";
|
||||
interface RawContent {
|
||||
extension: string;
|
||||
raw: string;
|
||||
}
|
||||
interface RawCSS {
|
||||
raw: string;
|
||||
}
|
||||
type ExtractorFunction = (content: string) => string[];
|
||||
interface Extractors {
|
||||
extensions: string[];
|
||||
extractor: ExtractorFunction;
|
||||
}
|
||||
interface UserDefinedOptions {
|
||||
content: Array<string | RawContent>;
|
||||
css: Array<string | RawCSS>;
|
||||
defaultExtractor?: ExtractorFunction;
|
||||
extractors?: Array<Extractors>;
|
||||
fontFace?: boolean;
|
||||
keyframes?: boolean;
|
||||
output?: string;
|
||||
rejected?: boolean;
|
||||
stdin?: boolean;
|
||||
stdout?: boolean;
|
||||
variables?: boolean;
|
||||
whitelist?: string[];
|
||||
whitelistPatterns?: Array<RegExp>;
|
||||
whitelistPatternsChildren?: Array<RegExp>;
|
||||
}
|
||||
declare const purgeCSSPlugin: postcss.Plugin<Pick<UserDefinedOptions, "keyframes" | "content" | "extractors" | "defaultExtractor" | "fontFace" | "output" | "rejected" | "stdin" | "stdout" | "variables" | "whitelist" | "whitelistPatterns" | "whitelistPatternsChildren">>;
|
||||
export { purgeCSSPlugin as default };
|
31
themes/piratecare/node_modules/@fullhuman/postcss-purgecss/lib/postcss-purgecss.esm.d.ts
generated
vendored
|
@ -1,31 +0,0 @@
|
|||
import postcss from "postcss";
|
||||
interface RawContent {
|
||||
extension: string;
|
||||
raw: string;
|
||||
}
|
||||
interface RawCSS {
|
||||
raw: string;
|
||||
}
|
||||
type ExtractorFunction = (content: string) => string[];
|
||||
interface Extractors {
|
||||
extensions: string[];
|
||||
extractor: ExtractorFunction;
|
||||
}
|
||||
interface UserDefinedOptions {
|
||||
content: Array<string | RawContent>;
|
||||
css: Array<string | RawCSS>;
|
||||
defaultExtractor?: ExtractorFunction;
|
||||
extractors?: Array<Extractors>;
|
||||
fontFace?: boolean;
|
||||
keyframes?: boolean;
|
||||
output?: string;
|
||||
rejected?: boolean;
|
||||
stdin?: boolean;
|
||||
stdout?: boolean;
|
||||
variables?: boolean;
|
||||
whitelist?: string[];
|
||||
whitelistPatterns?: Array<RegExp>;
|
||||
whitelistPatternsChildren?: Array<RegExp>;
|
||||
}
|
||||
declare const purgeCSSPlugin: postcss.Plugin<Pick<UserDefinedOptions, "keyframes" | "content" | "extractors" | "defaultExtractor" | "fontFace" | "output" | "rejected" | "stdin" | "stdout" | "variables" | "whitelist" | "whitelistPatterns" | "whitelistPatternsChildren">>;
|
||||
export { purgeCSSPlugin as default };
|
|
@ -1 +0,0 @@
|
|||
import e from"postcss";import s,{mergeExtractorSelectors as o,defaultOptions as t}from"purgecss";const r=e.plugin("postcss-plugin-purgecss",(function(e){return async function(r,n){const c=new s,i={...t,...e};c.options=i;const{content:p,extractors:a}=i,m=p.filter(e=>"string"==typeof e),l=p.filter(e=>"object"==typeof e),u=await c.extractSelectorsFromFiles(m,a),f=c.extractSelectorsFromString(l,a),g=o(u,f);c.walkThroughCSS(r,g),c.options.fontFace&&c.removeUnusedFontFaces(),c.options.keyframes&&c.removeUnusedKeyframes(),c.options.variables&&c.removeUnusedCSSVariables(),c.options.rejected&&c.selectorsRemoved.size>0&&(n.messages.push({type:"purgecss",plugin:"postcss-purgecss",text:`purging ${c.selectorsRemoved.size} selectors:\n ${Array.from(c.selectorsRemoved).map(e=>e.trim()).join("\n ")}`}),c.selectorsRemoved.clear())}}));export default r;
|
1
themes/piratecare/node_modules/@fullhuman/postcss-purgecss/lib/postcss-purgecss.js
generated
vendored
|
@ -1 +0,0 @@
|
|||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var postcss=_interopDefault(require("postcss")),PurgeCSS=require("purgecss"),PurgeCSS__default=_interopDefault(PurgeCSS);const purgeCSSPlugin=postcss.plugin("postcss-plugin-purgecss",(function(e){return async function(t,s){const r=new PurgeCSS__default,o={...PurgeCSS.defaultOptions,...e};r.options=o;const{content:n,extractors:u}=o,c=n.filter(e=>"string"==typeof e),i=n.filter(e=>"object"==typeof e),p=await r.extractSelectorsFromFiles(c,u),a=r.extractSelectorsFromString(i,u),l=PurgeCSS.mergeExtractorSelectors(p,a);r.walkThroughCSS(t,l),r.options.fontFace&&r.removeUnusedFontFaces(),r.options.keyframes&&r.removeUnusedKeyframes(),r.options.variables&&r.removeUnusedCSSVariables(),r.options.rejected&&r.selectorsRemoved.size>0&&(s.messages.push({type:"purgecss",plugin:"postcss-purgecss",text:`purging ${r.selectorsRemoved.size} selectors:\n ${Array.from(r.selectorsRemoved).map(e=>e.trim()).join("\n ")}`}),r.selectorsRemoved.clear())}}));module.exports=purgeCSSPlugin;
|
|
@ -1,66 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"@fullhuman/postcss-purgecss@2.0.6",
|
||||
"/tmp/tailwind-hugo"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@fullhuman/postcss-purgecss@2.0.6",
|
||||
"_id": "@fullhuman/postcss-purgecss@2.0.6",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-RgD05Yd1VFudo1H1b2inb+10AS1mexp1edHfdoJvoeKaoMVoi/9DWrbWOpIrDmKq1CO82oQrb5wf4V64oaNkKQ==",
|
||||
"_location": "/@fullhuman/postcss-purgecss",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@fullhuman/postcss-purgecss@2.0.6",
|
||||
"name": "@fullhuman/postcss-purgecss",
|
||||
"escapedName": "@fullhuman%2fpostcss-purgecss",
|
||||
"scope": "@fullhuman",
|
||||
"rawSpec": "2.0.6",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.6"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@fullhuman/postcss-purgecss/-/postcss-purgecss-2.0.6.tgz",
|
||||
"_spec": "2.0.6",
|
||||
"_where": "/tmp/tailwind-hugo",
|
||||
"author": {
|
||||
"name": "FoundrySH",
|
||||
"email": "no-reply@foundry.sh"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/FullHuman/purgecss/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"postcss": "7.0.26",
|
||||
"purgecss": "^2.0.6"
|
||||
},
|
||||
"description": "PostCSS plugin for PurgeCSS",
|
||||
"directories": {
|
||||
"lib": "lib",
|
||||
"test": "__tests__"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"gitHead": "11f76506924277ec6833e0cd7d0798676b4ac9ef",
|
||||
"homepage": "https://github.com/FullHuman/purgecss#readme",
|
||||
"license": "MIT",
|
||||
"main": "lib/postcss-purgecss.js",
|
||||
"module": "lib/postcss-purgecss.esm.js",
|
||||
"name": "@fullhuman/postcss-purgecss",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/FullHuman/purgecss.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: run tests from root\" && exit 1"
|
||||
},
|
||||
"types": "lib/postcss-purgecss.d.ts",
|
||||
"version": "2.0.6"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Denis Malinochkin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,171 +0,0 @@
|
|||
# @nodelib/fs.scandir
|
||||
|
||||
> List files and directories inside the specified directory.
|
||||
|
||||
## :bulb: Highlights
|
||||
|
||||
The package is aimed at obtaining information about entries in the directory.
|
||||
|
||||
* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional).
|
||||
* :gear: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type. See [`old` and `modern` mode](#old-and-modern-mode).
|
||||
* :link: Can safely work with broken symbolic links.
|
||||
|
||||
## Install
|
||||
|
||||
```console
|
||||
npm install @nodelib/fs.scandir
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import * as fsScandir from '@nodelib/fs.scandir';
|
||||
|
||||
fsScandir.scandir('path', (error, stats) => { /* … */ });
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### .scandir(path, [optionsOrSettings], callback)
|
||||
|
||||
Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path with standard callback-style.
|
||||
|
||||
```ts
|
||||
fsScandir.scandir('path', (error, entries) => { /* … */ });
|
||||
fsScandir.scandir('path', {}, (error, entries) => { /* … */ });
|
||||
fsScandir.scandir('path', new fsScandir.Settings(), (error, entries) => { /* … */ });
|
||||
```
|
||||
|
||||
### .scandirSync(path, [optionsOrSettings])
|
||||
|
||||
Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path.
|
||||
|
||||
```ts
|
||||
const entries = fsScandir.scandirSync('path');
|
||||
const entries = fsScandir.scandirSync('path', {});
|
||||
const entries = fsScandir.scandirSync(('path', new fsScandir.Settings());
|
||||
```
|
||||
|
||||
#### path
|
||||
|
||||
* Required: `true`
|
||||
* Type: `string | Buffer | URL`
|
||||
|
||||
A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
|
||||
#### optionsOrSettings
|
||||
|
||||
* Required: `false`
|
||||
* Type: `Options | Settings`
|
||||
* Default: An instance of `Settings` class
|
||||
|
||||
An [`Options`](#options) object or an instance of [`Settings`](#settingsoptions) class.
|
||||
|
||||
> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class.
|
||||
|
||||
### Settings([options])
|
||||
|
||||
A class of full settings of the package.
|
||||
|
||||
```ts
|
||||
const settings = new fsScandir.Settings({ followSymbolicLinks: false });
|
||||
|
||||
const entries = fsScandir.scandirSync('path', settings);
|
||||
```
|
||||
|
||||
## Entry
|
||||
|
||||
* `name` — The name of the entry (`unknown.txt`).
|
||||
* `path` — The path of the entry relative to call directory (`root/unknown.txt`).
|
||||
* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. On Node.js below 10.10 will be emulated by [`DirentFromStats`](./src/utils/fs.ts) class.
|
||||
* `stats` (optional) — An instance of `fs.Stats` class.
|
||||
|
||||
For example, the `scandir` call for `tools` directory with one directory inside:
|
||||
|
||||
```ts
|
||||
{
|
||||
dirent: Dirent { name: 'typedoc', /* … */ },
|
||||
name: 'typedoc',
|
||||
path: 'tools/typedoc'
|
||||
}
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### stats
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Adds an instance of `fs.Stats` class to the [`Entry`](#entry).
|
||||
|
||||
> :book: Always use `fs.readdir` without the `withFileTypes` option. ??TODO??
|
||||
|
||||
### followSymbolicLinks
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`.
|
||||
|
||||
### `throwErrorOnBrokenSymbolicLink`
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Throw an error when symbolic link is broken if `true` or safely use `lstat` call if `false`.
|
||||
|
||||
### `pathSegmentSeparator`
|
||||
|
||||
* Type: `string`
|
||||
* Default: `path.sep`
|
||||
|
||||
By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead.
|
||||
|
||||
### `fs`
|
||||
|
||||
* Type: [`FileSystemAdapter`](./src/adapters/fs.ts)
|
||||
* Default: A default FS methods
|
||||
|
||||
By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own.
|
||||
|
||||
```ts
|
||||
interface FileSystemAdapter {
|
||||
lstat?: typeof fs.lstat;
|
||||
stat?: typeof fs.stat;
|
||||
lstatSync?: typeof fs.lstatSync;
|
||||
statSync?: typeof fs.statSync;
|
||||
readdir?: typeof fs.readdir;
|
||||
readdirSync?: typeof fs.readdirSync;
|
||||
}
|
||||
|
||||
const settings = new fsScandir.Settings({
|
||||
fs: { lstat: fakeLstat }
|
||||
});
|
||||
```
|
||||
|
||||
## `old` and `modern` mode
|
||||
|
||||
This package has two modes that are used depending on the environment and parameters of use.
|
||||
|
||||
### old
|
||||
|
||||
* Node.js below `10.10` or when the `stats` option is enabled
|
||||
|
||||
When working in the old mode, the directory is read first (`fs.readdir`), then the type of entries is determined (`fs.lstat` and/or `fs.stat` for symbolic links).
|
||||
|
||||
### modern
|
||||
|
||||
* Node.js 10.10+ and the `stats` option is disabled
|
||||
|
||||
In the modern mode, reading the directory (`fs.readdir` with the `withFileTypes` option) is combined with obtaining information about its entries. An additional call for symbolic links (`fs.stat`) is still present.
|
||||
|
||||
This mode makes fewer calls to the file system. It's faster.
|
||||
|
||||
## Changelog
|
||||
|
||||
See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version.
|
||||
|
||||
## License
|
||||
|
||||
This software is released under the terms of the MIT license.
|
|
@ -1,13 +0,0 @@
|
|||
/// <reference types="node" />
|
||||
import * as fs from 'fs';
|
||||
export declare type FileSystemAdapter = {
|
||||
lstat: typeof fs.lstat;
|
||||
stat: typeof fs.stat;
|
||||
lstatSync: typeof fs.lstatSync;
|
||||
statSync: typeof fs.statSync;
|
||||
readdir: typeof fs.readdir;
|
||||
readdirSync: typeof fs.readdirSync;
|
||||
};
|
||||
export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter;
|
||||
export declare function createFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter;
|
||||
//# sourceMappingURL=fs.d.ts.map
|
|
@ -1,18 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs = require("fs");
|
||||
exports.FILE_SYSTEM_ADAPTER = {
|
||||
lstat: fs.lstat,
|
||||
stat: fs.stat,
|
||||
lstatSync: fs.lstatSync,
|
||||
statSync: fs.statSync,
|
||||
readdir: fs.readdir,
|
||||
readdirSync: fs.readdirSync
|
||||
};
|
||||
function createFileSystemAdapter(fsMethods) {
|
||||
if (fsMethods === undefined) {
|
||||
return exports.FILE_SYSTEM_ADAPTER;
|
||||
}
|
||||
return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
|
||||
}
|
||||
exports.createFileSystemAdapter = createFileSystemAdapter;
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* IS `true` for Node.js 10.10 and greater.
|
||||
*/
|
||||
export declare const IS_SUPPORT_READDIR_WITH_FILE_TYPES: boolean;
|
||||
//# sourceMappingURL=constants.d.ts.map
|
|
@ -1,13 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.');
|
||||
const MAJOR_VERSION = parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
|
||||
const MINOR_VERSION = parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
|
||||
const SUPPORTED_MAJOR_VERSION = 10;
|
||||
const SUPPORTED_MINOR_VERSION = 10;
|
||||
const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
|
||||
const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
|
||||
/**
|
||||
* IS `true` for Node.js 10.10 and greater.
|
||||
*/
|
||||
exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
|
|
@ -1,13 +0,0 @@
|
|||
import { FileSystemAdapter } from './adapters/fs';
|
||||
import * as async from './providers/async';
|
||||
import Settings, { Options } from './settings';
|
||||
import { Dirent, Entry } from './types';
|
||||
declare type AsyncCallback = async.AsyncCallback;
|
||||
declare function scandir(path: string, callback: AsyncCallback): void;
|
||||
declare function scandir(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
|
||||
declare namespace scandir {
|
||||
function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise<Entry[]>;
|
||||
}
|
||||
declare function scandirSync(path: string, optionsOrSettings?: Options | Settings): Entry[];
|
||||
export { scandir, scandirSync, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options };
|
||||
//# sourceMappingURL=index.d.ts.map
|
|
@ -1,24 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const async = require("./providers/async");
|
||||
const sync = require("./providers/sync");
|
||||
const settings_1 = require("./settings");
|
||||
exports.Settings = settings_1.default;
|
||||
function scandir(path, optionsOrSettingsOrCallback, callback) {
|
||||
if (typeof optionsOrSettingsOrCallback === 'function') {
|
||||
return async.read(path, getSettings(), optionsOrSettingsOrCallback);
|
||||
}
|
||||
async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
|
||||
}
|
||||
exports.scandir = scandir;
|
||||
function scandirSync(path, optionsOrSettings) {
|
||||
const settings = getSettings(optionsOrSettings);
|
||||
return sync.read(path, settings);
|
||||
}
|
||||
exports.scandirSync = scandirSync;
|
||||
function getSettings(settingsOrOptions = {}) {
|
||||
if (settingsOrOptions instanceof settings_1.default) {
|
||||
return settingsOrOptions;
|
||||
}
|
||||
return new settings_1.default(settingsOrOptions);
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
/// <reference types="node" />
|
||||
import Settings from '../settings';
|
||||
import { Entry } from '../types';
|
||||
export declare type AsyncCallback = (err: NodeJS.ErrnoException, entries: Entry[]) => void;
|
||||
export declare function read(directory: string, settings: Settings, callback: AsyncCallback): void;
|
||||
export declare function readdirWithFileTypes(directory: string, settings: Settings, callback: AsyncCallback): void;
|
||||
export declare function readdir(directory: string, settings: Settings, callback: AsyncCallback): void;
|
||||
//# sourceMappingURL=async.d.ts.map
|
|
@ -1,90 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fsStat = require("@nodelib/fs.stat");
|
||||
const rpl = require("run-parallel");
|
||||
const constants_1 = require("../constants");
|
||||
const utils = require("../utils");
|
||||
function read(directory, settings, callback) {
|
||||
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
||||
return readdirWithFileTypes(directory, settings, callback);
|
||||
}
|
||||
return readdir(directory, settings, callback);
|
||||
}
|
||||
exports.read = read;
|
||||
function readdirWithFileTypes(directory, settings, callback) {
|
||||
settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
||||
if (readdirError !== null) {
|
||||
return callFailureCallback(callback, readdirError);
|
||||
}
|
||||
const entries = dirents.map((dirent) => ({
|
||||
dirent,
|
||||
name: dirent.name,
|
||||
path: `${directory}${settings.pathSegmentSeparator}${dirent.name}`
|
||||
}));
|
||||
if (!settings.followSymbolicLinks) {
|
||||
return callSuccessCallback(callback, entries);
|
||||
}
|
||||
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
|
||||
rpl(tasks, (rplError, rplEntries) => {
|
||||
if (rplError !== null) {
|
||||
return callFailureCallback(callback, rplError);
|
||||
}
|
||||
callSuccessCallback(callback, rplEntries);
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.readdirWithFileTypes = readdirWithFileTypes;
|
||||
function makeRplTaskEntry(entry, settings) {
|
||||
return (done) => {
|
||||
if (!entry.dirent.isSymbolicLink()) {
|
||||
return done(null, entry);
|
||||
}
|
||||
settings.fs.stat(entry.path, (statError, stats) => {
|
||||
if (statError !== null) {
|
||||
if (settings.throwErrorOnBrokenSymbolicLink) {
|
||||
return done(statError);
|
||||
}
|
||||
return done(null, entry);
|
||||
}
|
||||
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
||||
return done(null, entry);
|
||||
});
|
||||
};
|
||||
}
|
||||
function readdir(directory, settings, callback) {
|
||||
settings.fs.readdir(directory, (readdirError, names) => {
|
||||
if (readdirError !== null) {
|
||||
return callFailureCallback(callback, readdirError);
|
||||
}
|
||||
const filepaths = names.map((name) => `${directory}${settings.pathSegmentSeparator}${name}`);
|
||||
const tasks = filepaths.map((filepath) => {
|
||||
return (done) => fsStat.stat(filepath, settings.fsStatSettings, done);
|
||||
});
|
||||
rpl(tasks, (rplError, results) => {
|
||||
if (rplError !== null) {
|
||||
return callFailureCallback(callback, rplError);
|
||||
}
|
||||
const entries = [];
|
||||
names.forEach((name, index) => {
|
||||
const stats = results[index];
|
||||
const entry = {
|
||||
name,
|
||||
path: filepaths[index],
|
||||
dirent: utils.fs.createDirentFromStats(name, stats)
|
||||
};
|
||||
if (settings.stats) {
|
||||
entry.stats = stats;
|
||||
}
|
||||
entries.push(entry);
|
||||
});
|
||||
callSuccessCallback(callback, entries);
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.readdir = readdir;
|
||||
function callFailureCallback(callback, error) {
|
||||
callback(error);
|
||||
}
|
||||
function callSuccessCallback(callback, result) {
|
||||
callback(null, result);
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
import Settings from '../settings';
|
||||
import { Entry } from '../types';
|
||||
export declare function read(directory: string, settings: Settings): Entry[];
|
||||
export declare function readdirWithFileTypes(directory: string, settings: Settings): Entry[];
|
||||
export declare function readdir(directory: string, settings: Settings): Entry[];
|
||||
//# sourceMappingURL=sync.d.ts.map
|
|
@ -1,52 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fsStat = require("@nodelib/fs.stat");
|
||||
const constants_1 = require("../constants");
|
||||
const utils = require("../utils");
|
||||
function read(directory, settings) {
|
||||
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
||||
return readdirWithFileTypes(directory, settings);
|
||||
}
|
||||
return readdir(directory, settings);
|
||||
}
|
||||
exports.read = read;
|
||||
function readdirWithFileTypes(directory, settings) {
|
||||
const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
|
||||
return dirents.map((dirent) => {
|
||||
const entry = {
|
||||
dirent,
|
||||
name: dirent.name,
|
||||
path: `${directory}${settings.pathSegmentSeparator}${dirent.name}`
|
||||
};
|
||||
if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
|
||||
try {
|
||||
const stats = settings.fs.statSync(entry.path);
|
||||
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
||||
}
|
||||
catch (error) {
|
||||
if (settings.throwErrorOnBrokenSymbolicLink) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
return entry;
|
||||
});
|
||||
}
|
||||
exports.readdirWithFileTypes = readdirWithFileTypes;
|
||||
function readdir(directory, settings) {
|
||||
const names = settings.fs.readdirSync(directory);
|
||||
return names.map((name) => {
|
||||
const entryPath = `${directory}${settings.pathSegmentSeparator}${name}`;
|
||||
const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
|
||||
const entry = {
|
||||
name,
|
||||
path: entryPath,
|
||||
dirent: utils.fs.createDirentFromStats(name, stats)
|
||||
};
|
||||
if (settings.stats) {
|
||||
entry.stats = stats;
|
||||
}
|
||||
return entry;
|
||||
});
|
||||
}
|
||||
exports.readdir = readdir;
|
|
@ -1,21 +0,0 @@
|
|||
import * as fsStat from '@nodelib/fs.stat';
|
||||
import * as fs from './adapters/fs';
|
||||
export declare type Options = {
|
||||
followSymbolicLinks?: boolean;
|
||||
fs?: Partial<fs.FileSystemAdapter>;
|
||||
pathSegmentSeparator?: string;
|
||||
stats?: boolean;
|
||||
throwErrorOnBrokenSymbolicLink?: boolean;
|
||||
};
|
||||
export default class Settings {
|
||||
private readonly _options;
|
||||
readonly followSymbolicLinks: boolean;
|
||||
readonly fs: fs.FileSystemAdapter;
|
||||
readonly pathSegmentSeparator: string;
|
||||
readonly stats: boolean;
|
||||
readonly throwErrorOnBrokenSymbolicLink: boolean;
|
||||
readonly fsStatSettings: fsStat.Settings;
|
||||
constructor(_options?: Options);
|
||||
private _getValue;
|
||||
}
|
||||
//# sourceMappingURL=settings.d.ts.map
|
|
@ -1,24 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const path = require("path");
|
||||
const fsStat = require("@nodelib/fs.stat");
|
||||
const fs = require("./adapters/fs");
|
||||
class Settings {
|
||||
constructor(_options = {}) {
|
||||
this._options = _options;
|
||||
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
||||
this.fs = fs.createFileSystemAdapter(this._options.fs);
|
||||
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
|
||||
this.stats = this._getValue(this._options.stats, false);
|
||||
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
||||
this.fsStatSettings = new fsStat.Settings({
|
||||
followSymbolicLink: this.followSymbolicLinks,
|
||||
fs: this.fs,
|
||||
throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
|
||||
});
|
||||
}
|
||||
_getValue(option, value) {
|
||||
return option === undefined ? value : option;
|
||||
}
|
||||
}
|
||||
exports.default = Settings;
|
|
@ -1,20 +0,0 @@
|
|||
/// <reference types="node" />
|
||||
import * as fs from 'fs';
|
||||
export declare type Entry = {
|
||||
dirent: Dirent;
|
||||
name: string;
|
||||
path: string;
|
||||
stats?: Stats;
|
||||
};
|
||||
export declare type Stats = fs.Stats;
|
||||
export declare type Dirent = {
|
||||
isBlockDevice(): boolean;
|
||||
isCharacterDevice(): boolean;
|
||||
isDirectory(): boolean;
|
||||
isFIFO(): boolean;
|
||||
isFile(): boolean;
|
||||
isSocket(): boolean;
|
||||
isSymbolicLink(): boolean;
|
||||
name: string;
|
||||
};
|
||||
//# sourceMappingURL=index.d.ts.map
|
|
@ -1,2 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@ -1,3 +0,0 @@
|
|||
import { Dirent, Stats } from '../types';
|
||||
export declare function createDirentFromStats(name: string, stats: Stats): Dirent;
|
||||
//# sourceMappingURL=fs.d.ts.map
|
|
@ -1,18 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class DirentFromStats {
|
||||
constructor(name, stats) {
|
||||
this.name = name;
|
||||
this.isBlockDevice = stats.isBlockDevice.bind(stats);
|
||||
this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
|
||||
this.isDirectory = stats.isDirectory.bind(stats);
|
||||
this.isFIFO = stats.isFIFO.bind(stats);
|
||||
this.isFile = stats.isFile.bind(stats);
|
||||
this.isSocket = stats.isSocket.bind(stats);
|
||||
this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
||||
}
|
||||
}
|
||||
function createDirentFromStats(name, stats) {
|
||||
return new DirentFromStats(name, stats);
|
||||
}
|
||||
exports.createDirentFromStats = createDirentFromStats;
|
|
@ -1,3 +0,0 @@
|
|||
import * as fs from './fs';
|
||||
export { fs };
|
||||
//# sourceMappingURL=index.d.ts.map
|
|
@ -1,4 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs = require("./fs");
|
||||
exports.fs = fs;
|
|
@ -1,68 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"@nodelib/fs.scandir@2.1.3",
|
||||
"/tmp/tailwind-hugo"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@nodelib/fs.scandir@2.1.3",
|
||||
"_id": "@nodelib/fs.scandir@2.1.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==",
|
||||
"_location": "/@nodelib/fs.scandir",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@nodelib/fs.scandir@2.1.3",
|
||||
"name": "@nodelib/fs.scandir",
|
||||
"escapedName": "@nodelib%2ffs.scandir",
|
||||
"scope": "@nodelib",
|
||||
"rawSpec": "2.1.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.1.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@nodelib/fs.walk"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
|
||||
"_spec": "2.1.3",
|
||||
"_where": "/tmp/tailwind-hugo",
|
||||
"dependencies": {
|
||||
"@nodelib/fs.stat": "2.0.3",
|
||||
"run-parallel": "^1.1.9"
|
||||
},
|
||||
"description": "List files and directories inside the specified directory",
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
},
|
||||
"gitHead": "3b1ef7554ad7c061b3580858101d483fba847abf",
|
||||
"keywords": [
|
||||
"NodeLib",
|
||||
"fs",
|
||||
"FileSystem",
|
||||
"file system",
|
||||
"scandir",
|
||||
"readdir",
|
||||
"dirent"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "out/index.js",
|
||||
"name": "@nodelib/fs.scandir",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run clean && npm run compile && npm run lint && npm test",
|
||||
"clean": "rimraf {tsconfig.tsbuildinfo,out}",
|
||||
"compile": "tsc -b .",
|
||||
"compile:watch": "tsc -p . --watch --sourceMap",
|
||||
"lint": "eslint \"src/**/*.ts\" --cache",
|
||||
"test": "mocha \"out/**/*.spec.js\" -s 0",
|
||||
"watch": "npm run clean && npm run compile:watch"
|
||||
},
|
||||
"typings": "out/index.d.ts",
|
||||
"version": "2.1.3"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Denis Malinochkin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,126 +0,0 @@
|
|||
# @nodelib/fs.stat
|
||||
|
||||
> Get the status of a file with some features.
|
||||
|
||||
## :bulb: Highlights
|
||||
|
||||
Wrapper around standard method `fs.lstat` and `fs.stat` with some features.
|
||||
|
||||
* :beginner: Normally follows symbolic link.
|
||||
* :gear: Can safely work with broken symbolic link.
|
||||
|
||||
## Install
|
||||
|
||||
```console
|
||||
npm install @nodelib/fs.stat
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import * as fsStat from '@nodelib/fs.stat';
|
||||
|
||||
fsStat.stat('path', (error, stats) => { /* … */ });
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### .stat(path, [optionsOrSettings], callback)
|
||||
|
||||
Returns an instance of `fs.Stats` class for provided path with standard callback-style.
|
||||
|
||||
```ts
|
||||
fsStat.stat('path', (error, stats) => { /* … */ });
|
||||
fsStat.stat('path', {}, (error, stats) => { /* … */ });
|
||||
fsStat.stat('path', new fsStat.Settings(), (error, stats) => { /* … */ });
|
||||
```
|
||||
|
||||
### .statSync(path, [optionsOrSettings])
|
||||
|
||||
Returns an instance of `fs.Stats` class for provided path.
|
||||
|
||||
```ts
|
||||
const stats = fsStat.stat('path');
|
||||
const stats = fsStat.stat('path', {});
|
||||
const stats = fsStat.stat('path', new fsStat.Settings());
|
||||
```
|
||||
|
||||
#### path
|
||||
|
||||
* Required: `true`
|
||||
* Type: `string | Buffer | URL`
|
||||
|
||||
A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
|
||||
#### optionsOrSettings
|
||||
|
||||
* Required: `false`
|
||||
* Type: `Options | Settings`
|
||||
* Default: An instance of `Settings` class
|
||||
|
||||
An [`Options`](#options) object or an instance of [`Settings`](#settings) class.
|
||||
|
||||
> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class.
|
||||
|
||||
### Settings([options])
|
||||
|
||||
A class of full settings of the package.
|
||||
|
||||
```ts
|
||||
const settings = new fsStat.Settings({ followSymbolicLink: false });
|
||||
|
||||
const stats = fsStat.stat('path', settings);
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### `followSymbolicLink`
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Follow symbolic link or not. Call `fs.stat` on symbolic link if `true`.
|
||||
|
||||
### `markSymbolicLink`
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Mark symbolic link by setting the return value of `isSymbolicLink` function to always `true` (even after `fs.stat`).
|
||||
|
||||
> :book: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link.
|
||||
|
||||
### `throwErrorOnBrokenSymbolicLink`
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`.
|
||||
|
||||
### `fs`
|
||||
|
||||
* Type: [`FileSystemAdapter`](./src/adapters/fs.ts)
|
||||
* Default: A default FS methods
|
||||
|
||||
By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own.
|
||||
|
||||
```ts
|
||||
interface FileSystemAdapter {
|
||||
lstat?: typeof fs.lstat;
|
||||
stat?: typeof fs.stat;
|
||||
lstatSync?: typeof fs.lstatSync;
|
||||
statSync?: typeof fs.statSync;
|
||||
}
|
||||
|
||||
const settings = new fsStat.Settings({
|
||||
fs: { lstat: fakeLstat }
|
||||
});
|
||||
```
|
||||
|
||||
## Changelog
|
||||
|
||||
See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version.
|
||||
|
||||
## License
|
||||
|
||||
This software is released under the terms of the MIT license.
|
|
@ -1,11 +0,0 @@
|
|||
/// <reference types="node" />
|
||||
import * as fs from 'fs';
|
||||
export declare type FileSystemAdapter = {
|
||||
lstat: typeof fs.lstat;
|
||||
stat: typeof fs.stat;
|
||||
lstatSync: typeof fs.lstatSync;
|
||||
statSync: typeof fs.statSync;
|
||||
};
|
||||
export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter;
|
||||
export declare function createFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter;
|
||||
//# sourceMappingURL=fs.d.ts.map
|
|
@ -1,16 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs = require("fs");
|
||||
exports.FILE_SYSTEM_ADAPTER = {
|
||||
lstat: fs.lstat,
|
||||
stat: fs.stat,
|
||||
lstatSync: fs.lstatSync,
|
||||
statSync: fs.statSync
|
||||
};
|
||||
function createFileSystemAdapter(fsMethods) {
|
||||
if (fsMethods === undefined) {
|
||||
return exports.FILE_SYSTEM_ADAPTER;
|
||||
}
|
||||
return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
|
||||
}
|
||||
exports.createFileSystemAdapter = createFileSystemAdapter;
|
|
@ -1,13 +0,0 @@
|
|||
import { FileSystemAdapter } from './adapters/fs';
|
||||
import * as async from './providers/async';
|
||||
import Settings, { Options } from './settings';
|
||||
import { Stats } from './types';
|
||||
declare type AsyncCallback = async.AsyncCallback;
|
||||
declare function stat(path: string, callback: AsyncCallback): void;
|
||||
declare function stat(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
|
||||
declare namespace stat {
|
||||
function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise<Stats>;
|
||||
}
|
||||
declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats;
|
||||
export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, Options, Stats };
|
||||
//# sourceMappingURL=index.d.ts.map
|
|
@ -1,24 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const async = require("./providers/async");
|
||||
const sync = require("./providers/sync");
|
||||
const settings_1 = require("./settings");
|
||||
exports.Settings = settings_1.default;
|
||||
function stat(path, optionsOrSettingsOrCallback, callback) {
|
||||
if (typeof optionsOrSettingsOrCallback === 'function') {
|
||||
return async.read(path, getSettings(), optionsOrSettingsOrCallback);
|
||||
}
|
||||
async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
|
||||
}
|
||||
exports.stat = stat;
|
||||
function statSync(path, optionsOrSettings) {
|
||||
const settings = getSettings(optionsOrSettings);
|
||||
return sync.read(path, settings);
|
||||
}
|
||||
exports.statSync = statSync;
|
||||
function getSettings(settingsOrOptions = {}) {
|
||||
if (settingsOrOptions instanceof settings_1.default) {
|
||||
return settingsOrOptions;
|
||||
}
|
||||
return new settings_1.default(settingsOrOptions);
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
import Settings from '../settings';
|
||||
import { ErrnoException, Stats } from '../types';
|
||||
export declare type AsyncCallback = (err: ErrnoException, stats: Stats) => void;
|
||||
export declare function read(path: string, settings: Settings, callback: AsyncCallback): void;
|
||||
//# sourceMappingURL=async.d.ts.map
|
|
@ -1,31 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function read(path, settings, callback) {
|
||||
settings.fs.lstat(path, (lstatError, lstat) => {
|
||||
if (lstatError !== null) {
|
||||
return callFailureCallback(callback, lstatError);
|
||||
}
|
||||
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
||||
return callSuccessCallback(callback, lstat);
|
||||
}
|
||||
settings.fs.stat(path, (statError, stat) => {
|
||||
if (statError !== null) {
|
||||
if (settings.throwErrorOnBrokenSymbolicLink) {
|
||||
return callFailureCallback(callback, statError);
|
||||
}
|
||||
return callSuccessCallback(callback, lstat);
|
||||
}
|
||||
if (settings.markSymbolicLink) {
|
||||
stat.isSymbolicLink = () => true;
|
||||
}
|
||||
callSuccessCallback(callback, stat);
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.read = read;
|
||||
function callFailureCallback(callback, error) {
|
||||
callback(error);
|
||||
}
|
||||
function callSuccessCallback(callback, result) {
|
||||
callback(null, result);
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
import Settings from '../settings';
|
||||
import { Stats } from '../types';
|
||||
export declare function read(path: string, settings: Settings): Stats;
|
||||
//# sourceMappingURL=sync.d.ts.map
|
|
@ -1,22 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function read(path, settings) {
|
||||
const lstat = settings.fs.lstatSync(path);
|
||||
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
||||
return lstat;
|
||||
}
|
||||
try {
|
||||
const stat = settings.fs.statSync(path);
|
||||
if (settings.markSymbolicLink) {
|
||||
stat.isSymbolicLink = () => true;
|
||||
}
|
||||
return stat;
|
||||
}
|
||||
catch (error) {
|
||||
if (!settings.throwErrorOnBrokenSymbolicLink) {
|
||||
return lstat;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
exports.read = read;
|
|
@ -1,17 +0,0 @@
|
|||
import * as fs from './adapters/fs';
|
||||
export declare type Options = {
|
||||
followSymbolicLink?: boolean;
|
||||
fs?: Partial<fs.FileSystemAdapter>;
|
||||
markSymbolicLink?: boolean;
|
||||
throwErrorOnBrokenSymbolicLink?: boolean;
|
||||
};
|
||||
export default class Settings {
|
||||
private readonly _options;
|
||||
readonly followSymbolicLink: boolean;
|
||||
readonly fs: fs.FileSystemAdapter;
|
||||
readonly markSymbolicLink: boolean;
|
||||
readonly throwErrorOnBrokenSymbolicLink: boolean;
|
||||
constructor(_options?: Options);
|
||||
private _getValue;
|
||||
}
|
||||
//# sourceMappingURL=settings.d.ts.map
|
|
@ -1,16 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs = require("./adapters/fs");
|
||||
class Settings {
|
||||
constructor(_options = {}) {
|
||||
this._options = _options;
|
||||
this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
|
||||
this.fs = fs.createFileSystemAdapter(this._options.fs);
|
||||
this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
|
||||
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
||||
}
|
||||
_getValue(option, value) {
|
||||
return option === undefined ? value : option;
|
||||
}
|
||||
}
|
||||
exports.default = Settings;
|
|
@ -1,5 +0,0 @@
|
|||
/// <reference types="node" />
|
||||
import * as fs from 'fs';
|
||||
export declare type Stats = fs.Stats;
|
||||
export declare type ErrnoException = NodeJS.ErrnoException;
|
||||
//# sourceMappingURL=index.d.ts.map
|
|
@ -1,2 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@ -1,63 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"@nodelib/fs.stat@2.0.3",
|
||||
"/tmp/tailwind-hugo"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@nodelib/fs.stat@2.0.3",
|
||||
"_id": "@nodelib/fs.stat@2.0.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==",
|
||||
"_location": "/@nodelib/fs.stat",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@nodelib/fs.stat@2.0.3",
|
||||
"name": "@nodelib/fs.stat",
|
||||
"escapedName": "@nodelib%2ffs.stat",
|
||||
"scope": "@nodelib",
|
||||
"rawSpec": "2.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@nodelib/fs.scandir",
|
||||
"/fast-glob"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz",
|
||||
"_spec": "2.0.3",
|
||||
"_where": "/tmp/tailwind-hugo",
|
||||
"description": "Get the status of a file with some features",
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
},
|
||||
"gitHead": "3b1ef7554ad7c061b3580858101d483fba847abf",
|
||||
"keywords": [
|
||||
"NodeLib",
|
||||
"fs",
|
||||
"FileSystem",
|
||||
"file system",
|
||||
"stat"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "out/index.js",
|
||||
"name": "@nodelib/fs.stat",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run clean && npm run compile && npm run lint && npm test",
|
||||
"clean": "rimraf {tsconfig.tsbuildinfo,out}",
|
||||
"compile": "tsc -b .",
|
||||
"compile:watch": "tsc -p . --watch --sourceMap",
|
||||
"lint": "eslint \"src/**/*.ts\" --cache",
|
||||
"test": "mocha \"out/**/*.spec.js\" -s 0",
|
||||
"watch": "npm run clean && npm run compile:watch"
|
||||
},
|
||||
"typings": "out/index.d.ts",
|
||||
"version": "2.0.3"
|
||||
}
|