Firefox Extension Workshop
Перейти к файлу
Caitlin Neiman 3b437d7a3e
Merge branch 'master' into update-monetization
2020-01-16 08:51:28 -08:00
.circleci Increase no output limits (#544) 2019-12-20 18:29:49 +00:00
.github Updated readme.md, Created contributing.md (#472) 2019-10-04 13:29:35 -07:00
.utils Fix __version__ (#480) 2019-10-01 17:53:02 +01:00
_assets updates screenshots for temporary installation in firefox (#543) 2020-01-09 12:32:51 -08:00
_data Move add-on policies preview to final (#535) 2019-11-29 17:53:11 +01:00
_includes Only show tags/contributors when we have some (#514) 2019-10-28 09:45:35 +00:00
_layouts added production footer graphics (#236) 2019-07-26 19:20:38 +01:00
content-guidelines Remove locales from all the urls (#388) 2019-09-10 12:16:28 -07:00
documentation Merge branch 'master' into update-monetization 2020-01-09 14:48:45 -08:00
.eslintignore Add eslint + prettier configs 2019-02-05 19:23:04 +00:00
.eslintrc.js Add eslint + prettier configs 2019-02-05 19:23:04 +00:00
.gitignore Update the .gitignore file (#335) 2019-09-02 12:31:06 +01:00
.prettierignore Fix code formatting in content (#461) 2019-09-25 14:03:23 -07:00
.prettierrc Update prosewrap to preserve to minimize markdown prettier changes 2019-02-26 11:56:50 +00:00
.stylelintrc Add stylelint 2019-05-24 13:28:47 +01:00
404.html Content modules (#190) 2019-06-25 19:45:33 +01:00
CODE_OF_CONDUCT.md Content modules (#190) 2019-06-25 19:45:33 +01:00
Gemfile Update dependency image_optim_pack to ~> 0.6.0.0 (#531) 2019-12-16 16:00:04 +00:00
Gemfile.lock Update dependency image_optim_pack to ~> 0.6.0.0 (#531) 2019-12-16 16:00:04 +00:00
README.md Update deployment docs 2019-10-10 12:52:34 +01:00
_config.yml Content modules (#190) 2019-06-25 19:45:33 +01:00
_config_local.yml Fix local build speed 2019-02-20 19:23:20 +00:00
community.md Update published statuses (#467) 2019-09-26 12:26:38 +01:00
extension-basics.md Update published statuses (#467) 2019-09-26 12:26:38 +01:00
index.md Update intro copy on landing page (#500) 2019-10-10 09:46:42 -07:00
package.json Update dependency eslint-config-prettier to v6.9.0 (#547) 2020-01-13 17:58:23 +00:00
renovate.json Update lock files weekly with renovate (#540) 2019-12-12 15:43:58 +00:00
robots.txt Add default robots.txt content (fixes #62) 2019-02-06 14:07:08 +00:00
search-results.md Content modules (#190) 2019-06-25 19:45:33 +01:00
sidebar-master-template.md Page builds (#207) 2019-07-11 20:24:02 +01:00
tags.md Page builds (#207) 2019-07-11 20:24:02 +01:00
yarn.lock Update dependency eslint-config-prettier to v6.9.0 (#547) 2020-01-13 17:58:23 +00:00

README.md

CircleCI

Extension Workshop

Welcome to Extension Workshop, a launchpad for building Firefox extensions! 🚀

Updating Content

If you would like to update content or other resources on Extension Workshop, please refer to contributing.md

Development Guide: Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Once you have Jekyll and yarn insalled you'll need to install the dependencies:

bundle install
yarn install

Then to run locally in devlopment run:

yarn start

Note: Running locally will show unpublished content that uses the published: false convention in frontmatter. Content with published: false will not be available on stage or production.

Available yarn commands

Command Description
yarn clean Clears the output directly and cleans the .jekyll-cache.
yarn build Builds the site.
yarn start Starts jekyll and includes unpublished content. (Note the first run is slow!)
yarn start-prodlike Starts jekyll and doesn't include unpublished content for a production-like experience.

Development Guide: Content Updates

This site has three templates: a full-width page, a sidebar page for documentation, and a Content Guidelines page

Uploading media

  1. Add the image files to _assets/img/
  2. In your page, link to images using this page structure:

This tag will output an entire img element. Note: that using @optim enables the jekyll asset pipeline to optimize the image. This is always recommended unless you see an issue with the output.

{% asset "image.jpg" @optim %}

For finer control you can use:

<img src="{% asset "image.jpg" @path @optim %}" someattr="whatever" />

Here's an example using markdown - note you need to add @path and @optim.

![Remembear subtitle screenshot]({% asset "content-guidelines/remembear-subtitle.png" @path @optim %} "Remembear subtitle text")

How to add a "sidebar" layout page

  1. Open _data/pages.yaml.
  2. Add a node with appropriate attributes, in the appropriate location, for the new page. See below for details on how to understand the pages.yaml structure.
  3. Create a new page, nested inside a folder struture that matches the url path. For example, for permalink /documentation/develop/best-practices-for-collecting-user-data-consents/, you would create a file called best-practices-for-collecting-user-data-consents.md and place it in documentation > develop.
  4. For reference on how to create a page, review the sidebar-master-template.md file, which lists all available modules. Some notes:
    • published: false will withhold this content from stage and production, to publish content, remove this line.
    • skip_index: true is used for pages that shouldn't be indexed for search results.
    • When creating page sections that will be listed in the table of contents, add an ID attribute to the section container that matches the subpageitem added to Pages.yaml. If your layout requires several sections for one table of contents entry, nest your sections inside a containing element which has the ID attribute.
    • Rull for creating section IDs: use the h2 title of the section, converted to lowercase, spaces replaced with dashes, all non-alphanumeric characters removed. For example, the section h2 title "Know your privacy settings" would be converted to know-your-privacy-settings for the section ID
    • The first section following the "Page Hero" module should be the "Table of Contents" module: modules/column-w-toc.html.

Understanding the Pages.yaml structure

  • Each node is started with a -
  • Sub nodes are indented below parent nodes
  • Each new page has a title and url attribute Note: The url attribute must match exactly the permalink attribute of the page's front matter (including leading and trailing slashes)
  • Attributes are indented on new lines
  • Pages can also have a subpageitems node for sections within the page to be referenced in the table of contents for that page:
    • Each subpageitem node has a title and ID attribute, where the ID matches the ID attribute of the section container (IDs need to be added to a containing element, rather than the heading element, of the section. This is so that highlighting for that section stays active even when the section title is out of view)
  • Overview pages have category nodes for each of the sub categories for that section
  • Categories have a category attibute which denotes the category title, and a pages attribute where sub pages of the overview page are listed
  • The Documentation Topics section pages are nested inside a subfolderitems node, which creates the dropdown panel

General overview of the pages layout:

- title: "Documentation Topics"
  subfolderitems:
    - title: "Develop"
      url: "/documentation/develop/"
      subpageitems:
        - title: "Firefox Tools"
          id: "firefox-tools"
          ...
      categories:
        - category: "Getting Started"
          pages:
            - title: "Firefox Workflow Overview"
              url: "/documentation/develop/firefox-workflow-overview/"
        ...
    - title: "Publish"
      url: "/documentation/publish/"
      subpageitems:
        - title: "Get your extension signed"
          id: "get-your-extension-signed"
        ...
    - title: "Manage"
      url: "/documentation/manage/"
      subpageitems:
        - title: "Stay informed when Firefox changes"
          id: "stay-informed-when-firefox-changes"
        ...
    - title: "Enterprise"
      url: "/documentation/enterprise/"
      subpageitems:
        - title: "Section Title"
          id: "introduction"
        ...
    - title: "Themes"
      url: "/documentation/themes/"
      subpageitems:
        - title: "What themes are"
          id: "what-themes-are"
        ...
- title: "Extension Basics"
  url: "/extension-basics/"
  subpageitems:
    - title: "Getting started"
      id: "getting-started"
    ...
- title: "Community"
  url: "/community/"
  subpageitems:
    - title: "Who is part of the community?"
      id: "who-is-part-of-the-community"
    ...
  categories:
    - category: "About the Community"
      pages:
        - title: ""
          url: ""
        ...
    ...

How to add a "Content Guidelines" page

Create a new page

  1. Create new file
  2. Add header (see example below)
  3. Copy 'modules' needed from content-guidelines/master-template.md and paste in new file
  4. Save as markdown: content-guidelines/page-name.md
---
layout: guides
title: Page Name
permalink: /content-guidelines/page-name/
published: false
---

Note: published: false will withhold this content from stage and production, to publish content, remove this line.

Add the page to the menu

Go to _data/content-guidelines-pages.yaml and add a new entry for your page:

- title: "Page Name"
  url: "/content-guidelines/page-name/"
  draft-label: true

Controlling draft labelling

If you don't want the page to be labelled as a draft, as and when it's ready remove draft-label: true from the relevant entry in _data/content-guidelines.yaml

Deployment

All deploys for stage and prod are handled via the releases page.

Dev Deploys

The site is auto-deployed on commits to master to https://extensionworkshop-dev.allizom.org/. You can check the version on -dev with the dev version link

Stage Deploys

Tags with a version ending in -stage will be deployed to https://extensionworkshop.allizom.org/. You can check the version on stage with the stage version link

A good example of a tag for stage would be v2.0.1-stage.

Production Deploys

Tags of the format vN.N.N will be deployed to https://extensionworkshop.com/. You can check the version on prod with the prod version link

A good example tag would be v2.0.1.

Version numbers

Tag versions should aim to follow follow the semver format.