GithubHelp home page GithubHelp logo

grantcodes / postrchild-extension Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 0.0 1.46 MB

An inline editor extension for your indieweb website

Home Page: https://postrchild.com

HTML 0.24% JavaScript 99.60% CSS 0.16%
micropub browser-extension indieweb

postrchild-extension's Introduction

PostrChild Browser Extension

This is an experimental WebExtension that enables inline micropub publishing on your own website.

What does it do?

This extension allows you to publish and edit posts to your IndieWeb enabled website via micropub

Editing is done inline by looking for micropub classes on your site and loading a medium style editor.

Experimental features

As well as creating and editing posts the extension is also able to automatically synchronize your browser bookmarks with bookmarks on your website if you support micropub queries as discussed here

Installation

Firefox

https://addons.mozilla.org/en-US/firefox/addon/postrchild/

Chrome

https://chrome.google.com/webstore/detail/ecifafdialoohbgngelfbjplgbhiklpm

Build from souce

Clone this repo from https://github.com/grantcodes/postrchild-extension.git then run npm install and npm run build inside the root directory.

That should create a /build folder and a .zip file that you can install in your browser.

Usage

First you will need to go into the options of the extension and provide your domain to login with indieauth and obtain a micropub token.

After that when you browse to your own website you should see a button to add a new post, or if you are viewing a single post, a button to edit that post.

New Post Template

There are a number of options to add a new post template.

My personal favorite is to create a special new post page that you can visit on your site to autoload the editor. You probably want to no-index the page, but it doesn't need to be secure as the editor is only loaded in your browser, other people cannot post to your website. The template should follow the same rules as below but also add the postrchild-template classname to the h-entry and the extension will automatically load the new post editor on your site if you are logged in.

When creating a new inline post for you to edit, the extension tries to grab the first post on the page and use that as a template. But this can lead to some visual formatting issues.

So you have the option to include a "New Post Template" which will be injected and editor fields will be loaded into it.

It should have a container with a h-entry class, with a p-name class element and another element with a class of e-content.

For example I use something like this for my own site:

<article class="h-entry post card">
  <header><h1 class="p-name post__title"></h1></header>
  <div class="e-content"></div>
  <footer class=" post__footer">Being written now by Grant Richmond</footer>
</article>

Alignment

You can align certain items to a wide or full width if your website supports the styles.

You need to style the alignfull and alignwide classes. This should be built into WordPress themes with full gutenberg support.

Photo alignment example

Markdown Shortcuts

If you start a paragraph with ### and a space it will turn that block into a h3, if you start with a > you get a blockquote, etc.

Markdown shortcuts example

Mentions

You can @mention IndieWeb people.

Mention example

postrchild-extension's People

Contributors

grantcodes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

postrchild-extension's Issues

Add option to create a new post from anywhere

If the user has a post template or manually enters a new post url there should be a button to open that page in a new tab and load the editor

I would also like to support likes and reposts etc somehow

Prevent return on plain text editor

Some plain text editor fields shouldn't allow for the user to hit enter. E.g. Titles.

Should probably make a singleLine prop or something similar

@mentions

Should autofill based on the user nickname cache and perhaps fall back to the directory I made

Code block

New block type that generates pre>code html maybe with some special markup to denote the code language.

Reply support

Can use similar functionality to the "new post" button, but autofill the current url as the in-reply-to property

Rotate portrait images

Dragging and dropping images into the editor can make them show up with the wrong orientation

Slash commands

I would really love slash commands for adding blocks like gutenberg / ghost / notion

Multi level lists

Trying to make a list in a list currently leads to a lot of issues.

Add page actions for new and edit post

These used to exist but I removed them in favour of a full menu, but the menu simply isn't as efficient.

I think I'd like to add the page actions back as a one click alternative.

Pasting media

Should be able to copy and paste photos into the editor. Maybe other file types

Don't sync bookmarklets

I think bookmarklets may contain secret keys and stuff so they probably shouldn't by synced.

It will be easy to ignore any bookmark starting with javascript:

Right click send to media endpoint

Would really love the option to right click on any photo (or perhaps other media) in the browser and have an option to automatically push it to my media endpoint.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.