Skip to content

Commit

Permalink
Migrate to new domain
Browse files Browse the repository at this point in the history
  • Loading branch information
rk0cc committed Jun 27, 2024
1 parent e3cdad3 commit 169f4b0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions model/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 3.5.2

* `TwitterCardPropertyParser.legacyDomain`'s default value becomes `false` and marked as deprecated.
* Depencendy constraint changes.

## 3.5.1

* Change Dart SDK constraint
Expand Down
8 changes: 6 additions & 2 deletions model/lib/src/parser/twitter_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,23 @@ final class TwitterCardPropertyParser extends MetaPropertyParser {
/// Uses `twitter.com` instead of `x.com` when constructing
/// link to X's profile.
///
/// By default, it is enabled.
/// By default, it is disabled.
@Deprecated("twitter.com is used for redirect to x.com now.")
final bool legacyDomain;

@override
final String propertyNamePrefix = "twitter";

/// Construct a parser of Twitter Card with decision of
/// using [legacyDomain].
const TwitterCardPropertyParser({this.legacyDomain = true});
const TwitterCardPropertyParser(
{@Deprecated("twitter.com is used for redirect to x.com now.")
this.legacyDomain = false});

@override
void resolveMetaTags(
MetaInfoAssigner assigner, Iterable<PropertyPair> propertyPair) {
// ignore: deprecated_member_use_from_same_package
final Uri twitterSite = Uri.https("${legacyDomain ? 'twitter' : 'x'}.com");
final ImageInfoParser imgParser = ImageInfoParser();
final VideoInfoParser vidParser = VideoInfoParser();
Expand Down
6 changes: 3 additions & 3 deletions model/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: oghref_model
description: Object standarized definition with parser interface for constructing rich information of given URL among various metadata protocols.
version: 3.5.1
version: 3.5.2
repository: https://github.com/rk0cc/oghref/tree/main/model
issue_tracker: https://github.com/rk0cc/oghref/issues
funding:
Expand All @@ -12,13 +12,13 @@ topics:
environment:
sdk: '>=3.3.0 <4.0.0'
dependencies:
meta: ^1.9.1
meta: ^1.12.0
http: ^1.1.0
html: '>=0.15.4 <1.0.0'
mime_dart: ^3.0.0
path: ^1.8.3
web: ^0.5.1
dev_dependencies:
lints: ">=3.0.0 <5.0.0"
lints: ^4.0.0
test: ^1.24.8

0 comments on commit 169f4b0

Please sign in to comment.