svelte-meta-tags 2.5.5 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [2.5.5](https://github.com/oekazuma/svelte-meta-tags/compare/v2.5.4...v2.5.5) (2022-05-06)
2
+
3
+ ### Bug Fixes
4
+
5
+ - revert JSON.stringify options back to previous ([5160cec](https://github.com/oekazuma/svelte-meta-tags/commit/5160cec32f50a29a8e59aa87f851557444ad26a3))
6
+
1
7
  ## [2.5.4](https://github.com/oekazuma/svelte-meta-tags/compare/v2.5.3...v2.5.4) (2022-05-06)
2
8
 
3
9
  ### Bug Fixes
package/README.md CHANGED
@@ -44,8 +44,8 @@ This library is inspired by [next-seo](https://github.com/garmeeh/next-seo)
44
44
  - [Course](#course)
45
45
  - [DataSet](#dataset)
46
46
  - [FAQ](#faq)
47
- - [Types Import](#types-import)
48
- - [Types Import Examples](#types-import-examples)
47
+ - [Types](#types)
48
+ - [Additional types](#additional-types)
49
49
 
50
50
  ### 📦 Installing
51
51
 
@@ -788,85 +788,259 @@ This plugin uses [schema-dts](https://github.com/google/schema-dts), so it also
788
788
  />
789
789
  ```
790
790
 
791
- ## Types Import
791
+ ## Types
792
+
793
+ The following types can be imported from `svelte-meta-tags`
794
+
795
+ ### MetaTagsProps
796
+
797
+ ```ts
798
+ interface MetaTagsProps {
799
+ title?: string;
800
+ titleTemplate?: string;
801
+ noindex?: boolean;
802
+ nofollow?: boolean;
803
+ robotsProps?: AdditionalRobotsProps;
804
+ description?: string;
805
+ canonical?: string;
806
+ mobileAlternate?: MobileAlternate;
807
+ languageAlternates?: ReadonlyArray<LanguageAlternate>;
808
+ twitter?: Twitter;
809
+ facebook?: Facebook;
810
+ openGraph?: OpenGraph;
811
+ additionalMetaTags?: ReadonlyArray<MetaTag>;
812
+ additionalLinkTags?: ReadonlyArray<LinkTag>;
813
+ }
814
+ ```
792
815
 
793
- You can import and use the types `MetaTagsProps` and `JsonLdProps`.
816
+ ### JsonLdProps
794
817
 
795
- ### Types Import Examples
818
+ ```ts
819
+ interface JsonLdProps {
820
+ output?: 'head' | 'body';
821
+ schema?: Thing | WithContext<Thing>;
822
+ }
823
+ ```
796
824
 
797
- ```svelte
798
- <script lang="ts">
799
- import { MetaTags, JsonLd } from 'svelte-meta-tags';
800
- import type { MetaTagsProps, JsonLdProps } from 'svelte-meta-tags';
801
-
802
- const metatags: MetaTagsProps = {
803
- title: 'Types Page Title | Svelte Meta Tags',
804
- description: 'Description of Types page',
805
- canonical: 'https://www.canonical.ie/',
806
- openGraph: {
807
- type: 'website',
808
- url: 'https://www.example.com/page',
809
- locale: 'en_IE',
810
- title: 'Open Graph Title',
811
- description: 'Open Graph Description',
812
- images: [
813
- {
814
- url: 'https://www.example.ie/og-image.jpg',
815
- width: 800,
816
- height: 600,
817
- alt: 'Og Image Alt'
818
- }
819
- ],
820
- site_name: 'SiteName'
821
- },
822
- twitter: {
823
- handle: '@handle',
824
- site: '@site',
825
- cardType: 'summary_large_image',
826
- title: 'Types Page Title | Svelte Meta Tags',
827
- description: 'Description of Types page',
828
- image: 'https://www.example.ie/twitter-image.jpg',
829
- imageAlt: 'Twitter image alt'
830
- },
831
- facebook: {
832
- appId: '1234567890'
833
- }
834
- };
835
-
836
- const jsonld: JsonLdProps = {
837
- schema: {
838
- '@type': 'NewsArticle',
839
- mainEntityOfPage: {
840
- '@type': 'WebPage',
841
- '@id': 'https://google.com/article'
842
- },
843
- headline: 'Article headline',
844
- image: [
845
- 'https://example.com/photos/1x1/photo.jpg',
846
- 'https://example.com/photos/4x3/photo.jpg',
847
- 'https://example.com/photos/16x9/photo.jpg'
848
- ],
849
- datePublished: '2015-02-05T08:00:00+08:00',
850
- dateModified: '2015-02-05T09:20:00+08:00',
851
- author: {
852
- '@type': 'Person',
853
- name: 'John Doe'
854
- },
855
- publisher: {
856
- '@type': 'Organization',
857
- name: 'Google',
858
- logo: {
859
- '@type': 'ImageObject',
860
- url: 'https://google.com/logo.jpg'
861
- }
862
- }
863
- }
864
- };
865
- </script>
825
+ ### AdditionalRobotsProps
826
+
827
+ ```ts
828
+ interface AdditionalRobotsProps {
829
+ nosnippet?: boolean;
830
+ maxSnippet?: number;
831
+ maxImagePreview?: 'none' | 'standard' | 'large';
832
+ maxVideoPreview?: number;
833
+ noarchive?: boolean;
834
+ unavailableAfter?: string;
835
+ noimageindex?: boolean;
836
+ notranslate?: boolean;
837
+ }
838
+ ```
839
+
840
+ ### MobileAlternate
841
+
842
+ ```ts
843
+ interface MobileAlternate {
844
+ media: string;
845
+ href: string;
846
+ }
847
+ ```
848
+
849
+ ### LanguageAlternate
850
+
851
+ ```ts
852
+ interface LanguageAlternate {
853
+ hrefLang: string;
854
+ href: string;
855
+ }
856
+ ```
857
+
858
+ ### Twitter
859
+
860
+ ```ts
861
+ interface Twitter {
862
+ cardType?: 'summary' | 'summary_large_image' | 'app' | 'player';
863
+ site?: string;
864
+ handle?: string;
865
+ title?: string;
866
+ description?: string;
867
+ image?: string;
868
+ imageAlt?: string;
869
+ }
870
+ ```
871
+
872
+ ### Facebook
873
+
874
+ ```ts
875
+ interface Facebook {
876
+ appId?: string;
877
+ }
878
+ ```
879
+
880
+ ### OpenGraph
881
+
882
+ ```ts
883
+ interface OpenGraph {
884
+ url?: string;
885
+ type?: string;
886
+ title?: string;
887
+ description?: string;
888
+ images?: ReadonlyArray<OpenGraphImages>;
889
+ videos?: ReadonlyArray<OpenGraphVideos>;
890
+ locale?: string;
891
+ site_name?: string;
892
+ profile?: OpenGraphProfile;
893
+ book?: OpenGraphBook;
894
+ article?: OpenGraphArticle;
895
+ video?: OpenGraphVideo;
896
+ }
897
+ ```
898
+
899
+ ### MetaTag
866
900
 
867
- <MetaTags {...metatags} />
901
+ ```ts
902
+ type MetaTag = HTML5MetaTag | RDFaMetaTag | HTTPEquivMetaTag;
903
+ ```
904
+
905
+ ### LinkTag
906
+
907
+ ```ts
908
+ interface LinkTag {
909
+ rel: string;
910
+ href: string;
911
+ sizes?: string;
912
+ type?: string;
913
+ color?: string;
914
+ }
915
+ ```
916
+
917
+ ## Additional types
918
+
919
+ The following are referenced by the public types documented above, but cannot be imported directly
920
+
921
+ ### OpenGraphImages
922
+
923
+ ```ts
924
+ interface OpenGraphImages {
925
+ url: string;
926
+ alt?: string;
927
+ width?: number;
928
+ height?: number;
929
+ }
930
+ ```
931
+
932
+ ### OpenGraphVideos
933
+
934
+ ```ts
935
+ interface OpenGraphVideos {
936
+ url: string;
937
+ alt?: string;
938
+ width?: number;
939
+ height?: number;
940
+ secureUrl?: string;
941
+ type?: string;
942
+ }
943
+ ```
944
+
945
+ ### OpenGraphProfile
946
+
947
+ ```ts
948
+ interface OpenGraphProfile {
949
+ firstName?: string;
950
+ lastName?: string;
951
+ username?: string;
952
+ gender?: string;
953
+ }
954
+ ```
955
+
956
+ ### OpenGraphBook
957
+
958
+ ```ts
959
+ interface OpenGraphBook {
960
+ authors?: ReadonlyArray<string>;
961
+ isbn?: string;
962
+ releaseDate?: string;
963
+ tags?: ReadonlyArray<string>;
964
+ }
965
+ ```
966
+
967
+ ### OpenGraphArticle
968
+
969
+ ```ts
970
+ interface OpenGraphArticle {
971
+ publishedTime?: string;
972
+ modifiedTime?: string;
973
+ expirationTime?: string;
974
+ authors?: ReadonlyArray<string>;
975
+ section?: string;
976
+ tags?: ReadonlyArray<string>;
977
+ }
978
+ ```
979
+
980
+ ### OpenGraphVideo
981
+
982
+ ```ts
983
+ interface OpenGraphVideo {
984
+ actors?: ReadonlyArray<OpenGraphVideoActors>;
985
+ directors?: ReadonlyArray<string>;
986
+ writers?: ReadonlyArray<string>;
987
+ duration?: number;
988
+ releaseDate?: string;
989
+ tags?: ReadonlyArray<string>;
990
+ series?: string;
991
+ }
992
+ ```
993
+
994
+ ### OpenGraphVideoActors
995
+
996
+ ```ts
997
+ interface OpenGraphVideoActors {
998
+ profile: string;
999
+ role?: string;
1000
+ }
1001
+ ```
1002
+
1003
+ ### BaseMetaTag
1004
+
1005
+ ```ts
1006
+ interface BaseMetaTag {
1007
+ content: string;
1008
+ }
1009
+ ```
1010
+
1011
+ ### HTML5MetaTag
1012
+
1013
+ ```ts
1014
+ interface HTML5MetaTag extends BaseMetaTag {
1015
+ name: string;
1016
+ property?: undefined;
1017
+ httpEquiv?: undefined;
1018
+ }
1019
+ ```
1020
+
1021
+ ### RDFaMetaTag
1022
+
1023
+ ```ts
1024
+ interface RDFaMetaTag extends BaseMetaTag {
1025
+ property: string;
1026
+ name?: undefined;
1027
+ httpEquiv?: undefined;
1028
+ }
1029
+ ```
868
1030
 
869
- <JsonLd {...jsonld} />
1031
+ ### HTTPEquivMetaTag
1032
+
1033
+ ```ts
1034
+ interface HTTPEquivMetaTag extends BaseMetaTag {
1035
+ httpEquiv:
1036
+ | 'content-security-policy'
1037
+ | 'content-type'
1038
+ | 'default-style'
1039
+ | 'x-ua-compatible'
1040
+ | 'refresh';
1041
+ name?: undefined;
1042
+ property?: undefined;
1043
+ }
870
1044
  ```
871
1045
 
872
1046
  ## License
package/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { default as MetaTags } from './MetaTags.svelte';
2
2
  export { default as JsonLd } from './JsonLd.svelte';
3
- export type { MetaTagsProps, JsonLdProps } from './types';
3
+ export type { MetaTagsProps, JsonLdProps, AdditionalRobotsProps, MobileAlternate, LanguageAlternate, Twitter, Facebook, OpenGraph, MetaTag, LinkTag } from './types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-meta-tags",
3
- "version": "2.5.5",
3
+ "version": "2.6.0",
4
4
  "description": "Svelte Meta Tags is a plugin that makes managing your SEO easier in Svelte projects.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,28 +21,28 @@
21
21
  "schema-dts": "1.1.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@commitlint/cli": "16.2.4",
24
+ "@commitlint/cli": "16.3.0",
25
25
  "@commitlint/config-conventional": "16.2.4",
26
26
  "@semantic-release/changelog": "6.0.1",
27
27
  "@semantic-release/git": "10.0.1",
28
- "@sveltejs/adapter-auto": "1.0.0-next.40",
29
- "@sveltejs/kit": "1.0.0-next.326",
30
- "@typescript-eslint/eslint-plugin": "5.22.0",
31
- "@typescript-eslint/parser": "5.22.0",
32
- "cypress": "9.6.0",
33
- "eslint": "8.14.0",
28
+ "@sveltejs/adapter-auto": "1.0.0-next.42",
29
+ "@sveltejs/kit": "1.0.0-next.330",
30
+ "@typescript-eslint/eslint-plugin": "5.23.0",
31
+ "@typescript-eslint/parser": "5.23.0",
32
+ "cypress": "9.6.1",
33
+ "eslint": "8.15.0",
34
34
  "eslint-config-prettier": "8.5.0",
35
35
  "eslint-plugin-cypress": "2.12.1",
36
36
  "eslint-plugin-svelte3": "4.0.0",
37
- "husky": "7.0.4",
37
+ "husky": "8.0.1",
38
38
  "lint-staged": "12.4.1",
39
39
  "prettier": "2.6.2",
40
40
  "prettier-plugin-svelte": "2.7.0",
41
41
  "semantic-release": "19.0.2",
42
42
  "svelte": "3.48.0",
43
- "svelte-check": "2.7.0",
43
+ "svelte-check": "2.7.1",
44
44
  "svelte-preprocess": "4.10.6",
45
- "svelte2tsx": "0.5.9",
45
+ "svelte2tsx": "0.5.10",
46
46
  "tslib": "2.4.0",
47
47
  "typescript": "4.6.4"
48
48
  },