Skip to content

Commit

Permalink
TOC is working
Browse files Browse the repository at this point in the history
  • Loading branch information
markzegarelli committed Mar 27, 2024
1 parent bca800c commit 7e67b22
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 19 deletions.
4 changes: 2 additions & 2 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use Statamic\Statamic;
use Statamic\Facades\Markdown;
use League\CommonMark\MarkdownConverter;
use League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkExtension;
use Torchlight\Commonmark\V2\TorchlightExtension;
use Ueberdosis\CommonMark\HintExtension;

class AppServiceProvider extends ServiceProvider
{
Expand All @@ -25,7 +25,7 @@ public function register(): void
public function boot()
{
Markdown::addExtensions(function () {
return [new TorchlightExtension, new HintExtension];
return [new TorchlightExtension, new HeadingPermalinkExtension];
});
}
}
Expand Down
17 changes: 13 additions & 4 deletions config/statamic/markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,20 @@
'configs' => [

'default' => [
// 'heading_permalink' => [
// 'symbol' => '#',
// ],
'heading_permalink' => [
'html_class' => 'heading-permalink',
'id_prefix' => '',
'apply_id_to_heading' => true,
'heading_class' => '',
'fragment_prefix' => '',
'insert' => 'after',
'min_heading_level' => 2,
'max_heading_level' => 6,
'title' => 'Permalink',
'symbol' => '',
'aria_hidden' => true,
],
],

],

];
2 changes: 1 addition & 1 deletion content/collections/get-started/create-org.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: 'Create your organization'
source: 'https://help.amplitude.com/hc/en-us/articles/16796682982427-Create-your-organization'
author: 0c3a318b-936a-4cbd-8fdf-771a90c297f0
updated_by: 0c3a318b-936a-4cbd-8fdf-771a90c297f0
updated_at: 1708625817
updated_at: 1711494180
---
#### This article will help you:

Expand Down
15 changes: 8 additions & 7 deletions content/collections/get-started/track-your-progress.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
---
title: "Track progress as you instrument Amplitude"
source: "https://help.amplitude.com/hc/en-us/articles/19354328238363-Track-progress-as-you-instrument-Amplitude"
id: 772dbd47-bee0-4b64-9672-7d09d16cd433
blueprint: get-started
title: 'Track progress as you instrument Amplitude'
source: 'https://help.amplitude.com/hc/en-us/articles/19354328238363-Track-progress-as-you-instrument-Amplitude'
author: 0c3a318b-936a-4cbd-8fdf-771a90c297f0
updated_by: 0c3a318b-936a-4cbd-8fdf-771a90c297f0
updated_at: 1711494255
---

#### This article will help you:
##### This article will help you:

* Learn how to QA your instrumentation and keep track of event limits
* Understand how Amplitude handles duplicative events
Expand All @@ -23,6 +26,4 @@ If you go over your limit for the month, Amplitude will still collect your data

Amplitude de-duplicates your data to prevent unique events from being logged multiple times. Amplitude checks the event ID, client event time, and device ID for every event. If the event isn't in the database, Amplitude writes it; otherwise, the event is dropped.

If you're using the Amplitude HTTP API, we recommend adding an [insert\_id field](https://help.amplitude.com/hc/en-us/articles/204771828-HTTP-API#optional-amplitude-specific-keys-for-the-event-argument). Amplitude will ignore subsequent events sent with the same event ID/client event time/device ID or insert\_id within the past seven days. 

##
If you're using the Amplitude HTTP API, we recommend adding an [insert\_id field](https://help.amplitude.com/hc/en-us/articles/204771828-HTTP-API#optional-amplitude-specific-keys-for-the-event-argument). Amplitude will ignore subsequent events sent with the same event ID/client event time/device ID or insert\_id within the past seven days. 
22 changes: 22 additions & 0 deletions resources/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,30 @@
background-color: theme('colors.amp-red.500');
}

ul.toc-list {
list-style-type: none;
padding: 0;
}

.toc-link::before {
content:"";
}

.heading-permalink {
opacity: 0;
margin-left: -12px;
}

h1:hover .heading-permalink,
h2:hover .heading-permalink,
h3:hover .heading-permalink,
h4:hover .heading-permalink,
h5:hover .heading-permalink,
h6:hover .heading-permalink
{
opacity: 1;
transition: opacity 0.25s;
}



Expand Down
9 changes: 8 additions & 1 deletion resources/views/_toc.antlers.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<div class="fixed right-0 top-2 js-toc">
<div class="relative">
<div class="sticky top-0 ml-8 text-sm js-toc">
</div>

</div>


<script>
tocbot.init({
// Where to render the table of contents.
Expand All @@ -11,5 +15,8 @@
headingSelector: 'h2, h3, h4',
// For headings inside relative or absolute positioned containers within content.
hasInnerContainers: true,
ignoreSelector: '.hint-title',
orderedList: false,
ignoreHiddenElements: true,
});
</script>
3 changes: 0 additions & 3 deletions resources/views/_toc.html

This file was deleted.

4 changes: 3 additions & 1 deletion resources/views/default.antlers.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ <h1>{{title}}</h1>
{{# <p class="text-xs text-amp-light-blue-700">Last updated: {{updated_at}} by {{updated_by:email}}</p>
#}}

{{partial:toc}}



</div>
{{partial:toc}}
</div>

</div>

</section>
Expand Down

0 comments on commit 7e67b22

Please sign in to comment.