npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nodebb-plugin-smoothshorts

v0.3.2

Published

Seamless short URLs for topic and post links in NodeBB.

Downloads

7

Readme

nodebb-plugin-smoothshorts

Code Climate

Seamless short URL plugin for NodeBB

Nobody likes itchy pants, do you? Neither do I. :smirk:

That's why these shorts are seamlessly woven into the NodeBB experience, your users won't feel a thing.

Installation

  1. Preferably, install SmoothShorts from the list of available plugins in your NodeBB ACP.

Manual installation via npm install nodebb-plugin-smoothshorts is possible, but doesn't guarantee compatibility with your NodeBB version.

  1. Activate the plugin in ACP/Extend/Plugins.

  2. Setup plugin (and hash already existing posts/topics) in ACP/Plugins/SmoothShorts.

  3. Go click 'em! :D

Methods

Copy Button

Given that the client's browser supports the execCommand('copy'), SmoothShorts will add an icon next to post links, which copies the short URL with a single click. The context menu method is always available.

SmoothShorts one-click button

NOTE: If you are using NodeBB >=1.0.0, you have a more suitable icon (.fa-hashtag) available. The plugin's default .fa-external-link ensures backwards compatibility. You can change the icon in the settings.

Context Menu

Once a user opens the browser's context menu upon a topic link, the href value of that link gets replaced with its assigned hash:

SmoothShorts on a topic link

This also works on posts:

SmoothShorts on a post link (Not all themes have those links; same goes for teasers. Posts are hashed, regardless of used theme.)

The now copied address is of the form https://yourNodeBB.org/ss/:hash (default, see URL Format). Visiting it will redirect to the associated post or topic:

SmoothShorts resolving a hash

Settings (ACP/Plugins/SmoothShorts)

###- Modifier key

Users would have to press Ctrl/Alt/Shift while opening the context menu to replace the link. ###- URL Format

Define the format of your short URLs! Use :hash as a placeholder for topic/post hashes. (e.g. short.com/ss/:hash, short.com/:hash, short.com/:hash/yolo)

NOTE: Changing the URL format requires a NodeBB restart to apply the route hashes are accepted on.

###- Copy Button

Pick the icon for the copy button from the fontawesome icon set.

Q/A & Known Issues

###Why not use a service like bit.ly or goo.gl?

Coming in 0.4.0!

~~For two reasons:~~

~~1. While investigating bit.ly, I noticed that they impose limits on calls to their API. No need to hate them for it; in fact, they have every right to do so, protecting themselves against bots and such. But unfortunately, as hashing is triggered by every user creating a topic/post, a single spam attack on your NodeBB could make you run out of those API calls; just like that.~~

~~2. Links to posts in NodeBB are not structured like /topic/topicslug/postID, but rather /topic/topicslug/positionInTopic. Which means that if you purge a post, your already created short urls would get all mixed up.~~