diff --git a/README.md b/README.md index a1b8a4fb..2c5df79d 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,33 @@ Category matches on category (English) names ; Tools matches on tools path/url. See (docker-tools-filter-and-home-content)[https://github.com/sharevb/it-tools] +## Add custom external tools + +You can add custom external tools (href or markdownContent) by mounting a `external-tools.json` in `/usr/share/nginx/html` with the following structure: + +```json +[ + { + "name": "GitHub", + "path": "/github", + "description": "Link to Github", + "keywords": ["github"], + "category": "Links", + "href": "https://github.com" + }, + { + "name": "Some text", + "path": "/some-text", + "description": "Some description", + "keywords": ["some"], + "category": "Links", + "markdownContent": "Some useful **text**\n\nin *markdown*" + } +] +``` + +See (docker-tools-filter-and-home-content)[https://github.com/sharevb/it-tools] + ## Setting default tools parameters / default UI language at runtime You can set default tool parameters by mounting a `tools-setting.json` in `/usr/share/nginx/html`. diff --git a/docker-tools-filter-and-home-content/docker-compose.yml b/docker-tools-filter-and-home-content/docker-compose.yml index a39964b3..00ade135 100644 --- a/docker-tools-filter-and-home-content/docker-compose.yml +++ b/docker-tools-filter-and-home-content/docker-compose.yml @@ -5,6 +5,7 @@ services: restart: unless-stopped volumes: - ./tools-filter.json:/usr/share/nginx/html/tools-filter.json + - ./external-tools.json:/usr/share/nginx/html/external-tools.json - ./home.custom.md:/usr/share/nginx/html/home.custom.md ports: - 8080:8080 \ No newline at end of file diff --git a/docker-tools-filter-and-home-content/external-tools.json b/docker-tools-filter-and-home-content/external-tools.json new file mode 100644 index 00000000..ae0d4ae1 --- /dev/null +++ b/docker-tools-filter-and-home-content/external-tools.json @@ -0,0 +1,18 @@ +[ + { + "name": "GitHub", + "path": "/github", + "description": "Link to Github", + "keywords": ["github"], + "category": "Links", + "href": "https://github.com" + }, + { + "name": "Some text", + "path": "/some-text", + "description": "Some description", + "keywords": ["some"], + "category": "Links", + "markdownContent": "Some useful **text**\n\nin *markdown*" + } +] diff --git a/locales/en.yml b/locales/en.yml index 8b7a4730..88888db4 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -7147,3 +7147,4 @@ tools: input-placeholder-paste-your-raw-json-here: Paste your raw JSON here... input-label-your-raw-json: 'Your raw JSON:' output-label-toon-version-of-your-json: 'TOON version of your JSON:' + external-link-goto: 'To open this tool, follow this link: ' diff --git a/public/external-tools.json b/public/external-tools.json new file mode 100644 index 00000000..0637a088 --- /dev/null +++ b/public/external-tools.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/src/layouts/tool.layout.vue b/src/layouts/tool.layout.vue index b17ae374..42eb94c7 100644 --- a/src/layouts/tool.layout.vue +++ b/src/layouts/tool.layout.vue @@ -5,6 +5,7 @@ import type { HeadObject } from '@vueuse/head'; import VueMarkdown from 'vue-markdown-render'; import { useThemeVars } from 'naive-ui'; +import { useTheme } from '../ui/c-link/c-link.theme'; import BaseLayout from './base.layout.vue'; import FavoriteButton from '@/components/FavoriteButton.vue'; import type { Tool } from '@/tools/tools.types'; @@ -71,6 +72,8 @@ const toolFooter = computed(() => { return ((npmPackages.length > 0 ? t('tools.tool.layout.text.made-with-npmpackages-join-n', [npmPackages.join(', ')]) : '') + footer).trim(); }); const themeVars = useThemeVars(); + +const linkTheme = useTheme();