Skip to content

Commit 67b49c1

Browse files
author
markzegarelli
authored
Merge branch 'master' into update-edit-links
2 parents 81a78a4 + 6a5ce74 commit 67b49c1

File tree

356 files changed

+59175
-23766
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+59175
-23766
lines changed

.env.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
PLATFORM_API_TOKEN=look for me in chamber
1+
CONTEXT=development
2+
PLATFORM_API_TOKEN=generate a token from your Segment workspace
3+
PAPI_TOKEN=generate a token from your Segment workspace
4+
ALGOLIA_APP_ID=
5+
ALGOLIA_SEARCH_KEY=
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Improve an existing article's content
2+
description: Make a suggestion to improve the content of an existing article
3+
labels:
4+
- content
5+
body:
6+
- type: markdown
7+
attributes:
8+
vallue: |
9+
* Please check that there is not an existing open [issue](https://github.com/segmentio/segment-docs/issues) before you create a new one.
10+
* Read the Contribution guide before you continue.
11+
# - type: checkboxes
12+
# id: terms
13+
# attributes:
14+
- type: textarea
15+
attributes:
16+
label: What article on segment.com/docs is affected?
17+
description: Please link to the article you'd like to see updated.
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
attributes:
23+
label: What part(s) of the article would you like to see updated?
24+
description: |
25+
- Give as much detail as you can to help us understand the change you want to see.
26+
- Why should the docs be changed? What use cases does it support?
27+
- What is the expected outcome?
28+
validations:
29+
required: true
30+
31+
- type: textarea
32+
attributes:
33+
label: Additional information
34+
description: Add any other context or screenshots about the feature request here.
35+
validations:
36+
required: false

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ yarn-error.log
1414
.vscode/spellright.dict
1515

1616
# Local Netlify folder
17-
.netlify
17+
.netlify
18+
19+
# VS COde stuff
20+
.vscode*

.vale.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ StylesPath = vale-styles
33
Vocab = Docs
44

55
[*.md]
6-
BasedOnStyles = write-good, Segment
6+
BasedOnStyles = write-good, segment
7+
TokenIgnores = ({% .* %})

.vscode/yml.code-snippets

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
// Place your segment-docs workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3+
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4+
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5+
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6+
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
7+
// Placeholders with the same ids are connected.
8+
// Example:
9+
// "Print to console": {
10+
// "scope": "javascript,typescript",
11+
// "prefix": "log",
12+
// "body": [
13+
// "console.log('$1');",
14+
// "$2"
15+
// ],
16+
// "description": "Log output to console"
17+
// }
18+
19+
"yml": {
20+
"prefix": ["- name"],
21+
"body":["- name: ${1:name}\r\tdescription: ${2:description}\r\tdefault: ${3}"],
22+
"description": "Yaml settings"
23+
}
24+
}

CONTRIBUTING.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Contributing to Segment Docs
2+
3+
## Getting Started
4+
5+
Before you begin:
6+
7+
- This site is powered by [Jekyll](https://www.jekyllrb.com).
8+
- Please familiarize yourself with the licensing agreement.
9+
- Browse existing issues to see if your issue has been raised already.
10+
11+
## Use the contribution links from any docs page
12+
13+
Not all pages have a 1-1 mapping with their location within the repository. This can make browsing and locating the file you're trying to reference a challenge. As you browse [segment.com/docs](https://segment.com/docs), you'll notice two links in the right sidebar, at the top of the page. Click **Edit this page** to open the page in the Github editor. Or, click **Request docs change** to create a new issue that references the page.
14+
15+
## Want to go deeper? Clone the repository
16+
17+
You can clone this repository to your local machine to make larger changes. Examples of larger changes include:
18+
- editing more than one file at a time
19+
- adding or updating images
20+
- updating navigation items
21+
22+
In this scenario, you'll clone the repository locally, make your changes, and submit a pull request to have them reviewed and merged back into the site.
23+
24+
## Site structure
25+
26+
As mentioned, the Segment docs site is powered by Jekyll, with a few customizations and enhancements. Generally speaking, everything you'll need to edit is located in the `_src/` directory. This directory contains the data files, layouts, sass, and markdown source files that combine to make a live, working website.
27+
28+
Within the `/src/` path, anything that starts with an underscore (like `_data` or `_includes`) is a utility directory, and Jekyll won't render it as a webpage path at build time. (In fact, any files where the name starts with an underscore are dropped from the build.)
29+
30+
### Underscore files
31+
32+
Anything that starts with an `_` is a utility directory of some sort (and Jekyll will skip/not render any file that starts with a `_`).
33+
34+
The most interesting ones are:
35+
- `/src/_includes/content/` This is where all the includes or "partials" - the reusable content - are stored.
36+
- `/src/_data/catalog/` This is where we keep the data we've pulled from the ConfigAPI in structured `yml` files that are used by the build.
37+
- `/src/_data/sidenav/` This is where the navigation structures are. (Several sections in the doc have their own left-nav, making them "microsites".) They're just YML files that we manually update so we have maximum control over what's shown and what's not.
38+
39+
40+
### Images
41+
42+
**Save all images locally! No linking to 3rd party-hosted images!** Images are published to our CDN from the build step, and this means they won't go missing if the hosting service dujour goes out of business.
43+
44+
There are no _enforced_ naming conventions at this time. Files that start with an underscore are ignored by Jekyll. Anything you see with `asset` was dowloaded by a script to migrate it out of Contents.io.
45+
46+
In general, it's a good practice to name images with a description that helps you (& other docs maintainers) figure out where they should go within a page, or within a larger folder of images.
47+
48+
A few possibilities/suggestions:
49+
50+
- **Add a prefix of what file the image appears in**. This is helpful if you have images for multiple pages in the same `images` directory, but breaks down a bit if you reuse images across multiple pages.
51+
- **Give a prefix of the application the screenshot shows**. For example `atom-new-file.png`, `atom-commit-changes.png` etc),
52+
- **Name images to describe a process flow**. For example `checkout-1-add-to-cart.png`, `checkout-2-est-shipping.png` and so on.
53+
54+
55+
### Content structure
56+
57+
There are folders for each of the top level products, and those folders might also contain topics that are related to that product area (for example the Privacy Portal section also contains GDPR/CCPA docs).
58+
59+
For the Connections product, the section is divided into the Spec, then Sources, Destinations, and Storage Destinations (formerly called "Warehouses"), with general accessory topics at the folder root. (More specific accessory topics are in each sub directory.)
60+
61+
Each also contains a `catalog` directory, which contains all the directories with information about specific integrations. The top-level of this `catalog` folder (the `index.md`) is a pretty "catalog" page which gives a tile-like view by category, suitable for browsing. It pulls the logo for these tiles from the path for the integration in the metadata, either in `destinations.yml`, `sources.yml`, or `warehouses.yml`.
62+
63+
64+
### Programmatic content
65+
66+
Programmatic content is sections of documentation that are built conditionally, or using public information from our Config API. This is *awesome* and like the holy grail of docs systems.
67+
68+
Programmatic content is built using information in the files in `/src/_data/catalog/`. These files (with the exception of `warehouses.yml`) are built by the `make catalog` command, which contacts our public ConfigAPI, gets a list of all the available integrations using the Catalog API, and then parses them into static `.yml` files.
69+
70+
Most of the programmatic content is built into the `_layouts` templates that each page uses. Sources, Destinations, and Warehouses use the `integration.html` template, which uses some Liquid logic, and calls an `include` depending on the integration type. Most of logic for the actual content must live in the include file itself, however logic controlling *if* the include is built can live in the `layout`.
71+
72+
Destination pages include the `destination-dossier.html` and `destination_footer.md` content, which use Liquid scripting and pulls from the catalog metadata.
73+
74+
Sources pages check if the source is a cloud-app, then include information about if the source is an object or event source, based on the `type` data from the ConfigAPI.
75+
76+
## Edit pages
77+
78+
Content with in each `.md` file is markdown. For information about styling, and available extensions, see `_src/utils/formatguide.md` or the live version [here](https://segment.com/docs/utils/formatguide).
79+
80+
### Frontmatter
81+
82+
Each Markdown file in the docs can have "frontmatter" associated with it at the top of the file. These are considered by Jekyll to be "properties" of a page, generally control how the HTML page is built or rendered.
83+
84+
Frontmatter in a file will look something like this:
85+
86+
```md
87+
---
88+
title: Analytics.js Library
89+
hide-feedback: false
90+
---
91+
```
92+
93+
Each piece of frontmatter does something special!
94+
95+
#### Content-related frontmatter
96+
- `beta`: default false. When true, show an "in beta" warning in the page layout (see the warning in `_includes/content/beta-note.md`)
97+
- `rewrite`: defaults to false. This is a legacy frontmatter flag that comes from the old `site-docs` repo, and which labels any destination that was rewritten in ~2018 to a standardized template. It disables the duplicate "connection modes" table that would otherwise show up in the boilerplate content at the end of the page.
98+
- `hide-dossier`: defaults to false. When true, hides the "quick info" box at the top of a destination page.
99+
- `hide-boilerplate`: defaults to false. When true, none of the content from `destination-footer.md` is appended to the destination page.
100+
- `hide-cmodes`: defaults to false. A renaming of "rewrite" for more clarity, hides the connection modes table in the boilerplate.
101+
- `hide-personas-partial`: defaults to false. When true, hides the section of content from `destination-footer.md` that talks about being able to receive personas data.
102+
- `integration_type`: This is set in the `_config.yml` on three paths to add a noun (Source, Destination, or Warehouse) to the end of the title, and the end of the title tag in the html layout. It also controls the layout and icon for some of these.
103+
- `source-type`: These are only used to supplement when a Cloud App in the sources path doesn't appear in the Config API list, and needs its type explicitly set. It runs some logic in the `cloud-app-note.md` to explain which cloud-apps are object vs event sources.
104+
105+
#### Utility frontmatter
106+
- `published`: defaults to true. Set this to "false" to prevent Jekyll from rendering an HTML page for this file. Good for when you're working on something in the repo but aren't ready to release it yet, and don't want to use a Draft PR.
107+
- `hidden`: omits the file from the `sitemap.xml`, adds a `<meta name="robots" content="noindex" />` to the top of the generated HTML file, and drops it from the convenience script for regenerating the nav.
108+
- `hide-sidebar`: defaults to false. When true, hide the entire right-nav sidebar. Use with `hide-feedback` if you want to disable *all* feedback affordances.
109+
- `hide-feedback`: defaults to false. When true, hide the feedback in both rnav and footer. Good for landing pages.
110+
- `hide_toc`: hides the right-nav TOC that's generated from H2s. Also good for landing pages.
111+
- `landing`: defaults to false. Use this to drop the noun set by `integration_type` from the tab title.
112+
- `redirect_from`: Defaults to null. Takes an array of URLs from the frontmatter in a file, and generates a "stub" page at each URL at build-time. Each stub file redirects to the original file. Use the path from the root of the content directory, for example `/connections/destinations/catalog/` rather than `/docs/connections/destinations/catalog/`. **Note** We are mostly using NGINX redirects for SEO purposes. Approximately quarterly, we'll collect these and add them to NGINX.
113+
- `seo-changefreq`: default: `weekly `. Use the values [in the sitemap spec](https://www.sitemaps.org/protocol.html#xmlTagDefinitions). - sets the `changefreq` tag in the sitemap.xml generator, which tells search crawlers how often to check back.
114+
- `seo-priority`: values from `1.0` to `0.1`, default: `0.5 `. Sets the `Priority` tag in the sitemap

Gemfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ GIT
2121
GEM
2222
remote: https://rubygems.org/
2323
specs:
24-
addressable (2.7.0)
24+
addressable (2.8.0)
2525
public_suffix (>= 2.0.2, < 5.0)
2626
algolia_html_extractor (2.6.4)
2727
json (~> 2.0)
@@ -88,14 +88,14 @@ GEM
8888
rb-fsevent (~> 0.10, >= 0.10.3)
8989
rb-inotify (~> 0.9, >= 0.9.10)
9090
mercenary (0.4.0)
91-
mini_portile2 (2.5.0)
91+
mini_portile2 (2.5.1)
9292
multipart-post (2.1.1)
93-
nokogiri (1.11.1)
93+
nokogiri (1.11.4)
9494
mini_portile2 (~> 2.5.0)
9595
racc (~> 1.4)
96-
nokogiri (1.11.1-x86_64-darwin)
96+
nokogiri (1.11.4-x86_64-darwin)
9797
racc (~> 1.4)
98-
nokogiri (1.11.1-x86_64-linux)
98+
nokogiri (1.11.4-x86_64-linux)
9999
racc (~> 1.4)
100100
pathutil (0.16.2)
101101
forwardable-extended (~> 2.6)
@@ -108,7 +108,7 @@ GEM
108108
rb-fsevent (0.10.4)
109109
rb-inotify (0.10.1)
110110
ffi (~> 1.0)
111-
rexml (3.2.4)
111+
rexml (3.2.5)
112112
rouge (3.25.0)
113113
ruby-enum (0.8.0)
114114
i18n

Makefile

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,30 @@ package: build
4949
serve: package
5050
@docker run -p 4000:80 segment-docs:latest
5151

52+
# gives us user-transparent way to swap between two different systems
5253
.PHONY: catalog
53-
catalog: vendor/bundle
54-
@node scripts/catalog.js
54+
catalog: catalog-papi
55+
56+
# uses the old configapi
57+
.PHONY: capi
58+
capi: vendor/bundle
59+
@node scripts/catalog-capi.js
60+
61+
# shorter alias
62+
.PHONY: catalog-capi
63+
catalog-capi: vendor/bundle
64+
@node scripts/catalog-capi.js
65+
66+
# uses the new public api
67+
.PHONY: catalog-papi
68+
catalog-papi: vendor/bundle
69+
@node scripts/catalog_papi.js
70+
71+
# shorter alias
72+
.PHONY: papi
73+
papi: vendor/bundle
74+
@node scripts/catalog_papi.js
75+
5576

5677
.PHONY: changelog
5778
changelog: vendor/bundle

0 commit comments

Comments
 (0)