Skip to content

Commit

Permalink
feat: configure Sveltia CMS (#15)
Browse files Browse the repository at this point in the history
* feat: configure Sveltia CMS
* feat: remove Pages CMS configuration
  • Loading branch information
greatislander authored Apr 8, 2024
1 parent f856f0e commit 16de451
Show file tree
Hide file tree
Showing 8 changed files with 5,750 additions and 12,347 deletions.
657 changes: 0 additions & 657 deletions .pages.yml

This file was deleted.

4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ WORKDIR /app

COPY package.json ./

RUN apk add --no-cache git
RUN apk add --no-cache git python3 py3-pip pango gcc musl-dev py3-wheel python3-dev libffi-dev zlib-dev jpeg-dev

RUN pip install weasyprint

RUN npm install

Expand Down
9 changes: 0 additions & 9 deletions eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@ export default function eleventy(eleventyConfig) {

eleventyConfig.addPassthroughCopy({
'node_modules/a11y-syntax-highlighting/dist/prism/a11y-dark.min.css': 'assets/styles/a11y-dark.min.css',
'node_modules/decap-cms/dist/decap-cms.js': 'lib/cms/decap-cms.js',
'node_modules/decap-cms/dist/decap-cms.js.map':
'lib/cms/decap-cms.js.map',
'node_modules/prop-types/prop-types.min.js':
'lib/cms/prop-types.min.js',
'node_modules/react/umd/react.development.js':
'lib/cms/react.development.js',
'node_modules/react/umd/react.production.min.js':
'lib/cms/react.production.min.js',
});

return {
Expand Down
17,208 changes: 5,725 additions & 11,483 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
"main": "eleventy.config.js",
"scripts": {
"build": "npm-run-all -l clean -s build:*",
"build:cms": "esbuild src/admin/previews.js --bundle --loader:.js=jsx --outfile=_site/admin/previews.js",
"build:eleventy": "eleventy",
"build:pdf": "weasyprint --pdf-variant=pdf/ua-1 _site/index.html _site/report.pdf",
"clean": "rimraf _site",
"cms": "decap-server",
"create-pdf": "run",
"debug": "DEBUG=Eleventy* eleventy",
"dev": "cross-env NODE_ENV=development eleventy --serve",
Expand All @@ -19,10 +17,7 @@
"lint:markdown": "markdownlint-cli2 \"**/*.md\"",
"lint:yml": "xo \"**/*.yml\"",
"open-pdf": "open-cli _site/report.pdf",
"serve": "npx serve _site",
"start": "npm-run-all -l clean -p start:*",
"start:cms": "esbuild src/admin/previews.js --bundle --loader:.js=jsx --outfile=_site/admin/previews.js --watch",
"start:eleventy": "run-p dev cms",
"start": "npm-run-all -l clean dev",
"prepare": "husky install"
},
"repository": {
Expand All @@ -41,17 +36,14 @@
"@11ty/eleventy-fetch": "^4.0.0",
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"a11y-syntax-highlighting": "^0.2.0",
"decap-cms": "^3.1.2",
"eleventy-plugin-markdown-shortcode": "^1.1.0",
"esbuild": "^0.20.1",
"new-github-issue-url": "^1.0.0"
},
"devDependencies": {
"@commitlint/cli": "^19.0.3",
"@commitlint/config-conventional": "^19.0.3",
"cross-env": "^7.0.3",
"debug": "^4.3.4",
"decap-server": "^3.0.2",
"eslint-config-xo-react": "^0.27.0",
"eslint-plugin-jsdoc": "^48.2.1",
"eslint-plugin-markdown": "^4.0.1",
Expand Down
14 changes: 1 addition & 13 deletions src/admin/admin.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,8 @@ eleventyExcludeFromCollections: true
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>IDRC WCAG Reporter</title>
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
<script>
window.successCriteria = {{ successcriteria | dump | safe }};
</script>
</head>
<body>
<!-- Include the script that builds the page and powers Decap CMS -->
<script src="/lib/cms/decap-cms.js"></script>
{% if env.context === "dev" %}
<script src="/lib/cms/react.development.js"></script>
{% else %}
<script src="/lib/cms/react.production.min.js"></script>
{% endif %}
<script src="/lib/cms/prop-types.min.js"></script>
<script src="/admin/previews.js"></script>
<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js" type="module"></script>
</body>
</html>
67 changes: 20 additions & 47 deletions src/admin/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
backend:
name: git-gateway
name: github
branch: main
media_folder: src/_assets/uploads
public_folder: /_assets/uploads
local_backend: true
repo: inclusive-design/idrc-wcag-reporter
media_folder: src/assets/uploads
public_folder: /assets/uploads
editor:
preview: true
preview: false
collections:
- label: Report
name: report
Expand All @@ -17,7 +17,7 @@ collections:
- name: body
label: About this report
widget: markdown
- label: Report
- label: Report Details
name: report
file: src/report/index.md
fields:
Expand Down Expand Up @@ -52,24 +52,24 @@ collections:
label_singular: in scope item
widget: list
fields:
- { name: "title", label: "Title", widget: "string" }
- { name: "url", label: "URL", widget: "string" }
- { name: "description", label: "Description", widget: "text", required: false }
- {name: "title", label: "Title", widget: "string"}
- {name: "url", label: "URL", widget: "string"}
- {name: "description", label: "Description", widget: "text", required: false}
- name: outOfScope
label: Out of scope
label_singular: out of scope item
widget: list
fields:
- { name: "title", label: "Title", widget: "string" }
- { name: "url", label: "URL", widget: "string" }
- {name: "title", label: "Title", widget: "string"}
- {name: "url", label: "URL", widget: "string"}
- name: tools
label: Tools used
label_singular: tool
widget: list
summary: '{{fields.name}} {{fields.version}}'
fields:
- { name: "name", label: "Tool", widget: "string" }
- { name: "version", label: "Version", widget: "string", required: false }
- {name: "name", label: "Tool", widget: "string"}
- {name: "version", label: "Version", widget: "string", required: false}
hint: Enter browsers and assistive technologies used in auditing the website.
- name: technologies
label: Technologies used
Expand Down Expand Up @@ -115,6 +115,7 @@ collections:
- name: number
label: Number
widget: string
readonly: true
- name: name
label: Name
widget: string
Expand All @@ -125,7 +126,7 @@ collections:
extension: md
create: true
fields:
- { label: Title, name: title, widget: string }
- {label: Title, name: title, widget: string}
- label: Success Criteria
name: sc
widget: relation
Expand All @@ -135,36 +136,8 @@ collections:
value_field: successCriteria.*.number
search_fields: [successCriteria.*.number, successCriteria.*.name]
display_fields: [successCriteria.*.number, successCriteria.*.name]
- {
label: Severity,
name: severity,
widget: select,
options: ["Unknown", "Low", "Medium", "High"],
required: false,
}
- {
label: Difficulty,
name: difficulty,
widget: select,
options: ["Unknown", "Low", "Medium", "High"],
required: false,
}
- { label: Sample Pages, name: sample, widget: string, default: "all" }
- {
label: Screenshots,
name: screenshots,
widget: object,
required: false,
fields:
[
{ label: "Screenshot", name: "src", widget: "image", required: false },
{ label: "Alt Text", name: "alt", widget: "string", required: false },
{ label: "Caption", name: "caption", widget: "text", required: false },
],
}
- {
label: Body,
name: body,
widget: markdown,
default: "##### Problem\n\nDescribe the problem. Include code samples if necessary.\n\n##### Potential Solutions\n\nDescribe some potential solutions.\n\n##### Read more\n\nInclude some links to relevant examples and/or articles.",
}
- {label: Severity, name: severity, widget: select, options: ["Unknown", "Low", "Medium", "High"], required: false}
- {label: Difficulty, name: difficulty, widget: select, options: ["Unknown", "Low", "Medium", "High"], required: false}
- {label: Sample Pages, name: sample, widget: string, default: "all"}
- {label: Screenshots, name: screenshots, widget: object, required: false, fields: [{label: "Screenshot", name: "src", widget: "image", required: false}, {label: "Alt Text", name: "alt", widget: "string", required: false}, {label: "Caption", name: "caption", widget: "text", required: false}]}
- {label: Body, name: body, widget: markdown, default: "##### Problem\n\nDescribe the problem. Include code samples if necessary.\n\n##### Potential Solutions\n\nDescribe some potential solutions.\n\n##### Read more\n\nInclude some links to relevant examples and/or articles."}
128 changes: 0 additions & 128 deletions src/admin/previews.js

This file was deleted.

0 comments on commit 16de451

Please sign in to comment.