hugo stuff...

This commit is contained in:
Marcell Mars 2020-03-05 05:10:52 +01:00
parent 4900631c1e
commit c832f9bfdb
4757 changed files with 443803 additions and 1 deletions

16
PUBLISH.trigger.md Normal file
View File

@ -0,0 +1,16 @@
Publish the current version of the website by changing the text few lines below.
For example, add your name after the line saying: "_ _ _ New changes after this _ _ _"
Don't forget to click on "Comit Changes" to commit the changes.
- [PREVIEW WEB SITE](http:/localhost:1234/_preview)
- [PUBLISHED WEB SITE](http:/localhost:1234/)
---
```
_ _ _ New changes after this _ _ _
marcell...
```

2
archetypes/default.md Normal file
View File

@ -0,0 +1,2 @@
+++
+++

3
archetypes/session.md Normal file
View File

@ -0,0 +1,3 @@
---
title: "{{ replace .Name "-" " " | title }}"
---

View File

@ -0,0 +1,13 @@
baseURL = "https://syllabus.pirate.care"
languageCode = "en-us"
title = "Pirate Care"
theme = "piratecare"
relativeurls = true
[outputFormats]
[outputFormats.js]
isPlainText = true
mediaType = "application/javascript"
[outputs]
list = ["html", "js"]

View File

@ -0,0 +1,2 @@
relativeurls = true
baseURL = ""

View File

@ -1,6 +1,6 @@
---
title: Pirate Care
has_topics: piratecareintroduction, housingstruggles, criminalizationofsolidarity, decolonizingtechnology, commoningcare, transhackfeminism, psychosocialautonomy, communitysafetyandcontextualfluidity, hormonestoxicityandbodysovereignty, politicizingpiracy
has_topics: piratecareintroduction, housingstruggles, criminalizationofsolidarity, fosteringequityanddiversityinthehackermakerscene, commoningcare, transhackfeminism, hormonestoxicityandbodysovereignty, politicisingpiracy
---
Pirate Care researches, gathers & nourishes those care initiatives which are taking risks by operating in the narrow grey zones left open between different knowledges, institutions and laws, inviting all to participate in a exploration of the mutual implications of care and technology that dare questioning the ideology of private property, work and metrics.

View File

@ -0,0 +1,124 @@
#!/bin/bash
set -e
LIBRARY=/var/www/html/library
WEBSITE=/var/www/html/hugopiratecare
[ -d $WEBSITE ] || mkdir -p $WEBSITE
WEBSITEPREVIEW=/var/www/html/hugopiratecare/_preview/
[ -d $WEBSITEPREVIEW ] || mkdir -p $WEBSITEPREVIEW
GIT_URL="https://git.memoryoftheworld.org/PirateCare/Syllabus"
HUGO_PREVIEW_URL="https://syllabus.pirate.care/_preview/"
GIT_PATH="git"
HUGO_PATH="hugo"
BRK="krb"
SAVEIFS=$IFS
TMP_WEBSITE=/tmp/website$RANDOM
TMP_WEBSITEPREVIEW=/tmp/websitepreview$RANDOM
d=`date`
CWD=`pwd`
while read oldrev newrev ref
do
refs=`$GIT_PATH diff-tree --no-commit-id --name-only $ref`
IFS=$'\n'
r=($refs)
for (( i=0; i<${#r[@]}; i++ ))
do
if [ ${r[$i]} = "PUBLISH.trigger.md" ]; then
cd $CWD
$GIT_PATH clone . $TMP_WEBSITE
cd $TMP_WEBSITE
[ -d $WEBSITE ] || mkdir -p $WEBSITE
if [ -d $WEBSITE ]
then
safe-rm -rf ${WEBSITE}*
fi
$HUGO_PATH -e gitea -d $WEBSITE > ${TMP_WEBSITE}/last-commit-log.txt
printf "\n>> $d\n>> `date`" >> ${TMP_WEBSITE}/last-commit-log.txt
mv ${TMP_WEBSITE}/last-commit-log.txt $WEBSITE
cd /tmp/
if [ -d $TMP_WEBSITE ]
then
safe-rm -rf $TMP_WEBSITE
fi
BRK="brk"
break
fi
done
if [ $BRK = "brk" ]; then
break
fi
cd $CWD
refs=`$GIT_PATH show --format="%s" -s`
IFS=$' '
r=($refs)
for (( i=0; i<${#r[@]}; i++ ))
do
if [ ${r[$i]} = "!publish!" ]; then
$GIT_PATH clone . $TMP_WEBSITE
cd $TMP_WEBSITE
[ -d $WEBSITE ] || mkdir -p $WEBSITE
if [ -d $WEBSITE ]
then
safe-rm -rf ${WEBSITE}*
fi
$HUGO_PATH -e gitea -d $WEBSITE > ${TMP_WEBSITE}/last-commit-log.txt
printf "\n>> $d\n>> `date`" >> ${TMP_WEBSITE}/last-commit-log.txt
mv $TMP_WEBSITE/last-commit-log.txt $WEBSITE
cd /tmp/
if [ -d $TMP_WEBSITE ]; then
safe-rm -rf $TMP_WEBSITE
fi
break
fi
done
done
cd $CWD
$GIT_PATH clone . $TMP_WEBSITEPREVIEW
cd $TMP_WEBSITEPREVIEW
[ -d $WEBSITEPREVIEW ] || mkdir -p $WEBSITEPREVIEW
[ -d data ] || mkdir -p data
echo 'edit = true' > data/myvars.toml
echo 'giturl="'${GIT_URL}'"' >> data/myvars.toml
if [ -d $WEBSITEPREVIEW ]
then
safe-rm -rf $WEBSITEPREVIEW
fi
$HUGO_PATH -e gitea -d $WEBSITEPREVIEW > ${TMP_WEBSITEPREVIEW}/last-commit-log.txt
printf "\n>> $d\n>> `date`" >> ${TMP_WEBSITEPREVIEW}/last-commit-log.txt
mv ${TMP_WEBSITEPREVIEW}/last-commit-log.txt $WEBSITEPREVIEW
if [ -d $TMP_WEBSITEPREVIEW ]
then
safe-rm -rf $TMP_WEBSITEPREVIEW
fi
ln -sf $LIBRARY $WEBSITE
ln -sf $LIBRARY $WEBSITEPREVIEW
IFS=$SAVEIFS

File diff suppressed because one or more lines are too long

1
static/css/styles.css Normal file
View File

@ -0,0 +1 @@
/*!normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css*/html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}a{background-color:transparent}b{font-weight:bolder}img{border-style:none}p{margin:0}ul{list-style:none;margin:0;padding:0}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol,noto color emoji;line-height:1.5}*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}img{border-style:solid}a{color:inherit;text-decoration:inherit}img{display:block;vertical-align:middle}img{max-width:100%;height:auto}@font-face{font-family:playfairdisplay regular;font-weight:400;src:url(../fonts/PlayfairDisplay-Regular.woff)format('woff')}@font-face{font-family:vg5000-regular;font-weight:400;src:url(../fonts/VG5000-Regular_web.woff)format('woff')}html{font-size:1.5em;background-color:#f2f6d5}p{padding-bottom:.5rem;line-height:1.25}footer{font-family:vg5000-regular,sans;font-size:.75rem;color:#29102f}a{color:#996561}a:hover{text-decoration:underline}.edit-button{border-bottom-width:4px;border-color:#f2f6d5;padding-left:.25rem;padding-right:.25rem;background-color:#996561;margin-bottom:.5rem;font-family:vg5000-regular,sans;color:#f2f6d5}.edit-button:hover{background-color:#f2f6d5;color:#996561;border-bottom-width:2px;border-color:#996561}.title-text{font-family:playfairdisplay regular,sans;font-size:2.25rem;color:#996561}.title-pretext{font-family:vg5000-regular,sans;font-size:1rem;color:#996561}.content-text{font-family:playfairdisplay regular,sans;font-size:1.25rem;color:#29102f}.sidebar-title{font-family:vg5000-regular,sans;font-size:1rem;color:#996561}.sidebar-list{font-family:vg5000-regular,sans;font-size:1.25rem;color:#996561}.logo{font-family:vg5000-regular,sans;font-size:1.25rem;color:#996561;padding-top:.5rem}.bg-CoconutCream{background-color:#f2f6d5}.bg-AuChico{background-color:#996561}.border-CoconutCream{border-color:#f2f6d5}.border-b-8{border-bottom-width:8px}.cursor-pointer{cursor:pointer}.block{display:block}.flex{display:-webkit-box;display:flex}.justify-between{-webkit-box-pack:justify;justify-content:space-between}.font-vg5000{font-family:vg5000-regular,sans}.font-playfair{font-family:playfairdisplay regular,sans}.font-bold{font-weight:700}.h-full{height:100%}.leading-none{line-height:1}.mx-4{margin-left:1rem;margin-right:1rem}.mb-1{margin-bottom:.25rem}.mt-4{margin-top:1rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-12{margin-bottom:3rem}.p-1{padding:.25rem}.px-1{padding-left:.25rem;padding-right:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pr-4{padding-right:1rem}.pt-6{padding-top:1.5rem}.pb-8{padding-bottom:2rem}.pt-16{padding-top:4rem}.pt-32{padding-top:8rem}.static{position:static}.sticky{position:-webkit-sticky;position:sticky}.top-0{top:0}.text-CoconutCream{color:#f2f6d5}.text-xs{font-size:.75rem}.text-base{font-size:1rem}.w-2\/5{width:40%}.w-3\/5{width:60%}.z-10{z-index:10}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 183 KiB

BIN
static/images/tockice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

20
themes/piratecare/LICENSE Normal file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2020 YOUR_NAME_HERE
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.

View File

@ -0,0 +1,3 @@
---
title: "{{ replace .Name "-" " " | title }}"
---

View File

@ -0,0 +1,3 @@
---
title: "{{ replace .Name "-" " " | title }}"
---

View File

@ -0,0 +1,4 @@
---
title: "{{ replace .Name "-" " " | title }}"
has_sessions:
---

View File

@ -0,0 +1,560 @@
/* Tailwind base - put variables under: tailwind.config.js */
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
/**
* Add the correct font size in all browsers.
*/
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button { /* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
/**
* Remove the default vertical scrollbar in IE 10+.
*/
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
/*
* Add the correct display in all browsers.
*/
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
/**
* Add the correct display in IE 10.
*/
/**
* Manually forked from SUIT CSS Base: https://github.com/suitcss/base
* A thin layer on top of normalize.css that provides a starting point more
* suitable for web applications.
*/
/**
* Removes the default spacing and border for appropriate elements.
*/
p {
margin: 0;
}
button {
background-color: transparent;
background-image: none;
padding: 0;
}
/**
* Work around a Firefox/IE bug where the transparent `button` background
* results in a loss of the default `button` focus styles.
*/
button:focus {
outline: 1px dotted;
outline: 5px auto -webkit-focus-ring-color;
}
ul {
list-style: none;
margin: 0;
padding: 0;
}
/**
* Tailwind custom reset styles
*/
/**
* 1. Use the user's configured `sans` font-family (with Tailwind's default
* sans-serif font stack as a fallback) as a sane default.
* 2. Use Tailwind's default "normal" line-height so the user isn't forced
* to override it to ensure consistency even when using the default theme.
*/
html {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 1 */
line-height: 1.5; /* 2 */
}
/**
* 1. Prevent padding and border from affecting element width.
*
* We used to set this in the html element and inherit from
* the parent element for everything else. This caused issues
* in shadow-dom-enhanced elements like <details> where the content
* is wrapped by a div with box-sizing set to `content-box`.
*
* https://github.com/mozdevs/cssremedy/issues/4
*
*
* 2. Allow adding a border to an element by just adding a border-width.
*
* By default, the way the browser specifies that an element should have no
* border is by setting it's border-style to `none` in the user-agent
* stylesheet.
*
* In order to easily add borders to elements by just setting the `border-width`
* property, we change the default border-style for all elements to `solid`, and
* use border-width to hide them instead. This way our `border` utilities only
* need to set the `border-width` property instead of the entire `border`
* shorthand, making our border utilities much more straightforward to compose.
*
* https://github.com/tailwindcss/tailwindcss/pull/116
*/
*,
::before,
::after {
box-sizing: border-box; /* 1 */
border-width: 0; /* 2 */
border-style: solid; /* 2 */
border-color: currentColor; /* 2 */
}
/*
* Ensure horizontal rules are visible by default
*/
/**
* Undo the `border-style: none` reset that Normalize applies to images so that
* our `border-{width}` utilities have the expected effect.
*
* The Normalize reset is unnecessary for us since we default the border-width
* to 0 on all elements.
*
* https://github.com/tailwindcss/tailwindcss/issues/362
*/
button {
cursor: pointer;
}
/**
* Reset links to optimize for opt-in styling instead of
* opt-out.
*/
a {
color: inherit;
text-decoration: inherit;
}
/**
* Reset form element properties that are easy to forget to
* style explicitly so you don't inadvertently introduce
* styles that deviate from your design system. These styles
* supplement a partial reset that is already applied by
* normalize.css.
*/
button {
padding: 0;
line-height: inherit;
color: inherit;
}
/**
* Use the configured 'mono' font family for elements that
* are expected to be rendered with a monospace font, falling
* back to the system monospace stack if there is no configured
* 'mono' font family.
*/
/**
* Make replaced elements `display: block` by default as that's
* the behavior you want almost all of the time. Inspired by
* CSS Remedy, with `svg` added as well.
*
* https://github.com/mozdevs/cssremedy/issues/14
*/
/**
* Constrain images and videos to the parent width and preserve
* their instrinsic aspect ratio.
*
* https://github.com/mozdevs/cssremedy/issues/14
*/
/* Tailwind component classes registered by plugins*/
/* Site Specific */
@font-face {
font-family: 'PlayfairDisplay Regular';
font-weight: 400;
src: url("../fonts/PlayfairDisplay-Regular.woff") format('woff');
}
@font-face {
font-family: 'VG5000-Regular';
font-weight: 400;
src: url("../fonts/VG5000-Regular_web.woff") format('woff');
}
html {
font-size: 1.5em;
background-color: #F2F6D5;
}
footer {
font-family: "VG5000-Regular", sans;
font-size: 0.75rem;
color: #29102F;
}
.title-text {
font-family: "PlayfairDisplay Regular", sans;
font-size: 2.25rem;
color: #996561;
}
.title-pretext {
font-family: "VG5000-Regular", sans;
font-size: 1rem;
color: #996561;
}
.content-text {
font-family: "PlayfairDisplay Regular", sans;
font-size: 1.25rem;
color: #29102F;
}
.sidebar-title {
font-family: "VG5000-Regular", sans;
font-size: 1rem;
color: #996561;
}
.sidebar-list {
font-family: "VG5000-Regular", sans;
font-size: 1.25rem;
color: #996561;
}
.logo {
font-family: "VG5000-Regular", sans;
font-size: 1.25rem;
color: #996561;
padding-top: 0.5rem;
}
a {
color: #996561;
}
a:hover {
text-decoration: underline;
}
/* Tailwind's utility classes - generated based on config file */
.bg-CoconutCream {
background-color: #F2F6D5;
}
.cursor-pointer {
cursor: pointer;
}
.block {
display: block;
}
.flex {
display: flex;
}
.justify-between {
justify-content: space-between;
}
.font-vg5000 {
font-family: "VG5000-Regular", sans;
}
.font-playfair {
font-family: "PlayfairDisplay Regular", sans;
}
.h-full {
height: 100%;
}
.leading-none {
line-height: 1;
}
.mx-4 {
margin-left: 1rem;
margin-right: 1rem;
}
.mb-1 {
margin-bottom: 0.25rem;
}
.mt-4 {
margin-top: 1rem;
}
.mb-4 {
margin-bottom: 1rem;
}
.mb-6 {
margin-bottom: 1.5rem;
}
.mb-12 {
margin-bottom: 3rem;
}
.pt-2 {
padding-top: 0.5rem;
}
.pt-3 {
padding-top: 0.75rem;
}
.pr-4 {
padding-right: 1rem;
}
.pt-6 {
padding-top: 1.5rem;
}
.pt-8 {
padding-top: 2rem;
}
.pt-32 {
padding-top: 8rem;
}
.fixed {
position: fixed;
}
.sticky {
position: -webkit-sticky;
position: sticky;
}
.top-0 {
top: 0;
}
.text-base {
font-size: 1rem;
}
.w-2\/5 {
width: 40%;
}
.w-3\/5 {
width: 60%;
}

View File

@ -0,0 +1,11 @@
const themeDir = __dirname + '/../../../';
module.exports = {
plugins: [
require('postcss-import')({
path: [themeDir]
}),
require('tailwindcss')(themeDir + 'assets/css/tailwind.config.js'),
require('autoprefixer'),
]
}

View File

@ -0,0 +1,28 @@
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(/[\w-/:]+(?<!:)/g) || [],
fontFace: true
}),
require('autoprefixer')({
grid: true
}),
require('postcss-reporter'),
]
}

View File

@ -0,0 +1,104 @@
@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.5em;
@apply bg-CoconutCream;
}
p {
@apply pb-2 leading-tight;
}
footer {
@apply font-vg5000 text-xs text-Revolver;
}
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;
}

View File

@ -0,0 +1,8 @@
/* Tailwind base - put variables under: tailwind.config.js */
@import "node_modules/tailwindcss/base";
/* Tailwind component classes registered by plugins*/
@import "node_modules/tailwindcss/components";
/* Site Specific */
@import "assets/css/site.css";
/* Tailwind's utility classes - generated based on config file */
@import "node_modules/tailwindcss/utilities";

View File

@ -0,0 +1,16 @@
module.exports = {
theme: {
fontFamily: {
'vg5000': ['"VG5000-Regular"', 'sans'],
'playfair': ['"PlayfairDisplay Regular"', 'sans']
},
colors: {
CoconutCream: '#F2F6D5',
AuChico: '#996561',
Revolver: '#29102F'
},
extend: {}
},
variants: {},
plugins: []
}

View File

@ -0,0 +1,3 @@
{{ define "main" }}
<p>404 - page not found</p>
{{ end }}

View File

@ -0,0 +1,40 @@
{{ $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 ", " " & " }}, {{ substr $b.pubdate 0 4}}.<a href="/library/BROWSE_LIBRARY.html#/book/{{ $destination }}"{{ with $b.title}} title="{{ . }}"{{ end }} target="_blank"><i>{{ $b.title }}</i></a>. {{ $b.publisher }}.</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 "sesssion:" }}
{{ $destination := (substr .Destination 9) }}
{{ if $.Page.Site.GetPage $destination }}
{{ $session := $.Page.Site.GetPage $destination }}
{{ if not $text_link }}
<a href="/session/{{ $destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with $session.Title}} title="{{ $session.Title }}"{{ end }}>{{ $session.Title }}</a>
{{ else }}
<a href="/session/{{ $destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ $text_link }}</a>
{{ end }}
{{ else }}
<a href="/session/{{ $destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $text_link }}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">session:{{ $destination }} not found</span></a>
{{ end }}
{{ else if strings.HasPrefix .Destination "topic:" }}
{{ $destination := (substr .Destination 6) }}
{{ if $.Page.Site.GetPage $destination }}
{{ $topic := $.Page.Site.GetPage $destination }}
{{ if not $text_link }}
<a href="/topic/{{ $destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with $topic.Title}} title="{{ $topic.Title }}"{{ end }}>{{ $topic.Title }}</a>
{{ else }}
<a href="/topic/{{ $destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ $text_link }}</a>
{{ end }}
{{ else }}
<a href="/topic/{{ $destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $text_link }}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">topic:{{ $destination }} not found</span></a>
{{ end }}
{{ else }}
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />
{{ end }}

View File

@ -0,0 +1,28 @@
<!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/{{ $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="flex mb-4 pt-2 justify-between">
<aside class="w-2/5 pr-4 pt-16 sticky top-0 static h-full mb-6">
{{- block "sidebar" . }}{{- end }}
</aside>
<article class="w-3/5 pt-32">
{{- block "main" . }}{{- end }}
</article>
</main>
{{- partial "footer.html" . -}}
</body>
</html>

View File

@ -0,0 +1,19 @@
{{ define "sidebar" }}
{{$currentNode := . }}
<div class="leading-none mb-12">
<span class="title-pretext">syllabus ⦚ </span><span class="title-text pt-6">{{ .Title }}</span>
</div>
<div class="sidebar-title mb-1">▒▒ has topics ▽</div>
<ul>
{{ range split .Params.has_topics "," }}
{{ with $.GetPage (trim . " ") }}
<li><a class="sidebar-list text-base" href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">> {{ .Title }}</a></li>
{{ end }}
{{ end }}
</ul>
{{ end }}
{{ define "main" }}
<div class="content-text">{{ .Content }}</div>
{{ end }}

View File

@ -0,0 +1,6 @@
{{ define "main" }}
<article>
<div class="font-vg5000"><a href="{{ .Permalink }}">{{ .Title }}</a></div>
<div class="font-playfair">{{ .Content }}</div>
</article>
{{ end }}

View File

@ -0,0 +1 @@
{{ block "main" . }}{{ end }}

View File

@ -0,0 +1 @@
{{ define "main" }}SECTIONS=[{{ range .Site.Sections }}{"section": "{{ trim .File.Dir "/" }}", "items": [{{ range .Pages }}"{{ .File.BaseFileName }}", {{ end }}]}, {{ end }}];{{ end }}

View File

@ -0,0 +1,27 @@
{{ 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 }}

View File

@ -0,0 +1,4 @@
<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> ▒▒ 🐟 ▒ ▒▒▒&nbsp🐙&nbsp ▒▒▒▒▒▒🏃 &nbsp▒▒☄▒▒▒▒ &nbsp&nbsp▒&nbsp⚡ &nbsp▒▒▒ &nbsp▒▒▒▒▒▒&nbsp▒▒▒▒🔍▒ &nbsp☠&nbsp▒&nbsp▒▒▒&nbsp▒▒▒▒▒▒▒▒▒▒ 🐟▒ ☄ ▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒ ▒ ▒ ▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒ ▒▒▒▒▒▒▒▒▒ ▲ ▒▒▒▒▒▒ ▒▒ ▒ ▒ ▒ ▒▒&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp▒&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒ ▒ ▒ ▒ ▒▒▒▒▒▒▒▒▒▒ ⚧ ▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒ ◎ ▒▒▒▒▒ ▒▒▒▒ ▒▒▒▒▒▒▒▒&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp▒▒▒▒▒▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒ ♻ ▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 🏃 ▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ ▒ ▒ ▒ ▒▒▒▒▒▒▒ 🌑 ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒ ▒▒▒▒▒▒▒▒▒▒▒&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp▒▒ ▒▒▒▒▒▒▒▒▒ ⚡ ▒▒▒▒▒▒▒▒Design 🖼 <a href="https://www.maddalenafragnito.com">Maddu</a> 🐈▒▒▒▒▒▒ ◎
</footer>

View File

@ -0,0 +1,15 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{{ block "title" . }}
{{- .Title }} - {{ .Site.Title -}}
{{ end }}</title>
{{ 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 }}
{{ hugo.Generator }}

View File

@ -0,0 +1,5 @@
<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&nbsp&nbsp▒▒▒&nbsp🐙&nbsp&nbsp</a>
<a href="/library/BROWSE_LIBRARY.html" target="_blank" class="logo pt-3 cursor-pointer">library.</a>
</div>
</header>

View File

@ -0,0 +1,8 @@
{{ define "main" }}
<div class="sidebar-title mb-1 pb-8">▒▒ all sessions ▽</div>
<ul class="pb-8">
{{ range .Data.Pages }}
<li><a class="sidebar-list text-base" href="{{ .Permalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">> {{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}

View File

@ -0,0 +1,20 @@
{{ define "sidebar" }}
<div class="leading-none mb-12">
<span class="title-pretext">session ⦚ </span><span class="title-text pt-6">{{ .Title }}</span>
</div>
<div class="sidebar-title mb-4">▒▒ is in ▽</div>
<ul>
{{ $currentNode := . }}
{{ range (where $.Site.RegularPages ".Section" "topic") }}
{{ if in .Params.has_sessions $currentNode.File.BaseFileName }}
<li><a class="sidebar-list text-base" href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">↖ topic ⦚ {{ .Title }}</a></li>
{{ end }}
{{ end }}
</ul>
{{ end }}
{{define "main" }}
<article>
<div class="content-text">{{ .Content }}</div>
</article>
{{ end }}

View File

@ -0,0 +1,8 @@
{{ define "main" }}
<div class="sidebar-title mb-1 pb-8">▒▒ all topics ▽</div>
<ul class="pb-8">
{{ range .Data.Pages }}
<li><a class="sidebar-list text-base" href="{{ .Permalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">> {{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}

View File

@ -0,0 +1,24 @@
{{ define "sidebar" }}
{{ $currentNode := . }}
<div class="leading-none mb-12">
<span class="title-pretext">topic ⦚ </span><span class="title-text pt-6">{{ .Title }}</span>
</div>
<div class="sidebar-title mb-1">▒▒ has sessions ▽</div>
<ul>
{{ range split .Params.has_sessions "," }}
{{ with $.GetPage (trim . " ") }}
<li><a class="sidebar-list text-base" href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">> {{ .Title }}</a></li>
{{ end }}
{{ end }}
</ul>
<div class="sidebar-title mt-4 mb-1">▒▒ is in ▽</div>
<ul>
<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>
{{ end }}
{{define "main" }}
<article>
<div class="content-text">{{ .Content }}</div>
</article>
{{ end }}

1
themes/piratecare/node_modules/.bin/acorn generated vendored Symbolic link
View File

@ -0,0 +1 @@
../acorn/bin/acorn

1
themes/piratecare/node_modules/.bin/autoprefixer generated vendored Symbolic link
View File

@ -0,0 +1 @@
../autoprefixer/bin/autoprefixer

1
themes/piratecare/node_modules/.bin/browserslist generated vendored Symbolic link
View File

@ -0,0 +1 @@
../browserslist/cli.js

1
themes/piratecare/node_modules/.bin/cssesc generated vendored Symbolic link
View File

@ -0,0 +1 @@
../cssesc/bin/cssesc

1
themes/piratecare/node_modules/.bin/detective generated vendored Symbolic link
View File

@ -0,0 +1 @@
../detective/bin/detective.js

1
themes/piratecare/node_modules/.bin/esparse generated vendored Symbolic link
View File

@ -0,0 +1 @@
../esprima/bin/esparse.js

1
themes/piratecare/node_modules/.bin/esvalidate generated vendored Symbolic link
View File

@ -0,0 +1 @@
../esprima/bin/esvalidate.js

1
themes/piratecare/node_modules/.bin/js-yaml generated vendored Symbolic link
View File

@ -0,0 +1 @@
../js-yaml/bin/js-yaml.js

1
themes/piratecare/node_modules/.bin/postcss generated vendored Symbolic link
View File

@ -0,0 +1 @@
../postcss-cli/bin/postcss

1
themes/piratecare/node_modules/.bin/purgecss generated vendored Symbolic link
View File

@ -0,0 +1 @@
../purgecss/bin/purgecss

1
themes/piratecare/node_modules/.bin/tailwind generated vendored Symbolic link
View File

@ -0,0 +1 @@
../tailwindcss/lib/cli.js

1
themes/piratecare/node_modules/.bin/tailwindcss generated vendored Symbolic link
View File

@ -0,0 +1 @@
../tailwindcss/lib/cli.js

View File

@ -0,0 +1,21 @@
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.

View File

@ -0,0 +1,89 @@
# 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.

View File

@ -0,0 +1,31 @@
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 };

View File

@ -0,0 +1,31 @@
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 };

View File

@ -0,0 +1 @@
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;

View File

@ -0,0 +1 @@
"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;

View File

@ -0,0 +1,66 @@
{
"_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"
}

View File

@ -0,0 +1,21 @@
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.

View File

@ -0,0 +1,171 @@
# @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.

View File

@ -0,0 +1,13 @@
/// <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

View File

@ -0,0 +1,18 @@
"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;

View File

@ -0,0 +1,5 @@
/**
* IS `true` for Node.js 10.10 and greater.
*/
export declare const IS_SUPPORT_READDIR_WITH_FILE_TYPES: boolean;
//# sourceMappingURL=constants.d.ts.map

View File

@ -0,0 +1,13 @@
"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;

View File

@ -0,0 +1,13 @@
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

View File

@ -0,0 +1,24 @@
"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);
}

View File

@ -0,0 +1,8 @@
/// <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

View File

@ -0,0 +1,90 @@
"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);
}

View File

@ -0,0 +1,6 @@
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

View File

@ -0,0 +1,52 @@
"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;

View File

@ -0,0 +1,21 @@
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

View File

@ -0,0 +1,24 @@
"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;

View File

@ -0,0 +1,20 @@
/// <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

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,3 @@
import { Dirent, Stats } from '../types';
export declare function createDirentFromStats(name: string, stats: Stats): Dirent;
//# sourceMappingURL=fs.d.ts.map

View File

@ -0,0 +1,18 @@
"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;

View File

@ -0,0 +1,3 @@
import * as fs from './fs';
export { fs };
//# sourceMappingURL=index.d.ts.map

View File

@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("./fs");
exports.fs = fs;

View File

@ -0,0 +1,68 @@
{
"_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"
}

View File

@ -0,0 +1,21 @@
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.

View File

@ -0,0 +1,126 @@
# @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.

View File

@ -0,0 +1,11 @@
/// <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

View File

@ -0,0 +1,16 @@
"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;

View File

@ -0,0 +1,13 @@
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

View File

@ -0,0 +1,24 @@
"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);
}

View File

@ -0,0 +1,5 @@
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

View File

@ -0,0 +1,31 @@
"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);
}

View File

@ -0,0 +1,4 @@
import Settings from '../settings';
import { Stats } from '../types';
export declare function read(path: string, settings: Settings): Stats;
//# sourceMappingURL=sync.d.ts.map

View File

@ -0,0 +1,22 @@
"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;

View File

@ -0,0 +1,17 @@
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

Some files were not shown because too many files have changed in this diff Show More