Skip to content

Instantly share code, notes, and snippets.

View PaulEibensteiner's full-sized avatar

PaulEibensteiner

View GitHub Profile
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() async {
return runApp(MaterialApp(
theme: ThemeData(brightness: Brightness.light, primaryColor: Colors.red),
home: const MyEditor()
// debugShowCheckedModeBanner: false, theme: themeData, home: Document()
));
}
@PaulEibensteiner
PaulEibensteiner / index.html
Created June 15, 2018 14:58
Gallery Custom Editor Component (not working at all)
<script>
CMS.registerEditorComponent({
// Internal id of the component
id: "Gallery",
// Visible label
label: "Añadir Galleria",
// Fields the user need to fill out when adding an instance of the component
fields: [{
name: 'images',
label: 'Images',
@PaulEibensteiner
PaulEibensteiner / index.html
Last active September 5, 2018 03:49
Custom Editor widget for netlify cms to add shortcode
<!-- Bottom Part of the index.html inside amdmin directory. The UI element is in spanish because of the prject I'm working on right now. Also If you use the id "image"you apparently overwrite the default image widget which you can or cannot want -->
<script>
CMS.registerEditorComponent({
// Internal id of the component
id: "imagen",
// Visible label
label: "Añadir Imagen",
// Fields the user need to fill out when adding an instance of the component
fields: [{name: 'id', label: 'Lugar del Imagen', widget: 'image'}],
<!-- slightly modified code originally by talves, can be extended to create responsive images etc. as well -->
{{ $nombre := .Get "name" }}
{{ $page := . }}
{{ with .Site.GetPage "section" "images" }}
{{ with .Resources.GetMatch $nombre }}
{{ $image1080x := (.Resize "1080x") }}
<img src="{{ $image1080x.RelPermalink }}">
{{ end }}
{{ end }}