Skip to content

Commit 0891f96

Browse files
authored
Merge pull request #87 from i-dot-ai/feature/redirect-to-download
Let Caddy Admin know the link has come from the chat
2 parents 516628a + 5159d13 commit 0891f96

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

frontend/src/components/markdown-converter.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,14 @@ const MarkdownConverter = class extends LitElement {
9999
this.querySelectorAll('a:not([target="_blank"])').forEach((link) => {
100100
link.setAttribute('target', '_blank');
101101
link.setAttribute('rel', 'noreferrer noopener');
102-
const href = link.getAttribute('href') || '';
102+
let href = link.getAttribute('href') || '';
103+
// some links don't start with https:// incorrectly making them relative links
103104
if (!href.startsWith('http')) {
104-
link.setAttribute('href', `https://${href}`);
105+
href = `https://${href}`;
105106
}
107+
// if linking to the caddy doc, this will redirect to the original download/webpage rather than just the document chunks
108+
href += `${href.includes('?') ? '&' : '?'}from-chat=true`;
109+
link.setAttribute('href', href);
106110
link.innerHTML += ' <span class="sr-only top-0 -left-[1000px]">(opens in new tab)</span>';
107111
});
108112
}

terraform/rds.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module "rds" {
1010
]
1111
vpc_id = data.terraform_remote_state.vpc.outputs.vpc_id
1212
engine = "aurora-postgresql"
13-
engine_version = "16.6"
13+
engine_version = "16.8"
1414
family = null
1515
engine_mode = "provisioned"
1616
aurora_min_scaling = 0.5

0 commit comments

Comments
 (0)