Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <div class="columns container my-2 mx-1">
  <div class="column is-half is-offset-one-quarter">
  <h1 class="title">Contribute to Serverless Resources</h1>

   <div class="field">
    <label class="label" for="url">URL</label>
    <div class="control">
      <input id="url" name="url" class="input" type="url">
   <div class="field">
    <label class="label" for="tags">Tags (comma separated)</label>
    <div class="control">
      <input id="tags" class="input" type="text" name="tags">
   <!-- We'll prepare our javascript's function for later -->
  <div class="control">
    <button onclick="validateSubmission();" class="button is-link is-fullwidth">Submit</button>




                //Helper function to get value by id
function getValue(name) {
    return document.getElementById(name).value

function validateSubmission() {
    const url = getValue('url')
    const meta_API = '' + url

        .then(response => response.json())
        .then(function (data) {
            let preFilledlink = generateUrl(data.metadata)
   //redirect with all encoded data   
            return false
        }).catch((error) => {

function generateUrl(metadata) {
    const title = metadata.title
    const description = metadata.description
    const author = || '' //depend on where author located on the API, fallback empty
    const url = getValue('url')
    //generate a filename
    const filename = title.replace(/\s/g, '-') + ".md"

    //Format tags 
    const tags = getValue('tags')
    const formattedTags = '["' + tags.replace(/,/g, '","') + '"]'

    //Generate a string mimicing the file structure
    //Indentation is important here
    let fileText = `---
title: "${title}"
url: "${url}"
author: "${author}"
tags: ${formattedTags}

    //Encode string to URI format
    const encodedFileText = encodeURIComponent(fileText)

    //Generate a github link with query parameter
    const githubQueryLink = "" + encodedFileText + "&filename=" + filename

    return githubQueryLink