diff --git a/README.md b/README.md index 4da60c30..0b53f661 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,23 @@ services: - 8080:8080 ``` +## Filter tools and add home custom content + +You can add custom content in Home page by mounting a `home.custom.md` in `/usr/share/nginx/html`. + +You can filter available tools by mounting `tools-filter.json` in `/usr/share/nginx/html`. It can contains the following filtering regex: +```json +{ + "excludeCategoryFilterRegex": "", + "includeCategoryFilterRegex": "", + "excludeToolsFilterRegex": "", + "includeToolsFilterRegex": "" +} +``` +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] + ## To build using a custom folder: ``` diff --git a/components.d.ts b/components.d.ts index 2aae30df..bb63627a 100644 --- a/components.d.ts +++ b/components.d.ts @@ -279,6 +279,8 @@ declare module '@vue/runtime-core' { NH1: typeof import('naive-ui')['NH1'] NH3: typeof import('naive-ui')['NH3'] NIcon: typeof import('naive-ui')['NIcon'] + NInputGroup: typeof import('naive-ui')['NInputGroup'] + NInputGroupLabel: typeof import('naive-ui')['NInputGroupLabel'] NInputNumber: typeof import('naive-ui')['NInputNumber'] NLayout: typeof import('naive-ui')['NLayout'] NLayoutSider: typeof import('naive-ui')['NLayoutSider'] diff --git a/docker-tools-filter-and-home-content/docker-compose.yml b/docker-tools-filter-and-home-content/docker-compose.yml new file mode 100644 index 00000000..a39964b3 --- /dev/null +++ b/docker-tools-filter-and-home-content/docker-compose.yml @@ -0,0 +1,10 @@ +services: + it-tools: + image: sharevb/it-tools:latest + pull_policy: always + restart: unless-stopped + volumes: + - ./tools-filter.json:/usr/share/nginx/html/tools-filter.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/home.custom.md b/docker-tools-filter-and-home-content/home.custom.md new file mode 100644 index 00000000..aec696a1 --- /dev/null +++ b/docker-tools-filter-and-home-content/home.custom.md @@ -0,0 +1,9 @@ +### Some titles + +Text + +``` +code +``` + +And [link](https://sharevb-it-tools.vercel.app/) \ No newline at end of file diff --git a/docker-tools-filter-and-home-content/tools-filter.json b/docker-tools-filter-and-home-content/tools-filter.json new file mode 100644 index 00000000..0f7061c9 --- /dev/null +++ b/docker-tools-filter-and-home-content/tools-filter.json @@ -0,0 +1,6 @@ +{ + "excludeCategoryFilterRegex": "^(Gaming|Maths|Physics)$", + "includeCategoryFilterRegex": "", + "excludeToolsFilterRegex": "ai-prompt-splitter", + "includeToolsFilterRegex": "illuminance-converter" +} diff --git a/public/home.custom.md b/public/home.custom.md new file mode 100644 index 00000000..e69de29b diff --git a/public/tools-filter.json b/public/tools-filter.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/public/tools-filter.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/pages/Home.page.vue b/src/pages/Home.page.vue index acda02da..368b6d18 100644 --- a/src/pages/Home.page.vue +++ b/src/pages/Home.page.vue @@ -3,11 +3,24 @@ import { IconDragDrop, IconFileDescription, IconHeart } from '@tabler/icons-vue' import { useHead } from '@vueuse/head'; import { computed } from 'vue'; import Draggable from 'vuedraggable'; +import VueMarkdown from 'vue-markdown-render'; import ColoredCard from '../components/ColoredCard.vue'; import ToolCard from '../components/ToolCard.vue'; import { useToolStore } from '@/tools/tools.store'; import { config } from '@/config'; +const base = import.meta.env.BASE_URL ?? '/'; +const homeCustomMarkdown = computedAsync(async () => { + try { + const remoteCustomHomeMarkdownResponse = await fetch(`${base}home.custom.md`); + if (remoteCustomHomeMarkdownResponse.ok) { + return await remoteCustomHomeMarkdownResponse.text(); + } + } + catch {} + return ''; +}); + const toolStore = useToolStore(); useHead({ title: 'IT Tools - Handy online tools for developers' }); @@ -87,6 +100,10 @@ function onUpdateFavoriteTools() { +