{"id":15380761,"url":"https://github.com/bitstarr/grav-theme-chassis","last_synced_at":"2025-04-15T18:40:54.239Z","repository":{"id":44144925,"uuid":"263323290","full_name":"bitstarr/grav-theme-chassis","owner":"bitstarr","description":"Grav Theme Boilerplate","archived":false,"fork":false,"pushed_at":"2025-03-18T09:23:47.000Z","size":912,"stargazers_count":7,"open_issues_count":8,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T23:43:47.394Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitstarr.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-12T11:57:04.000Z","updated_at":"2025-03-17T13:00:54.000Z","dependencies_parsed_at":"2023-01-20T08:47:38.467Z","dependency_job_id":"44ddff0d-3daa-4455-9731-a5bd056ae6ee","html_url":"https://github.com/bitstarr/grav-theme-chassis","commit_stats":{"total_commits":96,"total_committers":3,"mean_commits":32.0,"dds":0.5104166666666667,"last_synced_commit":"04c16654ed614d898b38ea5b4add75e6a7e938ea"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitstarr%2Fgrav-theme-chassis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitstarr%2Fgrav-theme-chassis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitstarr%2Fgrav-theme-chassis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitstarr%2Fgrav-theme-chassis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitstarr","download_url":"https://codeload.github.com/bitstarr/grav-theme-chassis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249130703,"owners_count":21217596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T14:24:32.442Z","updated_at":"2025-04-15T18:40:54.208Z","avatar_url":"https://github.com/bitstarr.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grav Theme Boilerplate \"Chassis\"\n\nThis is a WIP starting point for custom themes for grav CMS.\n\nWe are using some node magic to help with boring and repetitive tasks. Please learn first about the file structure and the way assets are organized and processed in this project.\n\n## Dependecies\n\nChassis provides templates, styles or functionality for the following plugins (if you install and enable them…)\n\n* breadcrumbs\n* [company-details](https://github.com/bitstarr/grav-plugin-company-details)\n* forms\n* markdown-details\n* markdown-notices\n* pagination\n* shortcode-core\n* [shortcode-gallery](https://github.com/bitstarr/grav-plugin-shortcode-gallery)\n\n## File Structure\n\n````\n.\n├── /.tasks             node scripts (see package.json)\n├── /admin              Admin modifications and enhancements\n│   └── /buttons            Editor buttons\n├── /assets             \"raw\" assets\n│   ├── /css                CSS files\n│   │   ├── /base               settings, normalization, helper\n│   │   ├── /form               form components\n│   │   ├── /molecule           simple modules\n│   │   ├── /oranism            complex modules\n│   │   ├── /template           template/page specifics (e.g. spacing)\n│   │   ├── /vendor             3rd party / plugin styles\n│   │   ├── admin.css           admin style modifications\n│   │   ├── fonts.css           dedicated web font style sheet\n│   │   └── main.css            main style sheet\n│   ├── /favicon            favicons/app icons\n│   ├── /fonts              font files in WOFF2 format\n│   ├── /icons              SVG icons\n│   │   └── _icons.html         template for icons sprite cheat sheet\n│   ├── /img                static images\n│   │   ├── marker.svg          map marker template\n│   │   └── social.jpg          default open graph image\n│   └── /js                 JS files\n│       ├── /src                JS (bundle) source files\n│       ├── dev.json            JS helper bundle for local enviroment\n│       ├── main.json           JS base bundle.\n│       └── summary.js          JS standalone component\n├── /blueprints         grav blueprints for page types\n├── /classes            custom PHP Classes\n│   └── Utils.php           utilty class with helper functions\n├── /dist               build files\n│   ├── /css                minified CSS files\n│   ├── /fonts              duplicates of assets/fonts\n│   ├── /icons              optimized and minified icons\n│   ├── /img                optimized images\n│   └── /js                 minified JS files and bundles\n├── /langages           translation files\n├── /shortcodes         custom shortcodes\n├── /templates          grav templates\n│   ├── /email              email templates\n│   ├── /forms              custom form elements for better styling\n│   ├── /macros             macros to use with twig\n│   ├── /modular            templates for modular page elements\n│   ├── /partials           template parts\n│   └── *.html.twig         page templates\n├── .eslintrc           eslint config\n├── .styleintrc         styleint config\n├── chassis.php         theme functions\n├── chassis.yaml        theme config file\n└── package.json\n````\n\n## CSS Processing\n\nWe are using PostCSS for convenience. It will inline `@import`, resolve nesting and autoprefix.\n\n`/assets/css/main.css` is the main CSS file and hub. You'll find only imports inside, which will be inlined in processing. If you need to, you can add other CSS files in parallel to main.css to provide other subsets or differently scoped styles. Every CSS file stored directly in `/assets/css/` will be processed and the result stored in `/dist/css/`.\n\nAdditionally this will also happen to CSS files in `/assets/css/page`. So you can create per page additions or overwrites which can be referenced by templates. Make sure there are no equal file names in css and css/pages.\n\n## JS Files und Bundles\n\nIn ``/assets/js`` you will find .js and .json files, as well as a `src` folder. In this setup (no webpack or other advanced magic) the JS files are independent functional components. JSON files are the base for bundles. With these, you can concatenate multiple components from the `src` folder as well as libraries from `/node_modules` which you installed via npm (see example below). In bundles, the order is important. The libs will appear before the code from `src`.\n\nEvery JS file in ``/assets/js`` will be copied in ``/dist/js``. Bundles will run through a combination of their parts and the result will be saved as js in ``/dist/js``. Please be aware that there will be conflicts if the filenames of a bundle and a standalone component are the same (foobar.js and foobar.json for example).\n\n````json\n{\n    \"lib\": [\n        \"choices.js/public/assets/scripts/choices.min.js\"\n    ],\n    \"src\": [\n        \"address.js\",\n        \"userprofile.js\"\n    ]\n}\n````\n\n## Images\n\nAll image files in `/assets/img` will be optimized on build (or called manually) using `imagemin` (svgo, pngQuant, mozJpeg, gifsicle, Zopfli) and stored in `/dist/img`. When using the watch task, images will simply be copied to avoid waiting times in development.\n\n## Fonts\n\nIt's good practice to use only WOFF2 format fonts now. Browser support is good and we provide a fallback to system fonts. Also make sure to subset (use [Font Squirrels Generator](https://www.fontsquirrel.com/tools/webfont-generator) or [Font Mangler](https://github.com/bitstarr/font-mangler)) to reduce the file sizes. At build or with the dedicated command, the fonts will be put in `/dist`.\n\n## About `/dist`\n\nIf you are using a CI server, you can add the `/dist` folder to `.gitignore`. Otherwise, you should make a build before every merge with your main branch, so the main branch includes the minified and most optimized assets in `/dist`.\n\n## Configuration\n\nIn `package.json` you will find an onject called `config`. Here are paths stored that are used by the node scripts.\n\n## Browsersync / LiveReload\n\nTo use this feature, make sure you set up the correct URL of your project in `config.bsProxy` in `package.json`.\n\nWhen the `watch` task is running, you can access [http://localhost:3000](http://localhost:3000). Depending on your network or firewall configuration, you could also access this port with other devices to do even more cross-device/browser testing. `Browsersync` will keep scroll position (proportional) in sync.\n\nThe `watch` task will force refreshes on CSS and JS files via Browsersync so you can see instantly the impact of your changes.\n\nOn port 3001 you can access the Browsersync control panel.\n\n## Task Runner\n\nWir use node scripts as a task runner.\n\n| command | function |\n|---|---|\n| npm run css | processes the CSS files and saves them with source maps to `/dist/css` |\n| npm run cssmin | same as `css` but with minifying |\n| npm run js | creates JS bundles and copies JS files to `/dist/js` |\n| npm run jsmin | same as `js` but with minifying |\n| npm run lint | checks CSS and JS assets for bad coding styles and errors |\n| npm run fonts | copies font files to `/dist/fonts` |\n| npm run img | simply copies images from `/assets/img` to `/dist/img` |\n| npm run imgmin | optimizes images and saves results to `/dist/img` |\n| npm run icons | optimizes icons and saves results to `/dist/icons` |\n| npm run sprite | creates an icon sprite from `/dist/icons` in `/dist/sprite` |\n| npm run favicons | creates favicon files from `/dist/favicons/favicon.svg` and saves them in `/dist/` - move them from here |\n| npm run watch | watch for changes and process changed or new files |\n| npm run todo | find all occurances of `todo` |\n| npm run clean | clear `/dist` |\n| npm run dev | runs `css`, `js`, `img` and `icons` in parallel once |\n| npm run build | runs `lint`, `clean`, `cssmin`, `jsmin`, `imgmin`, `icons` and `fonts` |\n\n## Renaming the theme\n\nThis is a bit trickey since grav has more than one place to set the name. In order to rename the theme, you will need to follow these steps (let's take picasso for example):\n\n* Rename the theme folder `chassis` -\u003e `picasso`\n* Rename `/chassis.yaml` and `/chassis.php` in `picasso.*`\n* Change the name in `/blueprints.yaml`\n* In the file formerly known as `/chassis.php` rename the class name, mind the capital first letter `class Chassis extends Theme` -\u003e `class Picasso extends Theme`\n* There are occurrences regarding the utility class in the same file, rename and follow the capitalization\n* In `/classes/Utils.php` rename the namespace definition, mind the capitalization\n* Make sure all occurrences of utility functions in the template folder are renamed (search for chassis in files)\n* Set new theme in `user/config/system.yaml`\n\nWhen using a dash in the theme name, you will have to CamelCase (upper camel case) the namespaces and class names.\n\n## Shortcodes\n\n### caption\n\n```md\n[caption class=\"image\" caption=\"Quelle: Unsplash.com\"]\n![](image.jpg)\n[/caption]\n```\n\nAdds a caption (via HTML `figure` + `figcaption`) to your media (image, video, embed, audio).\n\n### email\n\n```md\n[email link=1]Chunkylover53@aol.com[/email]\n```\n\nMask e-mails with HTML entities to give some spam protection. `link` parameter is optional and makes the address a `mailto` link.\n\n### icon\n\n```md\n[icon=mail title=\"E-Mail\"]\n```\n\nShortcode to use in text icons utilizing the [svg-extension](https://github.com/bitstarr/grav-plugin-svg-extension) plugin.\n\nAs seen in the example, the first word is the icon name, optional parameters follow after that.\n\n| Parameter | Effect |\n| --- | --- |\n| id | Set an ID for the SVG element |\n| class | Set the CSS classes for the SVG element |\n| title | Set a title (accessibility) |\n\n\n### lang\n\n```md\n[lang=fr inline=1]Bonjour[/lang]\n```\n\nWrap text in a different language semantically, so screenreader can interpret and pronounce it correctly. By default, it wraps the text in a `div`, adding the optional `inline` parameter wraps it in a `span`.\n\n### video\n\n```md\n[video=Uuad8V5f_QA]\n[video=\"https://www.youtube.com/watch?v=Uuad8V5f_QA\"]\n[video id=Uuad8V5f_QA]\n[video id=\"https://www.youtube.com/watch?v=Uuad8V5f_QA\"]\n[video id=141358 type=vimeo]\n```\n\nEmbed a video from YouTube or Vimeo with a privacy alert. The video will only load (and request external resources) if the user confirms (once or for the whole site).\n\n! The CSS and JS of this component needs to be added to processing. They are not enabled by default.\n\nSome interpretations of the following options depend on the video platform.\n\n| Parameter | Effect | Values | Default |\n| --- | --- | --- | --- |\n| id | Video ID or URL | string or URL | – |\n| type | Which video platform | youtube or vimdeo | youtube |\n| showinfo | Include information overlays | 0 or 1 | 0 |\n| controls | Show video player controls | 0 or 1 | 1 |\n| color | Controls color | red, white, hexcode | white |\n| class | Additional CSS classes for the embed wrapper | string | – |\n\n### raw\n\n```md\n[raw][email link=1]Chunkylover53@aol.com[/email][/raw]\n```\n\nThis is a helper to show shortcodes on pages without getting them processed.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitstarr%2Fgrav-theme-chassis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitstarr%2Fgrav-theme-chassis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitstarr%2Fgrav-theme-chassis/lists"}