Skip to content

Commit f645eac

Browse files
authored
Addressing some tech debt (#1484)
* sanity rename * split out source and destination layouts * handle redirects from paths with no index
1 parent f593f89 commit f645eac

File tree

10 files changed

+77
-31
lines changed

10 files changed

+77
-31
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ Each piece of frontmatter does something special!
189189
#### Content-related frontmatter
190190
- `beta`: default false. When true, show an "in beta" warning in the page layout (see the warning in `_includes/content/beta-note.md`)
191191
- `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.
192-
- `hide-boilerplate`: defaults to false. When true, none of the content from `integration-foot.md` is appended to the destination page.
192+
- `hide-boilerplate`: defaults to false. When true, none of the content from `destination-footer.md` is appended to the destination page.
193193
- `hide-cmodes`: defaults to false. A renaming of "rewrite" for more clarity, hides the connection modes table in the boilerplate.
194-
- `hide-personas-partial`: defaults to false. When true, hides the section of content from `integration-foot.md` that talks about being able to receive personas data.
194+
- `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.
195195
- `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.
196196
- `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.
197197

_config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ defaults:
2525
path: "connections/destinations/catalog"
2626
values:
2727
integration_type: destination
28-
layout: integration
28+
layout: destination
2929
- scope:
3030
path: "connections/sources/catalog"
3131
values:
3232
integration_type: source
33-
layout: integration
33+
layout: source
3434
- scope:
3535
path: "connections/storage/catalog"
3636
values:
@@ -53,4 +53,4 @@ algolia:
5353
application_id: UINQ2M4D9S
5454
index_name: segment-docs
5555
files_to_exclude:
56-
- _release_notes/*
56+
- _release_notes/*

devguide.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,19 @@ It also does some slugification and destination-name normalization, since our ha
5353

5454
### Layouts
5555

56-
`default.html` is the base container through which all the individual other layouts (currently one, `page.html`) are built to have the right title, seo, etc. `Integration.html` contains the logic that runs the catalog pages.
56+
`default.html` is the base container through which all the individual other layouts are built to have the right title, seo, etc. The template inheritance is described in the diagram below.
57+
58+
The `destination.html`, `source.html`, and `integration.html` templates contain the logic that runs the layouts for individual catalog pages. Storage/warehouses use the generic Integration right now because they don't need anything special. Set the layout in the Jekyll `_config.yml` file.
5759

5860
```text
5961
default.html
60-
|- integration.html
61-
|- catalog.html
62-
|- main.html
63-
|-page.html
64-
|-home.html
62+
|- integration.html
63+
|- destination.html
64+
|- source.html
65+
|- main.html
66+
|- catalog.html
67+
|- home.html
68+
|- page.html
6569
```
6670

6771
### Platform Config API + Catalog
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!-- canary comment -->
2+
3+
<!-- in the file we're pulling from the API, "name" corresponds with the path to the yml blob for a specific destination.-->
4+
{% assign currentSlug = page.url | split: "/" | last %}
5+
{% assign currentIntegration = site.data.catalog.destinations.items | where: "slug", currentSlug | first %}
6+
{% if currentIntegration %}
7+
<!-- this endif prevents you from showing a dossier if there's no info in destinations.yml-->
8+
9+
10+
11+
<!-- TODO -->
12+
13+
14+
{% endif %}
File renamed without changes.

src/_layouts/destination.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
layout: integration
3+
---
4+
<div class="markdown">
5+
6+
{% unless page.hide-dossier == true %}
7+
{% capture destination-dossier %}{% include content/destination-dossier.md %}{% endcapture %}
8+
{{ destination-dossier | markdownify }}
9+
{% endunless %}
10+
11+
12+
{{ content }}
13+
14+
{% unless page.hide-boilerplate == true %}
15+
{% capture destination-footer %}{% include content/destination-footer.md %}{% endcapture %}
16+
{{ destination-footer | markdownify }}
17+
{% endunless %}
18+
19+
</div>

src/_layouts/integration.html

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99
{% include_cached navbar/logo.html %}
1010
</div>
1111

12-
{% if page.strat %}
13-
{% include menu/menu-strat.html %}
14-
{% else %}
15-
{% include_cached menu/menu-{{ page.integration_type }}.html %}
12+
{% if page.strat %}
13+
{% include menu/menu-strat.html %}
14+
{% else %}
15+
{% include_cached menu/menu-{{ page.integration_type }}.html %}
1616
{% endif %}
1717
</div>
1818

1919
<main class="docs__body stage__body">
2020
<div class="docs__navbar">
2121
<div class="flex flex--justify gutter gutter--large@medium">
22-
<div class="flex__column flex__column--6@xlarge">
22+
<div class="flex__column flex__column--6@xlarge">
2323
<div class="search">
2424
{% include_cached navbar/search.html container="autocomplete" %}
2525
</div>
2626
</div>
2727

28-
<div class="flex__column flex__column--shrink">
28+
<div class="flex__column flex__column--shrink">
2929
{% include_cached navbar/nav.html %}
3030
</div>
3131
</div>
@@ -65,19 +65,10 @@ <h1 id="{{ page.title | slugify }}">
6565
{%- endunless -%}
6666

6767
<div class="markdown">
68-
{% if page.integration_type == 'source' %}
69-
{% capture cloud-app-note %}{% include content/cloud-app-note.md %}{% endcapture %}
70-
{{ cloud-app-note | markdownify }}
71-
{% endif %}
68+
7269

7370
{{ content }}
7471

75-
{% if page.integration_type == 'destination' %}
76-
{% unless page.hide-boilerplate == true %}
77-
{% capture integration-foot %}{% include content/integration-foot.md %}{% endcapture %}
78-
{{ integration-foot | markdownify }}
79-
{% endunless %}
80-
{% endif %}
8172
</div>
8273

8374
<p class="last-modified">This page was last modified: {{ page.last_modified_at | date: '%d %b %Y' }}</p>
@@ -99,10 +90,10 @@ <h1 id="{{ page.title | slugify }}">
9990
{% if page.hide-boilerplate == true %}
10091
{% assign toc_content = content %}
10192
{% else %}
102-
{% assign toc_foot = integration-foot | markdownify %}
93+
{% assign toc_foot = destination-footer | markdownify %}
10394
{% assign toc_content = content | append: toc_foot %}
10495
{% endif %}
105-
96+
10697
<div data-anchors-indicator data-sections="h2" data-active-class="menu-side__link--active">
10798
{% include sidebar/menu-side.html class="menu-side" anchor_class="menu-side__link" html=toc_content h_min=2 h_max=2 %}
10899
</div>

src/_layouts/source.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
layout: integration
3+
---
4+
5+
<div class="markdown">
6+
{% if page.integration_type == 'source' %}
7+
{% capture cloud-app-note %}{% include content/cloud-app-note.md %}{% endcapture %}
8+
{{ cloud-app-note | markdownify }}
9+
{% endif %}
10+
11+
{{ content }}
12+
13+
</div>

src/connections/sources/catalog/index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ layout: catalog
88
menu_icon: "read-more"
99
redirect_from:
1010
- '/docs/connections/sources/catalog/cloud-apps/'
11-
- '/docs/connections/sources/catalog/cloud-apps/'
11+
- '/docs/connections/sources/catalog/libraries/'
12+
- '/docs/connections/sources/catalog/libraries/'
13+
- '/docs/connections/sources/catalog/libraries/mobile/'
14+
- '/docs/connections/sources/catalog/libraries/ott/'
15+
- '/docs/connections/sources/catalog/libraries/server/'
16+
- '/docs/connections/sources/catalog/libraries/website/'
1217
---
1318
Below is a list of the available sources on the Segment platform.
1419

src/connections/storage/catalog/amazon-s3/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,4 @@ For user-property destinations, Segment sends an [identify](/docs/connections/sp
216216

217217
When you first create an audience, Personas sends an Identify call for every user in that audience. Later audience syncs send updates for users whose membership has changed since the last sync.
218218

219-
{% include content/integration-foot.md %}
219+
{% include content/destination-footer.md %}

0 commit comments

Comments
 (0)