Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed May 18, 2024
0 parents commit 2cbcd1d
Show file tree
Hide file tree
Showing 28 changed files with 6,396 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

[*]
charset = utf-8
indent_style = tab
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.php]
indent_size = 4

[*.md]
indent_style = space
trim_trailing_whitespace = false
insert_final_newline = false

[composer.json]
indent_size = 4
17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
extends: ["eslint:recommended", "plugin:vue/recommended", "prettier"],
rules: {
"vue/attributes-order": "error",
"vue/component-definition-name-casing": "off",
"vue/html-closing-bracket-newline": [
"error",
{
singleline: "never",
multiline: "always",
},
],
"vue/multi-word-component-names": "off",
"vue/require-default-prop": "off",
"vue/require-prop-types": "error",
},
};
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Git
.gitattributes export-ignore
.github/ export-ignore
.gitignore export-ignore

# Source files
src/ export-ignore

# Development files
.editorconfig export-ignore
.eslintrc.js export-ignore
composer.lock export-ignore
package-lock.json export-ignore
package.json export-ignore

# Docs
docs/ export-ignore
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: ["https://paypal.me/distantnative"]
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: "🐛 Bug report"
about: "If something isn't working as expected 🤬"
---

## Describe the bug

## Steps to reproduce

1.
1.
1.

## Expected behavior

## Additional context

E.g. screenshots

## Context

- Browser:
- Kirby version:
- Retour version:
- Retour config:
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
name: "⭐️ Feature request"
about: "If you have an idea to share ☁️"
---

## What's your idea?
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Fixes #

## Proposed Changes

-
-
-
14 changes: 14 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
![Kirby CSV field](https://distantnative.com/kirby-csv-field/ogimage.png)

[![Version](https://img.shields.io/badge/version-1.0.0-8dbae7.svg?style=for-the-badge)](https://github.com/distantnative/kirby-csv-field/releases)
[![Dependency](https://img.shields.io/badge/kirby-4.0.0--4.x-f0d575.svg?style=for-the-badge)](https://getkirby.com/)
[![Donate](https://img.shields.io/badge/support-give_back-bdde7a.svg?style=for-the-badge)](https://paypal.me/distantnative)

> [!NOTE]
> Kirby CMS Panel field to upload and display a single CSV file
## [Documentation](https://distantnative.github.io/kirby-csv-field/)

## Pay it forward 💛

This plugin is completely free and published under the MIT license. However, development needs time and effort. If you are using it in a commercial project or just want to support me to keep this plugin alive, please [make a donation of your choice](https://paypal.me/distantnative).
9 changes: 9 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Security

## Reporting a vulnerability

If you have spotted a vulnerability in Retour, please make sure to let me know immediately. I take any report very seriously and will react as soon as possible.

You can always write me directly at nico@getkirby.com.

Please do not write to me publicly, e.g. in an issue, as making security vulnerabilities public before they are fixed can give attackers valuable time to exploit the issue. By letting me know directly, you can protect other users from such attacks.
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy docs to GitHub Pages

on:
push:
branches: [main]
paths:
- "docs/**"
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci
- name: Build with VitePress
run: npm run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# OS files
.DS_Store

# Vendor files
/node_modules
/vendor

# Cache and temporary files
/.cache

# Docs
/docs/.vitepress/dist
/docs/.vitepress/cache
28 changes: 28 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "distantnative/kirby-csv-field",
"description": "Kirby CMS Panel field to upload and display a single CSV file",
"license": "MIT",
"type": "kirby-plugin",
"version": "1.0.0-beta.1",
"homepage": "https://distantnative.com/kirby-csv-field/",
"authors": [
{
"name": "Nico Hoffmann",
"email": "nico@getkirby.com"
}
],
"require": {
"php": ">=8.1.0 <8.4.0",
"getkirby/cms": "^4.0",
"getkirby/composer-installer": "^1.1"
},
"extra": {
"installer-name": "csv-field",
"kirby-cms-path": false
},
"config": {
"allow-plugins": {
"getkirby/composer-installer": true
}
}
}
66 changes: 66 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { defineConfig } from "vitepress";

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "CSV field",
description: "Preview your CSV file in the Panel",
lang: "en-US",
base: "/kirby-csv-field/",
appearance: false,
cleanUrls: true,
head: [["link", { rel: "og:image", href: "/kirby-csv-field/ogimage.png" }]],
themeConfig: {
nav: [
{ text: "Home", link: "/" },
{ text: "Docs", link: "/quickstart" },
{
text: "Changelog",
link: "https://github.com/distantnative/kirby-csv-field/releases",
},
{
text: "Donate",
link: "https://paypal.me/distantnative",
},
],

search: {
provider: "local",
},

sidebar: [
{
text: "Documentation",
items: [
{ text: "Getting started", link: "/quickstart" },
{ text: "Panel field", link: "/field" },
{ text: "Use in templates", link: "/templates" },
],
},
{
text: "Support development",
items: [
{
text: "Donate",
link: "https://paypal.me/distantnative",
},
],
},
],

socialLinks: [
{
icon: "github",
link: "https://github.com/distantnative/retour-for-kirby",
},
{
icon: "mastodon",
link: "https://chaos.social/@distantnative",
},
],

footer: {
message:
"CSV field is made for <a href='https://getkirby.com'>Kirby CMS</a> with love 💛",
},
},
});
37 changes: 37 additions & 0 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
:root {
--vp-font-family-base: ui-rounded, "Hiragino Maru Gothic ProN", Quicksand,
Comfortaa, Manjari, "Arial Rounded MT", "Arial Rounded MT Bold", Calibri,
source-sans-pro, sans-serif;
--vp-font-family-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo,
Consolas, "DejaVu Sans Mono", monospace;

--vp-c-brand-1: var(--vp-c-green-1);
--vp-c-brand-2: var(--vp-c-green-2);
--vp-c-brand-3: var(--vp-c-green-3);
--vp-c-brand-soft: var(--vp-c-green-soft);

--vp-c-bg: #eaf2ea;
--vp-home-hero-name-color: #89ba74;
--vp-home-hero-image-filter: blur(10rem);
--vp-button-alt-bg: #b6dabf;
--vp-button-alt-hover-bg: #a2caac;
}

.VPHomeFeatures {
margin-bottom: 4.5rem;
}

.VPHomeHero .image-bg {
opacity: 0.5;
}

.vp-doc img {
border-radius: 0.5rem;
box-shadow:
rgba(0, 0, 0, 0.08) 0px 20px 25px -5px,
rgba(0, 0, 0, 0.05) 0px 10px 10px -5px;
}

.vp-doc ul + .custom-block {
margin-top: 2rem;
}
4 changes: 4 additions & 0 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import DefaultTheme from "vitepress/theme";
import "./custom.css";

export default DefaultTheme;
40 changes: 40 additions & 0 deletions docs/field.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Panel field

```yml
myCsvField:
type: csv
label: My CSV field
delimiter: ;
```
![CSV field in the Panel](/csv-field.png)
## Custom columns
```yml
myCsvField:
type: csv
columns:
a:
key: User names
label: User
```
## Uploads
### Assign template on upload
```yml
myCsvField:
type: csv
uploads:
template: my-file-template
```
### Prevent uploads
```yml
myCsvField:
type: csv
uploads: false
```
Loading

0 comments on commit 2cbcd1d

Please sign in to comment.